From 99d8d0a484eca8901ea6f1d556d51411ddfd9209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Mon, 4 Feb 2019 01:47:12 +0900 Subject: [PATCH] Create type definition for '*/const.json' (#4118) --- src/@types/const.json.d.ts | 3 +++ src/server/web/docs.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 src/@types/const.json.d.ts diff --git a/src/@types/const.json.d.ts b/src/@types/const.json.d.ts new file mode 100644 index 000000000..40a96f2a2 --- /dev/null +++ b/src/@types/const.json.d.ts @@ -0,0 +1,3 @@ +declare module '*/const.json' { + const copyright: string; +} diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts index 1455abae7..0597f50a9 100644 --- a/src/server/web/docs.ts +++ b/src/server/web/docs.ts @@ -14,7 +14,7 @@ import * as glob from 'glob'; import * as yaml from 'js-yaml'; import config from '../../config'; import { licenseHtml } from '../../misc/license'; -const constants = require('../../const.json'); +import { copyright } from '../../const.json'; import endpoints from '../api/endpoints'; import locales from '../../../locales'; import * as nestedProperty from 'nested-property'; @@ -59,7 +59,7 @@ async function genVars(lang: string): Promise<{ [key: string]: any }> { vars['config'] = config; - vars['copyright'] = constants.copyright; + vars['copyright'] = copyright; vars['license'] = licenseHtml;