@docusaurus/utils-validation 2.0.0-beta.2 → 2.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Joi.d.ts +1 -0
- package/lib/Joi.d.ts.map +1 -0
- package/lib/Joi.js +1 -0
- package/lib/Joi.js.map +1 -0
- package/lib/JoiFrontMatter.d.ts +18 -0
- package/lib/JoiFrontMatter.d.ts.map +1 -0
- package/lib/JoiFrontMatter.js +33 -0
- package/lib/JoiFrontMatter.js.map +1 -0
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +19 -5
- package/lib/index.js.map +1 -0
- package/lib/validationSchemas.d.ts +6 -0
- package/lib/validationSchemas.d.ts.map +1 -0
- package/lib/validationSchemas.js +48 -20
- package/lib/validationSchemas.js.map +1 -0
- package/lib/validationUtils.d.ts +19 -6
- package/lib/validationUtils.d.ts.map +1 -0
- package/lib/validationUtils.js +32 -63
- package/lib/validationUtils.js.map +1 -0
- package/package.json +8 -7
- package/src/JoiFrontMatter.ts +31 -0
- package/src/index.ts +17 -2
- package/src/validationSchemas.ts +55 -15
- package/src/validationUtils.ts +30 -78
- package/lib/.tsbuildinfo +0 -1
- package/src/__tests__/__snapshots__/validationSchemas.test.ts.snap +0 -63
- package/src/__tests__/validationSchemas.test.ts +0 -131
- package/src/__tests__/validationUtils.test.ts +0 -64
- package/tsconfig.json +0 -9
package/lib/Joi.d.ts
CHANGED
package/lib/Joi.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Joi.d.ts","sourceRoot":"","sources":["../src/Joi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,KAAK,CAAC"}
|
package/lib/Joi.js
CHANGED
|
@@ -9,3 +9,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
var joi_1 = require("joi");
|
|
11
11
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(joi_1).default; } });
|
|
12
|
+
//# sourceMappingURL=Joi.js.map
|
package/lib/Joi.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Joi.js","sourceRoot":"","sources":["../src/Joi.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAA4B;AAApB,+GAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import Joi from './Joi';
|
|
8
|
+
/**
|
|
9
|
+
* Enhance the default `Joi.string()` type so that it can convert number to
|
|
10
|
+
* strings. If user use front matter "tag: 2021", we shouldn't need to ask her
|
|
11
|
+
* to write "tag: '2021'". Also yaml tries to convert patterns like "2019-01-01"
|
|
12
|
+
* to dates automatically.
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/facebook/docusaurus/issues/4642
|
|
15
|
+
* @see https://github.com/sideway/joi/issues/1442#issuecomment-823997884
|
|
16
|
+
*/
|
|
17
|
+
export declare const JoiFrontMatter: typeof Joi;
|
|
18
|
+
//# sourceMappingURL=JoiFrontMatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JoiFrontMatter.d.ts","sourceRoot":"","sources":["../src/JoiFrontMatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,GAAG,MAAM,OAAO,CAAC;AAcxB;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,GAAsC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.JoiFrontMatter = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const Joi_1 = tslib_1.__importDefault(require("./Joi"));
|
|
12
|
+
const JoiFrontMatterString = {
|
|
13
|
+
type: 'string',
|
|
14
|
+
base: Joi_1.default.string(),
|
|
15
|
+
// Fix Yaml that tries to auto-convert many things to string out of the box
|
|
16
|
+
prepare: (value) => {
|
|
17
|
+
if (typeof value === 'number' || value instanceof Date) {
|
|
18
|
+
return { value: value.toString() };
|
|
19
|
+
}
|
|
20
|
+
return { value };
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Enhance the default `Joi.string()` type so that it can convert number to
|
|
25
|
+
* strings. If user use front matter "tag: 2021", we shouldn't need to ask her
|
|
26
|
+
* to write "tag: '2021'". Also yaml tries to convert patterns like "2019-01-01"
|
|
27
|
+
* to dates automatically.
|
|
28
|
+
*
|
|
29
|
+
* @see https://github.com/facebook/docusaurus/issues/4642
|
|
30
|
+
* @see https://github.com/sideway/joi/issues/1442#issuecomment-823997884
|
|
31
|
+
*/
|
|
32
|
+
exports.JoiFrontMatter = Joi_1.default.extend(JoiFrontMatterString);
|
|
33
|
+
//# sourceMappingURL=JoiFrontMatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JoiFrontMatter.js","sourceRoot":"","sources":["../src/JoiFrontMatter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,wDAAwB;AAExB,MAAM,oBAAoB,GAAkB;IAC1C,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE;IAClB,2EAA2E;IAC3E,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACjB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,IAAI,EAAE;YACtD,OAAO,EAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAC,CAAC;SAClC;QACD,OAAO,EAAC,KAAK,EAAC,CAAC;IACjB,CAAC;CACF,CAAC;AAEF;;;;;;;;GAQG;AACU,QAAA,cAAc,GAAe,aAAG,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -5,5 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
export { default as Joi } from './Joi';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export { JoiFrontMatter } from './JoiFrontMatter';
|
|
9
|
+
export { printWarning, normalizePluginOptions, normalizeThemeConfig, validateFrontMatter, } from './validationUtils';
|
|
10
|
+
export { PluginIdSchema, RemarkPluginsSchema, RehypePluginsSchema, AdmonitionsSchema, URISchema, PathnameSchema, FrontMatterTagsSchema, FrontMatterTOCHeadingLevels, } from './validationSchemas';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,OAAO,IAAI,GAAG,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -6,10 +6,24 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Joi = void 0;
|
|
10
|
-
const tslib_1 = require("tslib");
|
|
9
|
+
exports.FrontMatterTOCHeadingLevels = exports.FrontMatterTagsSchema = exports.PathnameSchema = exports.URISchema = exports.AdmonitionsSchema = exports.RehypePluginsSchema = exports.RemarkPluginsSchema = exports.PluginIdSchema = exports.validateFrontMatter = exports.normalizeThemeConfig = exports.normalizePluginOptions = exports.printWarning = exports.JoiFrontMatter = exports.Joi = void 0;
|
|
11
10
|
// /!\ don't remove this export, as we recommend plugin authors to use it
|
|
12
11
|
var Joi_1 = require("./Joi");
|
|
13
|
-
Object.defineProperty(exports, "Joi", { enumerable: true, get: function () { return
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
Object.defineProperty(exports, "Joi", { enumerable: true, get: function () { return __importDefault(Joi_1).default; } });
|
|
13
|
+
var JoiFrontMatter_1 = require("./JoiFrontMatter");
|
|
14
|
+
Object.defineProperty(exports, "JoiFrontMatter", { enumerable: true, get: function () { return JoiFrontMatter_1.JoiFrontMatter; } });
|
|
15
|
+
var validationUtils_1 = require("./validationUtils");
|
|
16
|
+
Object.defineProperty(exports, "printWarning", { enumerable: true, get: function () { return validationUtils_1.printWarning; } });
|
|
17
|
+
Object.defineProperty(exports, "normalizePluginOptions", { enumerable: true, get: function () { return validationUtils_1.normalizePluginOptions; } });
|
|
18
|
+
Object.defineProperty(exports, "normalizeThemeConfig", { enumerable: true, get: function () { return validationUtils_1.normalizeThemeConfig; } });
|
|
19
|
+
Object.defineProperty(exports, "validateFrontMatter", { enumerable: true, get: function () { return validationUtils_1.validateFrontMatter; } });
|
|
20
|
+
var validationSchemas_1 = require("./validationSchemas");
|
|
21
|
+
Object.defineProperty(exports, "PluginIdSchema", { enumerable: true, get: function () { return validationSchemas_1.PluginIdSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "RemarkPluginsSchema", { enumerable: true, get: function () { return validationSchemas_1.RemarkPluginsSchema; } });
|
|
23
|
+
Object.defineProperty(exports, "RehypePluginsSchema", { enumerable: true, get: function () { return validationSchemas_1.RehypePluginsSchema; } });
|
|
24
|
+
Object.defineProperty(exports, "AdmonitionsSchema", { enumerable: true, get: function () { return validationSchemas_1.AdmonitionsSchema; } });
|
|
25
|
+
Object.defineProperty(exports, "URISchema", { enumerable: true, get: function () { return validationSchemas_1.URISchema; } });
|
|
26
|
+
Object.defineProperty(exports, "PathnameSchema", { enumerable: true, get: function () { return validationSchemas_1.PathnameSchema; } });
|
|
27
|
+
Object.defineProperty(exports, "FrontMatterTagsSchema", { enumerable: true, get: function () { return validationSchemas_1.FrontMatterTagsSchema; } });
|
|
28
|
+
Object.defineProperty(exports, "FrontMatterTOCHeadingLevels", { enumerable: true, get: function () { return validationSchemas_1.FrontMatterTOCHeadingLevels; } });
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yEAAyE;AACzE,6BAAqC;AAA7B,2GAAA,OAAO,OAAO;AACtB,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AAEtB,qDAK2B;AAJzB,+GAAA,YAAY,OAAA;AACZ,yHAAA,sBAAsB,OAAA;AACtB,uHAAA,oBAAoB,OAAA;AACpB,sHAAA,mBAAmB,OAAA;AAErB,yDAS6B;AAR3B,mHAAA,cAAc,OAAA;AACd,wHAAA,mBAAmB,OAAA;AACnB,wHAAA,mBAAmB,OAAA;AACnB,sHAAA,iBAAiB,OAAA;AACjB,8GAAA,SAAS,OAAA;AACT,mHAAA,cAAc,OAAA;AACd,0HAAA,qBAAqB,OAAA;AACrB,gIAAA,2BAA2B,OAAA"}
|
|
@@ -11,3 +11,9 @@ export declare const RehypePluginsSchema: Joi.ArraySchema;
|
|
|
11
11
|
export declare const AdmonitionsSchema: Joi.ObjectSchema<any>;
|
|
12
12
|
export declare const URISchema: Joi.AlternativesSchema;
|
|
13
13
|
export declare const PathnameSchema: Joi.StringSchema;
|
|
14
|
+
export declare const FrontMatterTagsSchema: Joi.ArraySchema;
|
|
15
|
+
export declare const FrontMatterTOCHeadingLevels: {
|
|
16
|
+
toc_min_heading_level: Joi.NumberSchema;
|
|
17
|
+
toc_max_heading_level: Joi.NumberSchema;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=validationSchemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validationSchemas.d.ts","sourceRoot":"","sources":["../src/validationSchemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,GAAG,MAAM,OAAO,CAAC;AAIxB,eAAO,MAAM,cAAc,kBAKE,CAAC;AAe9B,eAAO,MAAM,mBAAmB,iBAAwB,CAAC;AACzD,eAAO,MAAM,mBAAmB,iBAAwB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,uBAA2B,CAAC;AAI1D,eAAO,MAAM,SAAS,wBAgBpB,CAAC;AAEH,eAAO,MAAM,cAAc,kBASxB,CAAC;AAeJ,eAAO,MAAM,qBAAqB,iBAK9B,CAAC;AAEL,eAAO,MAAM,2BAA2B;;;CASvC,CAAC"}
|
package/lib/validationSchemas.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PathnameSchema = exports.URISchema = exports.AdmonitionsSchema = exports.RehypePluginsSchema = exports.RemarkPluginsSchema = exports.PluginIdSchema = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
2
|
/**
|
|
6
3
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
4
|
*
|
|
8
5
|
* This source code is licensed under the MIT license found in the
|
|
9
6
|
* LICENSE file in the root directory of this source tree.
|
|
10
7
|
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FrontMatterTOCHeadingLevels = exports.FrontMatterTagsSchema = exports.PathnameSchema = exports.URISchema = exports.AdmonitionsSchema = exports.RehypePluginsSchema = exports.RemarkPluginsSchema = exports.PluginIdSchema = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
11
|
const Joi_1 = tslib_1.__importDefault(require("./Joi"));
|
|
12
12
|
const utils_1 = require("@docusaurus/utils");
|
|
13
|
+
const JoiFrontMatter_1 = require("./JoiFrontMatter");
|
|
13
14
|
exports.PluginIdSchema = Joi_1.default.string()
|
|
14
|
-
.regex(/^[
|
|
15
|
-
|
|
16
|
-
.default(
|
|
15
|
+
.regex(/^[\w-]+$/)
|
|
16
|
+
.message('Illegal plugin ID value "{#value}": it should only contain alphanumerics, underscores, and dashes.')
|
|
17
|
+
.default(utils_1.DEFAULT_PLUGIN_ID);
|
|
17
18
|
const MarkdownPluginsSchema = Joi_1.default.array()
|
|
18
|
-
.items(Joi_1.default.array().ordered(Joi_1.default.function().required(), Joi_1.default.
|
|
19
|
+
.items(Joi_1.default.array().ordered(Joi_1.default.function().required(), Joi_1.default.any().required()), Joi_1.default.function(), Joi_1.default.object())
|
|
20
|
+
.messages({
|
|
21
|
+
'array.includes': `{#label} does not look like a valid MDX plugin config. A plugin config entry should be one of:
|
|
22
|
+
- A tuple, like \`[require("rehype-katex"), \\{ strict: false \\}]\`, or
|
|
23
|
+
- A simple module, like \`require("remark-math")\``,
|
|
24
|
+
})
|
|
19
25
|
.default([]);
|
|
20
26
|
exports.RemarkPluginsSchema = MarkdownPluginsSchema;
|
|
21
27
|
exports.RehypePluginsSchema = MarkdownPluginsSchema;
|
|
@@ -23,28 +29,50 @@ exports.AdmonitionsSchema = Joi_1.default.object().default({});
|
|
|
23
29
|
// TODO how can we make this emit a custom error message :'(
|
|
24
30
|
// Joi is such a pain, good luck to annoying trying to improve this
|
|
25
31
|
exports.URISchema = Joi_1.default.alternatives(Joi_1.default.string().uri({ allowRelative: true }),
|
|
26
|
-
// This custom validation logic is required notably because Joi does not
|
|
32
|
+
// This custom validation logic is required notably because Joi does not
|
|
33
|
+
// accept paths like /a/b/c ...
|
|
27
34
|
Joi_1.default.custom((val, helpers) => {
|
|
28
35
|
try {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return helpers.error('any.invalid');
|
|
35
|
-
}
|
|
36
|
+
// eslint-disable-next-line no-new
|
|
37
|
+
new URL(val);
|
|
38
|
+
return val;
|
|
36
39
|
}
|
|
37
40
|
catch {
|
|
38
41
|
return helpers.error('any.invalid');
|
|
39
42
|
}
|
|
40
|
-
}))
|
|
43
|
+
})).messages({
|
|
44
|
+
'alternatives.match': "{{#label}} does not look like a valid url (value='{{.value}}')",
|
|
45
|
+
});
|
|
41
46
|
exports.PathnameSchema = Joi_1.default.string()
|
|
42
47
|
.custom((val) => {
|
|
43
|
-
if (!utils_1.isValidPathname(val)) {
|
|
48
|
+
if (!(0, utils_1.isValidPathname)(val)) {
|
|
44
49
|
throw new Error();
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
return val;
|
|
48
|
-
}
|
|
51
|
+
return val;
|
|
49
52
|
})
|
|
50
53
|
.message('{{#label}} is not a valid pathname. Pathname should start with slash and not contain any domain or query string.');
|
|
54
|
+
const FrontMatterTagSchema = JoiFrontMatter_1.JoiFrontMatter.alternatives()
|
|
55
|
+
.try(JoiFrontMatter_1.JoiFrontMatter.string().required(), JoiFrontMatter_1.JoiFrontMatter.object({
|
|
56
|
+
label: JoiFrontMatter_1.JoiFrontMatter.string().required(),
|
|
57
|
+
permalink: JoiFrontMatter_1.JoiFrontMatter.string().required(),
|
|
58
|
+
}).required())
|
|
59
|
+
.messages({
|
|
60
|
+
'alternatives.match': '{{#label}} does not look like a valid tag',
|
|
61
|
+
'alternatives.types': '{{#label}} does not look like a valid tag',
|
|
62
|
+
});
|
|
63
|
+
exports.FrontMatterTagsSchema = JoiFrontMatter_1.JoiFrontMatter.array()
|
|
64
|
+
.items(FrontMatterTagSchema)
|
|
65
|
+
.messages({
|
|
66
|
+
'array.base': '{{#label}} does not look like a valid front matter Yaml array.',
|
|
67
|
+
});
|
|
68
|
+
exports.FrontMatterTOCHeadingLevels = {
|
|
69
|
+
toc_min_heading_level: JoiFrontMatter_1.JoiFrontMatter.number().when('toc_max_heading_level', {
|
|
70
|
+
is: JoiFrontMatter_1.JoiFrontMatter.exist(),
|
|
71
|
+
then: JoiFrontMatter_1.JoiFrontMatter.number()
|
|
72
|
+
.min(2)
|
|
73
|
+
.max(JoiFrontMatter_1.JoiFrontMatter.ref('toc_max_heading_level')),
|
|
74
|
+
otherwise: JoiFrontMatter_1.JoiFrontMatter.number().min(2).max(6),
|
|
75
|
+
}),
|
|
76
|
+
toc_max_heading_level: JoiFrontMatter_1.JoiFrontMatter.number().min(2).max(6),
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=validationSchemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validationSchemas.js","sourceRoot":"","sources":["../src/validationSchemas.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,wDAAwB;AACxB,6CAA+E;AAC/E,qDAAgD;AAEnC,QAAA,cAAc,GAAG,aAAG,CAAC,MAAM,EAAE;KACvC,KAAK,CAAC,UAAU,CAAC;KACjB,OAAO,CACN,oGAAoG,CACrG;KACA,OAAO,CAAC,yBAAiB,CAAC,CAAC;AAE9B,MAAM,qBAAqB,GAAG,aAAG,CAAC,KAAK,EAAE;KACtC,KAAK,CACJ,aAAG,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,aAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,aAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,EACpE,aAAG,CAAC,QAAQ,EAAE,EACd,aAAG,CAAC,MAAM,EAAE,CACb;KACA,QAAQ,CAAC;IACR,gBAAgB,EAAE;;mDAE6B;CAChD,CAAC;KACD,OAAO,CAAC,EAAE,CAAC,CAAC;AAEF,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAE5C,QAAA,iBAAiB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAE1D,4DAA4D;AAC5D,oEAAoE;AACvD,QAAA,SAAS,GAAG,aAAG,CAAC,YAAY,CACvC,aAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC;AACvC,wEAAwE;AACxE,+BAA+B;AAC/B,aAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;IAC1B,IAAI;QACF,kCAAkC;QAClC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,GAAG,CAAC;KACZ;IAAC,MAAM;QACN,OAAO,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;KACrC;AACH,CAAC,CAAC,CACH,CAAC,QAAQ,CAAC;IACT,oBAAoB,EAClB,gEAAgE;CACnE,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,aAAG,CAAC,MAAM,EAAE;KACvC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;IACd,IAAI,CAAC,IAAA,uBAAe,EAAC,GAAG,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,EAAE,CAAC;KACnB;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;KACD,OAAO,CACN,kHAAkH,CACnH,CAAC;AAEJ,MAAM,oBAAoB,GAAG,+BAAc,CAAC,YAAY,EAAE;KACvD,GAAG,CACF,+BAAc,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAClC,+BAAc,CAAC,MAAM,CAAM;IACzB,KAAK,EAAE,+BAAc,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,SAAS,EAAE,+BAAc,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC,QAAQ,EAAE,CACd;KACA,QAAQ,CAAC;IACR,oBAAoB,EAAE,2CAA2C;IACjE,oBAAoB,EAAE,2CAA2C;CAClE,CAAC,CAAC;AAEQ,QAAA,qBAAqB,GAAG,+BAAc,CAAC,KAAK,EAAE;KACxD,KAAK,CAAC,oBAAoB,CAAC;KAC3B,QAAQ,CAAC;IACR,YAAY,EACV,gEAAgE;CACnE,CAAC,CAAC;AAEQ,QAAA,2BAA2B,GAAG;IACzC,qBAAqB,EAAE,+BAAc,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE;QAC3E,EAAE,EAAE,+BAAc,CAAC,KAAK,EAAE;QAC1B,IAAI,EAAE,+BAAc,CAAC,MAAM,EAAE;aAC1B,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,+BAAc,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACnD,SAAS,EAAE,+BAAc,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACjD,CAAC;IACF,qBAAqB,EAAE,+BAAc,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7D,CAAC"}
|
package/lib/validationUtils.d.ts
CHANGED
|
@@ -4,13 +4,26 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import Joi from './Joi';
|
|
8
|
-
|
|
9
|
-
export declare const logValidationBugReportHint: () => void;
|
|
7
|
+
import type Joi from './Joi';
|
|
8
|
+
/** Print warnings returned from Joi validation. */
|
|
10
9
|
export declare function printWarning(warning?: Joi.ValidationError): void;
|
|
10
|
+
/**
|
|
11
|
+
* The callback that should be used to validate plugin options. Handles plugin
|
|
12
|
+
* IDs on a generic level: no matter what the schema declares, this callback
|
|
13
|
+
* would require a string ID or default to "default".
|
|
14
|
+
*/
|
|
11
15
|
export declare function normalizePluginOptions<T extends {
|
|
12
16
|
id?: string;
|
|
13
|
-
}>(schema: Joi.ObjectSchema<T>, options
|
|
17
|
+
}>(schema: Joi.ObjectSchema<T>, options?: Partial<T>): T;
|
|
18
|
+
/**
|
|
19
|
+
* The callback that should be used to validate theme config. No matter what the
|
|
20
|
+
* schema declares, this callback would allow unknown attributes.
|
|
21
|
+
*/
|
|
14
22
|
export declare function normalizeThemeConfig<T>(schema: Joi.ObjectSchema<T>, themeConfig: Partial<T>): T;
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Validate front matter with better error message
|
|
25
|
+
*/
|
|
26
|
+
export declare function validateFrontMatter<T>(frontMatter: {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}, schema: Joi.ObjectSchema<T>): T;
|
|
29
|
+
//# sourceMappingURL=validationUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validationUtils.d.ts","sourceRoot":"","sources":["../src/validationUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAK7B,mDAAmD;AACnD,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,eAAe,GAAG,IAAI,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,EAC5D,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAE3B,OAAO,GAAE,OAAO,CAAC,CAAC,CAAM,GACvB,CAAC,CAiBH;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAC3B,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,GACtB,CAAC,CAgBH;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,WAAW,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,EACrC,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,GAC1B,CAAC,CAuBH"}
|
package/lib/validationUtils.js
CHANGED
|
@@ -1,42 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFrontMatter = exports.JoiFrontMatter = exports.normalizeThemeConfig = exports.normalizePluginOptions = exports.printWarning = exports.logValidationBugReportHint = exports.isValidationDisabledEscapeHatch = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
2
|
/**
|
|
6
3
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
4
|
*
|
|
8
5
|
* This source code is licensed under the MIT license found in the
|
|
9
6
|
* LICENSE file in the root directory of this source tree.
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.validateFrontMatter = exports.normalizeThemeConfig = exports.normalizePluginOptions = exports.printWarning = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
|
|
12
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
13
13
|
const validationSchemas_1 = require("./validationSchemas");
|
|
14
|
-
|
|
15
|
-
// Our validation schemas might be buggy at first
|
|
16
|
-
// will permit users to bypass validation until we fix all validation errors
|
|
17
|
-
// see for example: https://github.com/facebook/docusaurus/pull/3120
|
|
18
|
-
// Undocumented on purpose, as we don't want users to keep using it over time
|
|
19
|
-
// Maybe we'll make this escape hatch official some day, with a better api?
|
|
20
|
-
exports.isValidationDisabledEscapeHatch = process.env.DISABLE_DOCUSAURUS_VALIDATION === 'true';
|
|
21
|
-
if (exports.isValidationDisabledEscapeHatch) {
|
|
22
|
-
console.error(chalk_1.default.red('You should avoid using DISABLE_DOCUSAURUS_VALIDATION escape hatch, this will be removed.'));
|
|
23
|
-
}
|
|
24
|
-
const logValidationBugReportHint = () => {
|
|
25
|
-
console.log(`\n${chalk_1.default.red('A validation error occurred.')}${chalk_1.default.cyanBright('\nThe validation system was added recently to Docusaurus as an attempt to avoid user configuration errors.' +
|
|
26
|
-
'\nWe may have made some mistakes.' +
|
|
27
|
-
'\nIf you think your configuration is valid and should keep working, please open a bug report.')}\n`);
|
|
28
|
-
};
|
|
29
|
-
exports.logValidationBugReportHint = logValidationBugReportHint;
|
|
14
|
+
/** Print warnings returned from Joi validation. */
|
|
30
15
|
function printWarning(warning) {
|
|
31
16
|
if (warning) {
|
|
32
17
|
const warningMessages = warning.details
|
|
33
18
|
.map(({ message }) => message)
|
|
34
19
|
.join('\n');
|
|
35
|
-
|
|
20
|
+
logger_1.default.warn(warningMessages);
|
|
36
21
|
}
|
|
37
22
|
}
|
|
38
23
|
exports.printWarning = printWarning;
|
|
39
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The callback that should be used to validate plugin options. Handles plugin
|
|
26
|
+
* IDs on a generic level: no matter what the schema declares, this callback
|
|
27
|
+
* would require a string ID or default to "default".
|
|
28
|
+
*/
|
|
29
|
+
function normalizePluginOptions(schema,
|
|
30
|
+
// This allows us to automatically normalize undefined to { id: "default" }
|
|
31
|
+
options = {}) {
|
|
40
32
|
// All plugins can be provided an "id" option (multi-instance support)
|
|
41
33
|
// we add schema validation automatically
|
|
42
34
|
const finalSchema = schema.append({
|
|
@@ -47,20 +39,17 @@ function normalizePluginOptions(schema, options) {
|
|
|
47
39
|
});
|
|
48
40
|
printWarning(warning);
|
|
49
41
|
if (error) {
|
|
50
|
-
|
|
51
|
-
if (exports.isValidationDisabledEscapeHatch) {
|
|
52
|
-
console.error(error);
|
|
53
|
-
return options;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
42
|
+
throw error;
|
|
58
43
|
}
|
|
59
44
|
return value;
|
|
60
45
|
}
|
|
61
46
|
exports.normalizePluginOptions = normalizePluginOptions;
|
|
47
|
+
/**
|
|
48
|
+
* The callback that should be used to validate theme config. No matter what the
|
|
49
|
+
* schema declares, this callback would allow unknown attributes.
|
|
50
|
+
*/
|
|
62
51
|
function normalizeThemeConfig(schema, themeConfig) {
|
|
63
|
-
// A theme should only validate
|
|
52
|
+
// A theme should only validate its "slice" of the full themeConfig,
|
|
64
53
|
// not the whole object, so we allow unknown attributes
|
|
65
54
|
// otherwise one theme would fail validating the data of another theme
|
|
66
55
|
const finalSchema = schema.unknown();
|
|
@@ -69,35 +58,14 @@ function normalizeThemeConfig(schema, themeConfig) {
|
|
|
69
58
|
});
|
|
70
59
|
printWarning(warning);
|
|
71
60
|
if (error) {
|
|
72
|
-
|
|
73
|
-
if (exports.isValidationDisabledEscapeHatch) {
|
|
74
|
-
console.error(error);
|
|
75
|
-
return themeConfig;
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
throw error;
|
|
79
|
-
}
|
|
61
|
+
throw error;
|
|
80
62
|
}
|
|
81
63
|
return value;
|
|
82
64
|
}
|
|
83
65
|
exports.normalizeThemeConfig = normalizeThemeConfig;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// see https://github.com/facebook/docusaurus/issues/4642
|
|
88
|
-
// see https://github.com/sideway/joi/issues/1442#issuecomment-823997884
|
|
89
|
-
const JoiFrontMatterString = {
|
|
90
|
-
type: 'string',
|
|
91
|
-
base: Joi_1.default.string(),
|
|
92
|
-
// Fix Yaml that tries to auto-convert many things to string out of the box
|
|
93
|
-
prepare: (value) => {
|
|
94
|
-
if (typeof value === 'number' || value instanceof Date) {
|
|
95
|
-
return { value: value.toString() };
|
|
96
|
-
}
|
|
97
|
-
return { value };
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
exports.JoiFrontMatter = Joi_1.default.extend(JoiFrontMatterString);
|
|
66
|
+
/**
|
|
67
|
+
* Validate front matter with better error message
|
|
68
|
+
*/
|
|
101
69
|
function validateFrontMatter(frontMatter, schema) {
|
|
102
70
|
const { value, error, warning } = schema.validate(frontMatter, {
|
|
103
71
|
convert: true,
|
|
@@ -106,16 +74,17 @@ function validateFrontMatter(frontMatter, schema) {
|
|
|
106
74
|
});
|
|
107
75
|
printWarning(warning);
|
|
108
76
|
if (error) {
|
|
109
|
-
const frontMatterString = JSON.stringify(frontMatter, null, 2);
|
|
110
77
|
const errorDetails = error.details;
|
|
111
78
|
const invalidFields = errorDetails.map(({ path }) => path).join(', ');
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
79
|
+
logger_1.default.error `The following front matter:
|
|
80
|
+
---
|
|
81
|
+
${js_yaml_1.default.dump(frontMatter)}---
|
|
82
|
+
contains invalid values for field(s): code=${invalidFields}.
|
|
83
|
+
${errorDetails.map(({ message }) => message)}
|
|
84
|
+
`;
|
|
117
85
|
throw error;
|
|
118
86
|
}
|
|
119
87
|
return value;
|
|
120
88
|
}
|
|
121
89
|
exports.validateFrontMatter = validateFrontMatter;
|
|
90
|
+
//# sourceMappingURL=validationUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validationUtils.js","sourceRoot":"","sources":["../src/validationUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAGH,wEAAwC;AACxC,8DAA2B;AAC3B,2DAAmD;AAEnD,mDAAmD;AACnD,SAAgB,YAAY,CAAC,OAA6B;IACxD,IAAI,OAAO,EAAE;QACX,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO;aACpC,GAAG,CAAC,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,OAAO,CAAC;aAC3B,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,gBAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KAC9B;AACH,CAAC;AAPD,oCAOC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,MAA2B;AAC3B,2EAA2E;AAC3E,UAAsB,EAAE;IAExB,sEAAsE;IACtE,yCAAyC;IACzC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;QAChC,EAAE,EAAE,kCAAc;KACnB,CAAC,CAAC;IACH,MAAM,EAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE;QAC5D,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IAEH,YAAY,CAAC,OAAO,CAAC,CAAC;IAEtB,IAAI,KAAK,EAAE;QACT,MAAM,KAAK,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AArBD,wDAqBC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAClC,MAA2B,EAC3B,WAAuB;IAEvB,oEAAoE;IACpE,uDAAuD;IACvD,sEAAsE;IACtE,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAErC,MAAM,EAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE;QAChE,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IAEH,YAAY,CAAC,OAAO,CAAC,CAAC;IAEtB,IAAI,KAAK,EAAE;QACT,MAAM,KAAK,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAnBD,oDAmBC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,WAAqC,EACrC,MAA2B;IAE3B,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE;QAC3D,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IAEH,YAAY,CAAC,OAAO,CAAC,CAAC;IAEtB,IAAI,KAAK,EAAE;QACT,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;QACnC,MAAM,aAAa,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpE,gBAAM,CAAC,KAAK,CAAA;;EAEd,iBAAI,CAAC,IAAI,CAAC,WAAW,CAAC;6CACqB,aAAa;EACxD,YAAY,CAAC,GAAG,CAAC,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,OAAO,CAAC;CACzC,CAAC;QACE,MAAM,KAAK,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AA1BD,kDA0BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/utils-validation",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.20",
|
|
4
4
|
"description": "Node validation utility functions for Docusaurus packages.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/
|
|
22
|
-
"
|
|
23
|
-
"joi": "^17.
|
|
24
|
-
"
|
|
21
|
+
"@docusaurus/logger": "2.0.0-beta.20",
|
|
22
|
+
"@docusaurus/utils": "2.0.0-beta.20",
|
|
23
|
+
"joi": "^17.6.0",
|
|
24
|
+
"js-yaml": "^4.1.0",
|
|
25
|
+
"tslib": "^2.4.0"
|
|
25
26
|
},
|
|
26
27
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
28
|
+
"node": ">=14"
|
|
28
29
|
},
|
|
29
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "ed5cdba401a5948e187e927039b142a0decc702d"
|
|
30
31
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Joi from './Joi';
|
|
9
|
+
|
|
10
|
+
const JoiFrontMatterString: Joi.Extension = {
|
|
11
|
+
type: 'string',
|
|
12
|
+
base: Joi.string(),
|
|
13
|
+
// Fix Yaml that tries to auto-convert many things to string out of the box
|
|
14
|
+
prepare: (value) => {
|
|
15
|
+
if (typeof value === 'number' || value instanceof Date) {
|
|
16
|
+
return {value: value.toString()};
|
|
17
|
+
}
|
|
18
|
+
return {value};
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Enhance the default `Joi.string()` type so that it can convert number to
|
|
24
|
+
* strings. If user use front matter "tag: 2021", we shouldn't need to ask her
|
|
25
|
+
* to write "tag: '2021'". Also yaml tries to convert patterns like "2019-01-01"
|
|
26
|
+
* to dates automatically.
|
|
27
|
+
*
|
|
28
|
+
* @see https://github.com/facebook/docusaurus/issues/4642
|
|
29
|
+
* @see https://github.com/sideway/joi/issues/1442#issuecomment-823997884
|
|
30
|
+
*/
|
|
31
|
+
export const JoiFrontMatter: typeof Joi = Joi.extend(JoiFrontMatterString);
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,21 @@
|
|
|
7
7
|
|
|
8
8
|
// /!\ don't remove this export, as we recommend plugin authors to use it
|
|
9
9
|
export {default as Joi} from './Joi';
|
|
10
|
+
export {JoiFrontMatter} from './JoiFrontMatter';
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
-
|
|
12
|
+
export {
|
|
13
|
+
printWarning,
|
|
14
|
+
normalizePluginOptions,
|
|
15
|
+
normalizeThemeConfig,
|
|
16
|
+
validateFrontMatter,
|
|
17
|
+
} from './validationUtils';
|
|
18
|
+
export {
|
|
19
|
+
PluginIdSchema,
|
|
20
|
+
RemarkPluginsSchema,
|
|
21
|
+
RehypePluginsSchema,
|
|
22
|
+
AdmonitionsSchema,
|
|
23
|
+
URISchema,
|
|
24
|
+
PathnameSchema,
|
|
25
|
+
FrontMatterTagsSchema,
|
|
26
|
+
FrontMatterTOCHeadingLevels,
|
|
27
|
+
} from './validationSchemas';
|
package/src/validationSchemas.ts
CHANGED
|
@@ -4,20 +4,29 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
|
|
7
8
|
import Joi from './Joi';
|
|
8
|
-
import {isValidPathname} from '@docusaurus/utils';
|
|
9
|
+
import {isValidPathname, DEFAULT_PLUGIN_ID, type Tag} from '@docusaurus/utils';
|
|
10
|
+
import {JoiFrontMatter} from './JoiFrontMatter';
|
|
9
11
|
|
|
10
12
|
export const PluginIdSchema = Joi.string()
|
|
11
|
-
.regex(/^[
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
.regex(/^[\w-]+$/)
|
|
14
|
+
.message(
|
|
15
|
+
'Illegal plugin ID value "{#value}": it should only contain alphanumerics, underscores, and dashes.',
|
|
16
|
+
)
|
|
17
|
+
.default(DEFAULT_PLUGIN_ID);
|
|
14
18
|
|
|
15
19
|
const MarkdownPluginsSchema = Joi.array()
|
|
16
20
|
.items(
|
|
17
|
-
Joi.array().ordered(Joi.function().required(), Joi.
|
|
21
|
+
Joi.array().ordered(Joi.function().required(), Joi.any().required()),
|
|
18
22
|
Joi.function(),
|
|
19
23
|
Joi.object(),
|
|
20
24
|
)
|
|
25
|
+
.messages({
|
|
26
|
+
'array.includes': `{#label} does not look like a valid MDX plugin config. A plugin config entry should be one of:
|
|
27
|
+
- A tuple, like \`[require("rehype-katex"), \\{ strict: false \\}]\`, or
|
|
28
|
+
- A simple module, like \`require("remark-math")\``,
|
|
29
|
+
})
|
|
21
30
|
.default([]);
|
|
22
31
|
|
|
23
32
|
export const RemarkPluginsSchema = MarkdownPluginsSchema;
|
|
@@ -29,29 +38,60 @@ export const AdmonitionsSchema = Joi.object().default({});
|
|
|
29
38
|
// Joi is such a pain, good luck to annoying trying to improve this
|
|
30
39
|
export const URISchema = Joi.alternatives(
|
|
31
40
|
Joi.string().uri({allowRelative: true}),
|
|
32
|
-
// This custom validation logic is required notably because Joi does not
|
|
41
|
+
// This custom validation logic is required notably because Joi does not
|
|
42
|
+
// accept paths like /a/b/c ...
|
|
33
43
|
Joi.custom((val, helpers) => {
|
|
34
44
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} else {
|
|
39
|
-
return helpers.error('any.invalid');
|
|
40
|
-
}
|
|
45
|
+
// eslint-disable-next-line no-new
|
|
46
|
+
new URL(val);
|
|
47
|
+
return val;
|
|
41
48
|
} catch {
|
|
42
49
|
return helpers.error('any.invalid');
|
|
43
50
|
}
|
|
44
51
|
}),
|
|
45
|
-
)
|
|
52
|
+
).messages({
|
|
53
|
+
'alternatives.match':
|
|
54
|
+
"{{#label}} does not look like a valid url (value='{{.value}}')",
|
|
55
|
+
});
|
|
46
56
|
|
|
47
57
|
export const PathnameSchema = Joi.string()
|
|
48
58
|
.custom((val) => {
|
|
49
59
|
if (!isValidPathname(val)) {
|
|
50
60
|
throw new Error();
|
|
51
|
-
} else {
|
|
52
|
-
return val;
|
|
53
61
|
}
|
|
62
|
+
return val;
|
|
54
63
|
})
|
|
55
64
|
.message(
|
|
56
65
|
'{{#label}} is not a valid pathname. Pathname should start with slash and not contain any domain or query string.',
|
|
57
66
|
);
|
|
67
|
+
|
|
68
|
+
const FrontMatterTagSchema = JoiFrontMatter.alternatives()
|
|
69
|
+
.try(
|
|
70
|
+
JoiFrontMatter.string().required(),
|
|
71
|
+
JoiFrontMatter.object<Tag>({
|
|
72
|
+
label: JoiFrontMatter.string().required(),
|
|
73
|
+
permalink: JoiFrontMatter.string().required(),
|
|
74
|
+
}).required(),
|
|
75
|
+
)
|
|
76
|
+
.messages({
|
|
77
|
+
'alternatives.match': '{{#label}} does not look like a valid tag',
|
|
78
|
+
'alternatives.types': '{{#label}} does not look like a valid tag',
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export const FrontMatterTagsSchema = JoiFrontMatter.array()
|
|
82
|
+
.items(FrontMatterTagSchema)
|
|
83
|
+
.messages({
|
|
84
|
+
'array.base':
|
|
85
|
+
'{{#label}} does not look like a valid front matter Yaml array.',
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export const FrontMatterTOCHeadingLevels = {
|
|
89
|
+
toc_min_heading_level: JoiFrontMatter.number().when('toc_max_heading_level', {
|
|
90
|
+
is: JoiFrontMatter.exist(),
|
|
91
|
+
then: JoiFrontMatter.number()
|
|
92
|
+
.min(2)
|
|
93
|
+
.max(JoiFrontMatter.ref('toc_max_heading_level')),
|
|
94
|
+
otherwise: JoiFrontMatter.number().min(2).max(6),
|
|
95
|
+
}),
|
|
96
|
+
toc_max_heading_level: JoiFrontMatter.number().min(2).max(6),
|
|
97
|
+
};
|
package/src/validationUtils.ts
CHANGED
|
@@ -4,49 +4,31 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import Joi from './Joi';
|
|
8
|
-
import chalk from 'chalk';
|
|
9
|
-
import {PluginIdSchema} from './validationSchemas';
|
|
10
|
-
|
|
11
|
-
// TODO temporary escape hatch for alpha-60: to be removed soon
|
|
12
|
-
// Our validation schemas might be buggy at first
|
|
13
|
-
// will permit users to bypass validation until we fix all validation errors
|
|
14
|
-
// see for example: https://github.com/facebook/docusaurus/pull/3120
|
|
15
|
-
// Undocumented on purpose, as we don't want users to keep using it over time
|
|
16
|
-
// Maybe we'll make this escape hatch official some day, with a better api?
|
|
17
|
-
export const isValidationDisabledEscapeHatch =
|
|
18
|
-
process.env.DISABLE_DOCUSAURUS_VALIDATION === 'true';
|
|
19
|
-
|
|
20
|
-
if (isValidationDisabledEscapeHatch) {
|
|
21
|
-
console.error(
|
|
22
|
-
chalk.red(
|
|
23
|
-
'You should avoid using DISABLE_DOCUSAURUS_VALIDATION escape hatch, this will be removed.',
|
|
24
|
-
),
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
7
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'\nWe may have made some mistakes.' +
|
|
33
|
-
'\nIf you think your configuration is valid and should keep working, please open a bug report.',
|
|
34
|
-
)}\n`,
|
|
35
|
-
);
|
|
36
|
-
};
|
|
8
|
+
import type Joi from './Joi';
|
|
9
|
+
import logger from '@docusaurus/logger';
|
|
10
|
+
import Yaml from 'js-yaml';
|
|
11
|
+
import {PluginIdSchema} from './validationSchemas';
|
|
37
12
|
|
|
13
|
+
/** Print warnings returned from Joi validation. */
|
|
38
14
|
export function printWarning(warning?: Joi.ValidationError): void {
|
|
39
15
|
if (warning) {
|
|
40
16
|
const warningMessages = warning.details
|
|
41
17
|
.map(({message}) => message)
|
|
42
18
|
.join('\n');
|
|
43
|
-
|
|
19
|
+
logger.warn(warningMessages);
|
|
44
20
|
}
|
|
45
21
|
}
|
|
46
22
|
|
|
23
|
+
/**
|
|
24
|
+
* The callback that should be used to validate plugin options. Handles plugin
|
|
25
|
+
* IDs on a generic level: no matter what the schema declares, this callback
|
|
26
|
+
* would require a string ID or default to "default".
|
|
27
|
+
*/
|
|
47
28
|
export function normalizePluginOptions<T extends {id?: string}>(
|
|
48
29
|
schema: Joi.ObjectSchema<T>,
|
|
49
|
-
|
|
30
|
+
// This allows us to automatically normalize undefined to { id: "default" }
|
|
31
|
+
options: Partial<T> = {},
|
|
50
32
|
): T {
|
|
51
33
|
// All plugins can be provided an "id" option (multi-instance support)
|
|
52
34
|
// we add schema validation automatically
|
|
@@ -60,23 +42,21 @@ export function normalizePluginOptions<T extends {id?: string}>(
|
|
|
60
42
|
printWarning(warning);
|
|
61
43
|
|
|
62
44
|
if (error) {
|
|
63
|
-
|
|
64
|
-
if (isValidationDisabledEscapeHatch) {
|
|
65
|
-
console.error(error);
|
|
66
|
-
return options as T;
|
|
67
|
-
} else {
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
45
|
+
throw error;
|
|
70
46
|
}
|
|
71
47
|
|
|
72
48
|
return value;
|
|
73
49
|
}
|
|
74
50
|
|
|
51
|
+
/**
|
|
52
|
+
* The callback that should be used to validate theme config. No matter what the
|
|
53
|
+
* schema declares, this callback would allow unknown attributes.
|
|
54
|
+
*/
|
|
75
55
|
export function normalizeThemeConfig<T>(
|
|
76
56
|
schema: Joi.ObjectSchema<T>,
|
|
77
57
|
themeConfig: Partial<T>,
|
|
78
58
|
): T {
|
|
79
|
-
// A theme should only validate
|
|
59
|
+
// A theme should only validate its "slice" of the full themeConfig,
|
|
80
60
|
// not the whole object, so we allow unknown attributes
|
|
81
61
|
// otherwise one theme would fail validating the data of another theme
|
|
82
62
|
const finalSchema = schema.unknown();
|
|
@@ -88,37 +68,16 @@ export function normalizeThemeConfig<T>(
|
|
|
88
68
|
printWarning(warning);
|
|
89
69
|
|
|
90
70
|
if (error) {
|
|
91
|
-
|
|
92
|
-
if (isValidationDisabledEscapeHatch) {
|
|
93
|
-
console.error(error);
|
|
94
|
-
return themeConfig as T;
|
|
95
|
-
} else {
|
|
96
|
-
throw error;
|
|
97
|
-
}
|
|
71
|
+
throw error;
|
|
98
72
|
}
|
|
99
73
|
return value;
|
|
100
74
|
}
|
|
101
75
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// see https://github.com/facebook/docusaurus/issues/4642
|
|
106
|
-
// see https://github.com/sideway/joi/issues/1442#issuecomment-823997884
|
|
107
|
-
const JoiFrontMatterString: Joi.Extension = {
|
|
108
|
-
type: 'string',
|
|
109
|
-
base: Joi.string(),
|
|
110
|
-
// Fix Yaml that tries to auto-convert many things to string out of the box
|
|
111
|
-
prepare: (value) => {
|
|
112
|
-
if (typeof value === 'number' || value instanceof Date) {
|
|
113
|
-
return {value: value.toString()};
|
|
114
|
-
}
|
|
115
|
-
return {value};
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
export const JoiFrontMatter: typeof Joi = Joi.extend(JoiFrontMatterString);
|
|
119
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Validate front matter with better error message
|
|
78
|
+
*/
|
|
120
79
|
export function validateFrontMatter<T>(
|
|
121
|
-
frontMatter:
|
|
80
|
+
frontMatter: {[key: string]: unknown},
|
|
122
81
|
schema: Joi.ObjectSchema<T>,
|
|
123
82
|
): T {
|
|
124
83
|
const {value, error, warning} = schema.validate(frontMatter, {
|
|
@@ -130,22 +89,15 @@ export function validateFrontMatter<T>(
|
|
|
130
89
|
printWarning(warning);
|
|
131
90
|
|
|
132
91
|
if (error) {
|
|
133
|
-
const frontMatterString = JSON.stringify(frontMatter, null, 2);
|
|
134
92
|
const errorDetails = error.details;
|
|
135
93
|
const invalidFields = errorDetails.map(({path}) => path).join(', ');
|
|
136
|
-
const errorMessages = errorDetails
|
|
137
|
-
.map(({message}) => ` - ${message}`)
|
|
138
|
-
.join('\n');
|
|
139
|
-
|
|
140
|
-
logValidationBugReportHint();
|
|
141
94
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
);
|
|
95
|
+
logger.error`The following front matter:
|
|
96
|
+
---
|
|
97
|
+
${Yaml.dump(frontMatter)}---
|
|
98
|
+
contains invalid values for field(s): code=${invalidFields}.
|
|
99
|
+
${errorDetails.map(({message}) => message)}
|
|
100
|
+
`;
|
|
149
101
|
throw error;
|
|
150
102
|
}
|
|
151
103
|
|
package/lib/.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../../../node_modules/joi/lib/index.d.ts","../src/joi.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/webpack/node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/ajv/lib/ajv.d.ts","../../../node_modules/schema-utils/declarations/validationerror.d.ts","../../../node_modules/schema-utils/declarations/validate.d.ts","../../../node_modules/schema-utils/declarations/index.d.ts","../../../node_modules/tapable/tapable.d.ts","../../../node_modules/webpack/types.d.ts","../../docusaurus-types/node_modules/commander/typings/index.d.ts","../../docusaurus-types/src/index.d.ts","../../docusaurus-utils/lib/posixpath.d.ts","../../docusaurus-utils/lib/getfilepathforroutepath.d.ts","../../docusaurus-utils/lib/codetranslationsutils.d.ts","../../docusaurus-utils/lib/markdownparser.d.ts","../../docusaurus-utils/lib/markdownlinks.d.ts","../../docusaurus-utils/lib/escapepath.d.ts","../../docusaurus-utils/lib/hashutils.d.ts","../../docusaurus-utils/lib/index.d.ts","../src/validationschemas.ts","../src/validationutils.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/ts3.6/base.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/base.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/source-map/source-map.d.ts","../../../node_modules/@types/clean-css/index.d.ts","../../../node_modules/@types/color-name/index.d.ts","../../../node_modules/@types/color-convert/conversions.d.ts","../../../node_modules/@types/color-convert/route.d.ts","../../../node_modules/@types/color-convert/index.d.ts","../../../node_modules/@types/color/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/connect-history-api-fallback/index.d.ts","../../../node_modules/@types/cssnano/node_modules/postcss/lib/postcss.d.ts","../../../node_modules/@types/cssnano/index.d.ts","../../../node_modules/@types/decompress/index.d.ts","../../../node_modules/@types/dedent/index.d.ts","../../../node_modules/@types/detect-port/index.d.ts","../../../node_modules/@types/got/index.d.ts","../../../node_modules/@types/download/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/eslint/lib/rules/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/@types/fs-extra/index.d.ts","../../../node_modules/@types/github-slugger/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/glob/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/hast/index.d.ts","../../../node_modules/@types/history/domutils.d.ts","../../../node_modules/@types/history/createbrowserhistory.d.ts","../../../node_modules/@types/history/createhashhistory.d.ts","../../../node_modules/@types/history/creatememoryhistory.d.ts","../../../node_modules/@types/history/locationutils.d.ts","../../../node_modules/@types/history/pathutils.d.ts","../../../node_modules/@types/history/index.d.ts","../../../node_modules/@types/uglify-js/index.d.ts","../../../node_modules/@types/relateurl/index.d.ts","../../../node_modules/@types/html-minifier/index.d.ts","../../../node_modules/@types/html-minifier-terser/index.d.ts","../../../node_modules/@types/html-webpack-plugin/index.d.ts","../../../node_modules/@types/http-proxy/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/jest-diff/build/cleanupsemantic.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/difflines.d.ts","../../../node_modules/jest-diff/build/printdiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/pretty-format/build/types.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/js-yaml/index.d.ts","../../../node_modules/ast-types/types.d.ts","../../../node_modules/ast-types/gen/kinds.d.ts","../../../node_modules/ast-types/gen/nodes.d.ts","../../../node_modules/ast-types/lib/types.d.ts","../../../node_modules/ast-types/lib/path.d.ts","../../../node_modules/ast-types/lib/scope.d.ts","../../../node_modules/ast-types/lib/node-path.d.ts","../../../node_modules/ast-types/lib/path-visitor.d.ts","../../../node_modules/ast-types/fork.d.ts","../../../node_modules/ast-types/gen/namedtypes.d.ts","../../../node_modules/ast-types/gen/builders.d.ts","../../../node_modules/ast-types/gen/visitor.d.ts","../../../node_modules/ast-types/main.d.ts","../../../node_modules/recast/lib/types.d.ts","../../../node_modules/recast/lib/options.d.ts","../../../node_modules/recast/lib/parser.d.ts","../../../node_modules/recast/lib/printer.d.ts","../../../node_modules/recast/main.d.ts","../../../node_modules/@types/jscodeshift/src/collections/jsxelement.d.ts","../../../node_modules/@types/jscodeshift/src/collections/node.d.ts","../../../node_modules/@types/jscodeshift/src/collections/variabledeclarator.d.ts","../../../node_modules/@types/jscodeshift/src/collection.d.ts","../../../node_modules/@types/jscodeshift/src/template.d.ts","../../../node_modules/@types/jscodeshift/src/core.d.ts","../../../node_modules/@types/jscodeshift/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/katex/contrib/auto-render.d.ts","../../../node_modules/@types/katex/contrib/katex2tex.d.ts","../../../node_modules/@types/katex/contrib/index.d.ts","../../../node_modules/@types/katex/index.d.ts","../../../node_modules/@types/loader-utils/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mkdirp/index.d.ts","../../../node_modules/form-data/index.d.ts","../../../node_modules/@types/node-fetch/externals.d.ts","../../../node_modules/@types/node-fetch/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/nprogress/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/parse5/index.d.ts","../../../node_modules/@types/picomatch/lib/constants.d.ts","../../../node_modules/@types/picomatch/lib/parse.d.ts","../../../node_modules/@types/picomatch/lib/scan.d.ts","../../../node_modules/@types/picomatch/lib/picomatch.d.ts","../../../node_modules/@types/picomatch/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/prismjs/index.d.ts","../../../node_modules/@types/prompts/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/q/index.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/@types/react-dev-utils/index.d.ts","../../../node_modules/@types/react-helmet/index.d.ts","../../../node_modules/@types/react-loadable/index.d.ts","../../../node_modules/@types/react-router/index.d.ts","../../../node_modules/@types/react-router-config/index.d.ts","../../../node_modules/@types/react-router-dom/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/sax/index.d.ts","../../../node_modules/@types/scheduler/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/shelljs/index.d.ts","../../../node_modules/@types/source-list-map/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/tapable/index.d.ts","../../../node_modules/@types/wait-on/index.d.ts","../../../node_modules/@types/webpack/node_modules/anymatch/index.d.ts","../../../node_modules/@types/webpack-sources/node_modules/source-map/source-map.d.ts","../../../node_modules/@types/webpack-sources/lib/source.d.ts","../../../node_modules/@types/webpack-sources/lib/compatsource.d.ts","../../../node_modules/@types/webpack-sources/lib/concatsource.d.ts","../../../node_modules/@types/webpack-sources/lib/originalsource.d.ts","../../../node_modules/@types/webpack-sources/lib/prefixsource.d.ts","../../../node_modules/@types/webpack-sources/lib/rawsource.d.ts","../../../node_modules/@types/webpack-sources/lib/replacesource.d.ts","../../../node_modules/@types/webpack-sources/lib/sizeonlysource.d.ts","../../../node_modules/@types/webpack-sources/lib/sourcemapsource.d.ts","../../../node_modules/@types/webpack-sources/lib/index.d.ts","../../../node_modules/@types/webpack-sources/lib/cachedsource.d.ts","../../../node_modules/@types/webpack-sources/index.d.ts","../../../node_modules/@types/webpack/index.d.ts","../../../node_modules/http-proxy-middleware/dist/types.d.ts","../../../node_modules/http-proxy-middleware/dist/handlers/response-interceptor.d.ts","../../../node_modules/http-proxy-middleware/dist/handlers/fix-request-body.d.ts","../../../node_modules/http-proxy-middleware/dist/handlers/public.d.ts","../../../node_modules/http-proxy-middleware/dist/handlers/index.d.ts","../../../node_modules/http-proxy-middleware/dist/index.d.ts","../../../node_modules/@types/webpack-dev-server/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"cce43d02223f8049864f8568bed322c39424013275cd3bcc3f51492d8b546cb3","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"8dff1b4c2df638fcd976cbb0e636f23ab5968e836cd45084cc31d47d1ab19c49","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"8f4c9f651c8294a2eb1cbd12581fe25bfb901ab1d474bb93cd38c7e2f4be7a30","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"60761e6ea886034af0f294f025a7199360ce4e2c8ba4ec6408bc049cf9b89799","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"506b80b9951c9381dc5f11897b31fca5e2a65731d96ddefa19687fbc26b23c6e","affectsGlobalScope":true},"ea7abf23498b7c214c67fc14f22f41983fbb7bf7c4826c7fcdef542b2022545f","332bc92a89da24ef3a645208f2b3159292460a52fbe63c40eef64c2a63bb1e40","ad88e00caeb0b4cfaac7811845d446eaeb5a4f75f3eae1c476a755ff94b726b9","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","f1e8ecd1d960d12e57316fd2889b0a57635f38f8c4c976d8deafa29650bbf320","3a1e165b22a1cb8df82c44c9a09502fd2b33f160cd277de2cd3a055d8e5c6b27","67f129ed8b372622ff36b8b10e39d03e09e363a5ff7821105f92f085b8d1ccba","327f42ab31ff4539ba868d0374f8825af328b104b5f78d26b2e3ce9cc17b43a0","62a05210201c793349ec28254f06a01814c5b4f5591f6d1921941286db78ea2a","8f877178233f74095130e129ce86128a6a15afcfc6171d714e154863b6a65fe8","b395ec0779c66de885f97974534e95ee2c8bbf9acaf5857a6782ddc32972b6d8","572b4d4c4e2cd3026db925ca5cb721f5c3f4f52938da404de1148a126348f29b","c72b982add26c5ddf410899bcafe3f47253a5d274d4b93d2ef67850d4af4545b","13e5e388b5816cb8325e79b26bae6ba24bcd6f9f22e636f6f4329ccf650f8751","0daf3165e72cc1ed5263a3374b98cb065f78922c76602477973ee0654b99df17","54908e77ad591652580ebdfcc70078a3ae69978e8393a0c95e9e4319fd7d591a","98249526332851a623664fd515a293f50d680d4a86d633585ecb9168e67cd872","3fedee34f24b13af4a97c4184a9e215a6f6b2dfb655dafc24970c76791b06c43","4fae0cbdbb492b0fc847ec76d0a4af44eb04028200cec088d97fca05438213f1","c7642b1c7345e546c81831fe5fa9233e15a12fa2743f6685b0d700af8292cdd0","857d6d4a53c4372a2799e733ab122d28f7b2b580fe58b80a5fe1321a733c20f7","507c590897f90453e6f2e8945a52153d14cc67241ad84d85704df2eb5960a87e",{"version":"b5cebf96da501d0ff5d86bcf2623164d6a410991209c8960632d222845619833","signature":"57e1940021e5e3ff12963f4218195c786a0d2a475a400fffb7cdd4352823854d"},{"version":"755d5867281b661fe63712cb917d54bfcc09e70ce1ecb70ad2b539f9ea57aaef","signature":"d62aae9510ec58d3533a76b9915dae85dea65aa39c915613dc9f47918f596b1e"},{"version":"98ac80e52cb434779eadc830b221098068f680acd9d863ad497ba249bd751cba","signature":"01c67feaa6d785a1f958c92f0e1eabdd69bd5e44cbd8a233b89a247ad9bb1dc3"},"a17ba25a194979a88bfd925e849d76b63f68c4160b69a99c5d723eac5ffddaf0","b25c5f2970d06c729f464c0aeaa64b1a5b5f1355aa93554bb5f9c199b8624b1e","3e6297bcddf37e373d40ddb4c2b9e6fc98901b2a44c01b2d96af142874973c43","3051751533eee92572241b3cef28333212401408c4e7aa21718714b793c0f4ed","691aea9772797ca98334eb743e7686e29325b02c6931391bcee4cc7bf27a9f3b","6f1d39d26959517da3bd105c552eded4c34702705c64d75b03f54d864b6e41c2",{"version":"25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d","affectsGlobalScope":true},"e23424b97418eca3226fd24de079f1203eb70360622e4e093af2aff14d4be6ec","a473cf45c3d9809518f8af913312139d9f4db6887dc554e0d06d0f4e52722e6b","a668dfae917097b30fc29bbebeeb869cee22529f2aa9976cea03c7e834a1b841","04eaa93bd75f937f9184dcb95a7983800c5770cf8ddd8ac0f3734dc02f5b20ef",{"version":"7ddd5487c03df04c01a8618e06d875e167524902ed3dd9a2a9345a0ef5202d6f","affectsGlobalScope":true},"45ac321f2e15d268fd74a90ddaa6467dcaaff2c5b13f95b4b85831520fb7a491","aab38abd210255237d4dc101c9e5b5f8d746fd75aeb30cc77b6a4d322b06693d","797a9d37eb1f76143311c3f0a186ce5c0d8735e94c0ca08ff8712a876c9b4f9e","bc31e01146eec89eb870b9ad8c55d759bcbc8989a894e6f0f81f832e0d10eb04",{"version":"2866a528b2708aa272ec3eaafd3c980abb23aec1ef831cfc5eb2186b98c37ce5","affectsGlobalScope":true},{"version":"153d835dc32985120790e10102834b0a5bd979bb5e42bfbb33c0ff6260cf03ce","affectsGlobalScope":true},"a44c87a409b60f211a240341905d818f5f173420dcf7f989ee6c8a1a3d812ae9","bdaf554ae2d9d09e2a42f58a29ef7f80e5b5c1d7b96bfb717243dc91a477216e","ea194ae7fee69ab77ee0ff7b7f35227eb09515583f6c08988a59fa65661af990","321ea733ae7f611077a2d7b4bc378ac4a6b7e365e1a51c71a7e5b2818e1e310a","13257840c0850d4ebd7c2b17604a9e006f752de76c2400ebc752bc465c330452","42176966283d3835c34278b9b5c0f470d484c0c0c6a55c20a2c916a1ce69b6e8","0cff7901aedfe78e314f7d44088f07e2afa1b6e4f0473a4169b8456ca2fb245d","ae7b9d7ab1652cc1866ba6e269d0eeaf1708d07327714124ed2cbd059f5e4766","69640cc2e76dad52daeb9914e6b70c5c9a5591a3a65190a2d3ea432cf0015e16","21e64a125f65dff99cc3ed366c96e922b90daed343eb52ecdace5f220401dcda","f25b17702bd5d9e1a21e223863d09774197e0832a0534ba12bd7558bcc8548f4",{"version":"b0b00cf2e8107ab671243a73d2fbd6296a853bebe3fcfaaca293f65aaa245eaf","affectsGlobalScope":true},"7f77304372efe3c9967e5f9ea2061f1b4bf41dc3cda3c83cdd676f2e5af6b7e6","992c6f6be16c0a1d2eec13ece33adeea2c747ba27fcd078353a8f4bb5b4fea58","3b790d08129aca55fd5ae1672d1d26594147ac0d5f2eedc30c7575eb18daef7e","a6b0abdb67d63ebe964ba5fee31bc3daf10c12eecd46b24d778426010c04c67e","e7b5a3f40f19d9eea71890c70dfb37ac5dd82cbffe5f95bc8f23c536455732d0","4fd3c4debadce3e9ab9dec3eb45f7f5e2e3d4ad65cf975a6d938d883cfb25a50","0953427f9c2498f71dd912fdd8a81b19cf6925de3e1ad67ab9a77b9a0f79bf0b","f89a6d56f0267f6e73c707f8a89d2f38e9928e10bfa505f39a4f4bf954093aee","7df562288f949945cf69c21cd912100c2afedeeb7cdb219085f7f4b46cb7dde4","9d16690485ff1eb4f6fc57aebe237728fd8e03130c460919da3a35f4d9bd97f5","dcc6910d95a3625fd2b0487fda055988e46ab46c357a1b3618c27b4a8dd739c9","e649840284bab8c4d09cadc125cd7fbde7529690cc1a0881872b6a9cd202819b","a364b4a8a015ae377052fa4fac94204d79a69d879567f444c7ceff1b7a18482d","60c9e27816ec8ac8df7240598bb086e95b47edfb454c5cbf4003c812e0ed6e39","6c63cb179eda2be5ab45dc146fa4151bec8ce4781986935fe40adfc69cbbf214","4926467de88a92a4fc9971d8c6f21b91eca1c0e7fc2a46cc4638ab9440c73875",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"4e0a4d84b15692ea8669fe4f3d05a4f204567906b1347da7a58b75f45bae48d3","ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c","b3593bd345ebea5e4d0a894c03251a3774b34df3d6db57075c18e089a599ba76","e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b","49daf80661034e07d919f1c716aef69324e34d18a63a282f8100f52c961b58a7","81c14b89fa607b86dd726e2e3e91360cf8155ce97468404324d404a5bd65b2eb","ebddbd167c2fabd0151f50e5df94ca6d845149c47521280d8867afe3429dd078","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","c0c0ce59aaee107786eca330b64eb2413bd9d14848f35282f6e61e6972b6f52e","f0cb4b3ab88193e3e51e9e2622e4c375955003f1f81239d72c5b7a95415dad3e","92450d617e92f96354d281c8ed5613fd16cacea79eb60b1e9736494b3c057e69","8a9086357fe289efb682dc925358f30b6312c7219a5ca92212857a0a79612012","92bc42ed0e2d41559513fd457ee30d834c2f0fedb9ed5004c029cbf0ad2f8bd9","ac502bda446da2b897b8fb9373199f08e111a82c19ea0f9a1debf49ed34b6970","4e88b833be14c7f384e0dcd57bb30acd799e8e34d212635d693e41a75a71164b","98437d5a640b67c41534f0de2dcb64c75433dcdff54ff8f8432e613663619a2e",{"version":"9ea2638b6eee61ff2c59c3ac74c1b5999a843da0e2bb60e8bf028b19aacf6246","affectsGlobalScope":true},"a9ef188a807dfa67e80eb100aeac1036f61d01f64d8b51ce68e78ee40cdef415","aec0cabbdfacf43db998d8e50ee6f1e72131d24b5018dfb84f14806717baa0a6","ef36fa133bed82cf3d1262c0894a643532bca4a743bea90b537f643003880315","fb32fb9b2a2c9cfccae34a6383834030ea9ebab2e46964ab6e876fe2b9ca2f42","70646d9cb37b62611766d18a9bcca6cbf28ca9aec33a66244e974056ab1193f6","032d6a55e0d1b473bf06cc9f30cfa6313bc57202bc5aacf8077022c4a27ff7d6","ff27d48b9c7f85c9d38cb13fce5886bad9a30846aedb5f54759eee58391a79e1","912989089693cac2ce78c83289b98d5d9be6d399009c5d2e06ad3edf50e7b335",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"0133ebdd17a823ae56861948870cde4dac18dd8818ab641039c85bbb720429e0","9f3554130bc117f19a9d4186bd83a97145c71818c1b1c51424967e0f607324d5","e3dd9a5ce3e396a63d378146a2bce9f52ea86419ef787cd55d2e8bb2a4cd716f","274bda283ef15f4205603ca9967313fc013aa77ae89f2cbeab5fbd51439e96ed","84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","3b02517f9be71f255eadab9892406055d069167891f1e1ea16c96c4ff1ddda01","3b05c396564e51753e921e1cc4aae1cf7cd9be53c891cf2e81fa29f11c0bd373","8d01c38ccb9af3a4035a68818799e5ef32ccc8cf70bdb83e181e1921d7ad32f6","78a1efd7214a25b84e08af80fe2b027c3049e52b26dfcaf777b82c759d8548c9","95c22bc19835e28e2e524a4bb8898eb5f2107b640d7279a6d3aade261916bbf2","393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","1320ee42b30487cceb6da9f230354fc34826111f76bf12f0ad76c717c12625b0","b6e83cdeca61289e5ffd770e55ed035babdffadd87d1ffa42b03e9fe8411333f",{"version":"271cde49dfd9b398ccc91bb3aaa43854cf76f4d14e10fed91cbac649aa6cbc63","affectsGlobalScope":true},"c6f2572e21f626260d2e4a65e4e1e42b9b273b6f43b5c3bc115c2926417d3eca","374ab77e05e0bf5a52acad6d65121d4bd31068108f23d70186dba5fcd7d6a1a3","a4ecd4bb653aa71093375845fba6250ca0f3c633d0e933fc9bf4b301834eab27","25d91fb9ed77a828cc6c7a863236fb712dafcd52f816eec481bd0c1f589f4404","4cd14cea22eed1bfb0dc76183e56989f897ac5b14c0e2a819e5162eafdcfe243","cc53cba64efb30576f2a36f1d7107e4453e84cbd0f371d49cd1dfd208e11233b","bee79f5862fe1278d2ba275298862bce3f7abf1e59d9c669c4b9a4b2bba96956","a523644fe1d30f36465118be107642c78c36afe0d885f93eae399b3c44dc8fe9","e966621f305cecf5ed6460197ff1652208257b5ca7da402a4285cc57589f6f36","6767cce098e1e6369c26258b7a1f9e569c5467d501a47a090136d5ea6e80ae6d","dd96ff6ecc47584219c6301f1653eec514c2cb83fc8ad195ccb54c9759765e3a","8d068614f2f0c00d6b712f16f52511c054d3cf205d749ede8d9f231c0ddac03f","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"bbc19287f48d4b3c753bd2c82dd9326af19cccbfa1506f859029dfcedc7c5522","affectsGlobalScope":true},"73a371996ab8b5f895fc4aff8018ad79804254ae32648c9ac11e87f2fce5658a","cc2dc362fc50995684e9f7e9b38ad9bdf19e74919294a694cbc05392352cad7d","e07b482ad35f73ea26312cb5bfbc735cfd2c68808e70634d32a43f8b53033a11","494d475b36a458bbfdcf60f54abaf2084a3840ff38fe5dcf8e3e8d405edc7938","55194e5c1f7fdd2a209da42b0b481c556bae31b20675fa7e7fbd7f49a6c40d57","8cd7362102d928e21b291a013f80fc68a038d4506d26ea9948c676e3fa1110d9","90f6830fb380f4d2b69df018343ae80ce92991e85a0d7be8d214c643b39d1175","1bfe6db4f3dffacd1da82748cb8f0acec04e8a4d7bd36c09573d5d80a7dec28b","009e40fab9efa56ae3f540ff7a18cbeae6b4140647a040681c524bf19f52995e","0e7fbd72cba67a53642362282ec001d495fbb7ad575f47ba5ffa19006f124d60","24cf966363ab1b0200b7a720f9ae1f2efb5e2f9bd4a3c1f13482cd0456745f90","35acd8ffbb879ea4447df8fc7b422ed8af7dceec6036562eb2825eeea89222b1","262810de652d20b24b0e9872e33941972735c8c0a2bd794c361038f823dd7ecb","7bfe977bcf0f5fab4d0b2820af80cebf4765b77658cc238903f82873ea813e12","8648c31510a3a81275736733ec1a4562a012e4e1a0f5fea9d47a8ed30dc4280c","aad8c703de79100c97d6d6d753e6c3e5c355d8024f7c80e0275b3973208b9dd3","e3a5287471fb08f053c06fd998632792aa5f022e45278f1e6dd55fb2fa9e7362","28a6c8eeb48e165920067b9193555649fc43c2a28c450f23f622e5eb043d9463","b114b49f7cc89ed20375ec8f070ceed9748d022d9a6f94894f247c5e8182ccc7","187b38d2397b9ab2a459042295b6ae463d369ae1786f23abf6f58d925905ee09","68a982b9899e9df6bc37b62a57fdeac0b197d9f252a2386589a28ffc0e316503","63326d4f23f82d250abe61157183fd0d0612f00540d27681ef6458e60850c315","19f9e754bda221cc851c07454f43ae28d0faeb48fb17ef48802f022297603ed6","f5173cf4e2ae28cacdd974951e64e7e7476cecec52be1b218d309cc10b580436","0b7f81e8fa0bb70a104fd1ac689d56807b929006bf49557189ab06d756973f38","8faaa860d85e112c2898437d958f8f07cb847e53db3018c719ef4d0c2227f77b","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","a93bbe06d20763f821db7b671ba9efbf4b602fb4cd612ae9d40f01a30f62966c","1ced83d3606cfe4a0d2d98c24873b4147ac4c1b9beacb1d1dd0d8bacd3a00220","42c7f325d2075cf80f65ef6225692605b6516602209175d29281c7a53838d28f","451a3f75d74f7b130a0e28dc77f21b7d79b99381ebae3f0d849905c5ab33872e","fbd29ea9dd64c69ded0284cb1307557e8f7bf6265ce2bf1faa3840ffed2d38ac","3594c022901a1c8993b0f78a3f534cfb81e7b619ed215348f7f6882f3db02abc","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","782abf371043fc65a987f835a3acfd80602a30c3e2122f6d5756a86bf6913352","509235563ea2b939e1bbe92aae17e71e6a82ceab8f568b45fb4fce7d72523a32","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","4908e4c00832b26ce77a629de8501b0e23a903c094f9e79a7fec313a15da796a","2630a7cbb597e85d713b7ef47f2946d4280d3d4c02733282770741d40672b1a5",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"9a6d65d77455efaaaeff945bea30c38b8fe0922b807ba45cd23792392f1bfe76","e437d83044ba17246a861aa9691aa14223ff4a9d6f338ab1269c41c758586a88","6396a7a06f3ef0fc31a7c89330e015146b78a2256b030c698b6d404594c37b8f","736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","8fe9135b86994075c4192f3358a4350389e80d3abec712db2a82061962d9d21c","e0014889f31fee76a572b6b15e74b2174cbcf6346ae8ab5c69eb553a10e5c944","c9ad058b2cc9ce6dc2ed92960d6d009e8c04bef46d3f5312283debca6869f613","3c17de487f67fd2ce7a70090b19e791b0388ed9cb60cdbdc7a49277094ffc413","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","c555dd691dd05955e99cd93dd99c685a65e5287813ccb5e6bfde951183248e26","c0ad01cd660e5b8478c46ba9eda9bb60057de0744b3436fab3ce1ab764109da9","a811919884d27b7f56502cb3f89e8d5ba42a70af7d421f1a989a0b85825a93b2","a9ce2f5469b4648ad305fed3a23eabd09c6887fbbb9028c983851cbe8693bdf0","6faeb7075e31bb027045bf3c6c1ee73c34b2d4094e0f80e209f62d89ef3847ba","2c62313d703a4e95d56aae612fba35dc0eca38e399ed9729ee27facf64e9b993","08b428a44bc98005536a12456518797e9afe2a08e8b5d9785641713a54475881","831b44f91491d73ba21effa69d48698b09933db1c7f92a33c048852a76a79068","db6347c1934b46b5bab02cc6a4c3323d604a5cd4a72f92d5c7cfc24ea8dcd4ec","a7e32dcb90bf0c1b7a1e4ac89b0f7747cbcba25e7beddc1ebf17be1e161842ad","f9a2dd6a6084665f093ed0e9664b8e673be2a45e342a59dd4e0e4e552e68a9ad",{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"4ee363f83d7be2202f34fcd84c44da71bf3a9329fee8a05f976f75083a52ea94","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"ca1f4045ec1a501a114d63e2f3f24e2dba00c0cb9030b3109f579d54c1e95d63","affectsGlobalScope":true},"b5478b9a935cf14fe43a00f80dee3805b5f5f6d33be9d96fae7babea0e0dad76","370aa0007632db53c67e21c1584fb998c8af918ca1d38688b044b4ce3d0524c0",{"version":"8299ae8e2b6f219b89e33f5383e85b71b160550678a9c7aaf3729b95c59e57a6","affectsGlobalScope":true},"c78b1c30f9ea6f57c2c4beb62734bf0df604a537690d7a098e6ca99157f4c2a3","d4eeffab023f619ebaeeca01570c026eed02256061973bef5546a6c779552818","b89701b714364b5bcb0b58e83725aa02a4f41df8357000b4e8fe60566bf805ac","8a19491eba2108d5c333c249699f40aff05ad312c04a17504573b27d91f0aede","c17785a46d81d27213ae62b86d6dc0e87e230106e9a57dbfb815d3bea978a6a5","3169db033165677f1d414baf0c82ba27801089ca1b66d97af464512a47df31b5","d9e55d93aa33fad61bd5c63800972d00ba8879ec5d29f6f3bce67d16d86abc33","2ac9c8332c5f8510b8bdd571f8271e0f39b0577714d5e95c1e79a12b2616f069","42c21aa963e7b86fa00801d96e88b36803188018d5ad91db2a9101bccd40b3ff","d31eb848cdebb4c55b4893b335a7c0cca95ad66dee13cbb7d0893810c0a9c301","77c1d91a129ba60b8c405f9f539e42df834afb174fe0785f89d92a2c7c16b77a","c544d81603149987796b24cca297c965db427b84b2580fb27e52fb37ddc1f470","906c751ef5822ec0dadcea2f0e9db64a33fb4ee926cc9f7efa38afe5d5371b2a","5387c049e9702f2d2d7ece1a74836a14b47fbebe9bbeb19f94c580a37c855351","c68391fb9efad5d99ff332c65b1606248c4e4a9f1dd9a087204242b56c7126d6","e9cf02252d3a0ced987d24845dcb1f11c1be5541f17e5daa44c6de2d18138d0c","e8b02b879754d85f48489294f99147aeccc352c760d95a6fe2b6e49cd400b2fe","9f6908ab3d8a86c68b86e38578afc7095114e66b2fc36a2a96e9252aac3998e0","0eedb2344442b143ddcd788f87096961cd8572b64f10b4afc3356aa0460171c6","9eb2875a1e4c583066af7d6194ea8162191b2756e5d87ccb3c562fdf74d06869","c68baff4d8ba346130e9753cefe2e487a16731bf17e05fdacc81e8c9a26aae9d","2cd15528d8bb5d0453aa339b4b52e0696e8b07e790c153831c642c3dea5ac8af","479d622e66283ffa9883fbc33e441f7fc928b2277ff30aacbec7b7761b4e9579","ade307876dc5ca267ca308d09e737b611505e015c535863f22420a11fffc1c54","f8cdefa3e0dee639eccbe9794b46f90291e5fd3989fcba60d2f08fde56179fb9","86c5a62f99aac7053976e317dbe9acb2eaf903aaf3d2e5bb1cafe5c2df7b37a8","2b300954ce01a8343866f737656e13243e86e5baef51bd0631b21dcef1f6e954","a2d409a9ffd872d6b9d78ead00baa116bbc73cfa959fce9a2f29d3227876b2a1","b288936f560cd71f4a6002953290de9ff8dfbfbf37f5a9391be5c83322324898","61178a781ef82e0ff54f9430397e71e8f365fc1e3725e0e5346f2de7b0d50dfa","6a6ccb37feb3aad32d9be026a3337db195979cd5727a616fc0f557e974101a54","6eef5113135a0f2bbac8259909a5bbb7666bcde022c28f4ab95145623cbe1f72","058b8dd97b7c67b6bf33e7bda7b1e247b019b675d4b6449d14ac002091a8b4f8","89c8a7b88c378663a8124664f2d9b8c2887e186b55aa066edf6d67177ca1aa04","5a30ba65ad753eb2ef65355dbb3011b28b192cb9df2ef0b5f595b51ca7faf353","5192f9a6469f849e0863616b668fde54bcd6704394b4bfbd115691865f66d761","f41d30972724714763a2698ae949fbc463afb203b5fa7c4ad7e4de0871129a17","0123340327efb174818f4b78bf6a9b12f8470754e6afac9e4d32a2ad27521f7b","9795e0a3a45d5b6f1a791ee54b7c8b58bc931e8900966cea2dff9c5bae56073b","5890be29879d02424b7654f40592915189034948f7a18c5ad121c006d4e92811","0ab49086f10c75a1cb3b18bffe799dae021774146d8a2d5a4bb42dda67b64f9b","81c77839e152b8f715ec67b0a8b910bcc2d6cf916794c3519f8798c40efd12ac","a868a534ba1c2ca9060b8a13b0ffbbbf78b4be7b0ff80d8c75b02773f7192c29","464843c00fb3dd4735b28255c5c9fe713f16b8e47a3db09ba1647687440f7aef","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","03d2e70c34640b553ed580286eb234835695ea1e473d837a4ced672648d453cd","b73abc91e3166b1951d302f8008c17e62d32e570e71b2680141f7c3f5d0a990d","67fc055eb86a0632e2e072838f889ffe1754083cb13c8c80a06a7d895d877aae","c6c4fea9acc55d5e38ff2b70d57ab0b5cdbd08f8bc5d7a226e322cea128c5b57","d558a0fe921ebcc88d3212c2c42108abf9f0d694d67ebdeba37d7728c044f579","356c3df1d255b9fe81d7c3d822d60a2a66c99b1cf853b04a69810a31a449b735","4fb0b7d532aa6fb850b6cd2f1ee4f00802d877b5c66a51903bc1fb0624126349","b90c59ac4682368a01c83881b814738eb151de8a58f52eb7edadea2bcffb11b9","8560a87b2e9f8e2c3808c8f6172c9b7eb6c9b08cb9f937db71c285ecf292c81d","ffe3931ff864f28d80ae2f33bd11123ad3d7bad9896b910a1e61504cc093e1f5","083c1bd82f8dc3a1ed6fc9e8eaddf141f7c05df418eca386598821e045253af9","274ebe605bd7f71ce161f9f5328febc7d547a2929f803f04b44ec4a7d8729517","6ca0207e70d985a24396583f55836b10dc181063ab6069733561bfde404d1bad","5908142efeaab38ffdf43927ee0af681ae77e0d7672b956dfb8b6c705dbfe106","f772b188b943549b5c5eb803133314b8aa7689eced80eed0b70e2f30ca07ab9c","0026b816ef05cfbf290e8585820eef0f13250438669107dfc44482bac007b14f","8ef5aad624890acfe0fa48230edce255f00934016d16acb8de0edac0ea5b21bb","9af6248ff4baf0c1ddc62bb0bc43197437bd5fb2c95ff8e10e4cf2e699ea45c1","d84398556ba4595ee6be554671da142cfe964cbdebb2f0c517a10f76f2b016c0","89b42f8ee5d387a39db85ee2c7123a391c3ede266a2bcd502c85ad55626c3b2b","99c7f3bbc03f6eb3e663c26c104d639617620c2925e76fc284f7bedf1877fa2b","59115d08fbd0d93bbb2af3fe5b914194fea2906945f2ee08e264b96c7e8601fe","f90d85d4cb38445499bdb7e7b013e4f64d99d157a6fa0843e998495ceb27b520","94ae892ab0c0b2800dbd817ffd0a5bd6cfb60a0cc4ce6860a9f965712cc3eb5d","901becb8779e1089442378fda5623e607ee4588762a32e7692436f1ea81cf848","8286d84d2567b713fd6a1fdfbb1a0abc8cfa668ee1e0e83d7dd4ade5761f2750","f28dffc6bf9bbd8b9dc156aadb74d11de7faabf547eb9f0aebb8cd03e8750a6c","b2bcfd1c457bf7845a5e5f81d1b34785de14f07dc97a27571d7f54c8f4873b65","3bdd93ec24853e61bfa4c63ebaa425ff3e474156e87a47d90122e1d8cc717c1f","5a2a25feca554a8f289ed62114771b8c63d89f2b58325e2f8b7043e4e0160d11"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"declarationMap":false,"esModuleInterop":true,"importHelpers":true,"jsx":2,"module":1,"noEmitHelpers":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":6,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[70],[70,71,72,73,74],[70,72],[90,121,122],[90,92,121,124],[126],[127,128],[127],[129],[110,121,133],[90,121],[135],[124],[121],[121,137,140],[144,145],[50,142,143,144],[145],[87,90,121,131,132],[123,132,133,148],[88,121],[87,121,152],[90,92,104,110,121],[155],[157,163],[158,159,160,161,162],[163],[125,164,165],[55,56,166],[87,90,92,95,104,110,121],[170],[171],[177,179],[205],[199,200,201,202],[184,199,203],[184,199,200,202,203,204],[199],[211],[208,209],[210],[56,121],[213,215,216,217,218,219,220,221,222,223,224,225],[213,214,216,217,218,219,220,221,222,223,224,225],[214,215,216,217,218,219,220,221,222,223,224,225],[213,214,215,217,218,219,220,221,222,223,224,225],[213,214,215,216,218,219,220,221,222,223,224,225],[213,214,215,216,217,219,220,221,222,223,224,225],[213,214,215,216,217,218,220,221,222,223,224,225],[213,214,215,216,217,218,219,221,222,223,224,225],[213,214,215,216,217,218,219,220,222,223,224,225],[213,214,215,216,217,218,219,220,221,223,224,225],[213,214,215,216,217,218,219,220,221,222,224,225],[213,214,215,216,217,218,219,220,221,222,223,225],[213,214,215,216,217,218,219,220,221,222,223,224],[90,110,121,229,230],[118,119],[87,88,95,104],[79,87,95],[111],[83,88,96],[104],[85,87,95],[87],[87,89,104,110],[88],[95,104,110],[87,88,90,95,104,107,110],[90,107,110],[120],[110],[85,87,104],[77],[109],[102,111,113],[95],[76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117],[101],[87,89,104,110,113],[239],[236,237,238],[104,121],[249],[163,249,253],[163,249],[244,246,247,248],[259,298],[259,283,298],[298],[259],[259,284,298],[259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297],[284,298],[90,121,147],[79,121,153],[107,121],[56,90,92,134,148,149,324],[121,306,307,308,309,310,311,312,313,314,315,316],[305,306,315],[306,315],[300,305,306,315],[305,306,307,308,309,310,311,312,313,314,316],[306],[83,305,315],[55,83,121,124,164,304,317],[326],[182,185,186,188,189],[183,184],[184],[184,185],[182,183],[184,188,189],[182,185,186,187],[182,185,188],[182,185],[182],[182,185,188,190,191,192,193],[90,104,121],[90,121,319],[322],[320,321],[319,323],[90,95,121,149,169],[173,174],[173,174,175,176],[178],[196],[194],[195,196,197,198],[52,53],[50,51,52],[50,51,53],[49,53,54,55],[46,56,57,101],[45,47,67,68],[45,46],[45,47,66],[45,47,48,67],[58,59,60,61,62,63,64,65],[47,67,68],[47]],"referencedMap":[[72,1],[75,2],[71,1],[73,3],[74,1],[123,4],[125,5],[127,6],[129,7],[128,8],[130,9],[134,10],[122,11],[136,12],[135,13],[137,14],[141,15],[146,16],[145,17],[143,18],[133,19],[149,20],[150,21],[153,22],[140,23],[154,21],[156,24],[158,25],[159,25],[160,25],[163,26],[161,27],[162,27],[166,28],[168,29],[169,30],[171,31],[172,32],[180,33],[206,34],[203,35],[200,36],[201,36],[202,36],[205,37],[204,38],[208,39],[210,40],[211,41],[212,42],[214,43],[215,44],[213,45],[216,46],[217,47],[218,48],[219,49],[220,50],[221,51],[222,52],[223,53],[224,54],[225,55],[226,24],[228,21],[231,56],[120,57],[79,58],[80,59],[81,60],[82,61],[83,62],[84,63],[86,64],[87,64],[88,65],[89,66],[90,67],[91,68],[92,69],[121,70],[93,64],[94,71],[95,72],[98,73],[99,74],[102,64],[103,75],[104,64],[107,76],[118,77],[109,76],[110,78],[112,62],[114,79],[115,62],[240,80],[239,81],[243,82],[251,83],[252,83],[254,84],[255,84],[253,85],[249,86],[256,14],[257,82],[283,87],[284,88],[259,89],[262,89],[281,87],[282,87],[272,90],[271,90],[269,87],[264,87],[277,87],[275,87],[279,87],[263,87],[276,87],[280,87],[265,87],[266,87],[278,87],[260,87],[267,87],[268,87],[270,87],[274,87],[285,91],[273,87],[261,87],[298,92],[292,91],[294,93],[293,91],[286,91],[287,91],[289,91],[291,91],[295,93],[296,93],[288,93],[290,93],[148,94],[299,95],[164,13],[303,96],[325,97],[317,98],[316,99],[307,100],[308,101],[315,102],[309,101],[310,100],[311,100],[312,100],[313,103],[306,104],[314,99],[318,105],[327,106],[190,107],[192,108],[183,109],[191,110],[184,111],[193,112],[188,113],[189,114],[186,115],[187,116],[185,116],[194,117],[229,118],[321,119],[323,120],[322,121],[320,11],[324,122],[319,123],[175,124],[177,125],[176,124],[179,126],[196,116],[197,127],[195,128],[199,129],[54,130],[53,131],[52,132],[56,133],[58,134],[69,135],[47,136],[67,137],[68,138],[66,139]],"exportedModulesMap":[[72,1],[75,2],[71,1],[73,3],[74,1],[123,4],[125,5],[127,6],[129,7],[128,8],[130,9],[134,10],[122,11],[136,12],[135,13],[137,14],[141,15],[146,16],[145,17],[143,18],[133,19],[149,20],[150,21],[153,22],[140,23],[154,21],[156,24],[158,25],[159,25],[160,25],[163,26],[161,27],[162,27],[166,28],[168,29],[169,30],[171,31],[172,32],[180,33],[206,34],[203,35],[200,36],[201,36],[202,36],[205,37],[204,38],[208,39],[210,40],[211,41],[212,42],[214,43],[215,44],[213,45],[216,46],[217,47],[218,48],[219,49],[220,50],[221,51],[222,52],[223,53],[224,54],[225,55],[226,24],[228,21],[231,56],[120,57],[79,58],[80,59],[81,60],[82,61],[83,62],[84,63],[86,64],[87,64],[88,65],[89,66],[90,67],[91,68],[92,69],[121,70],[93,64],[94,71],[95,72],[98,73],[99,74],[102,64],[103,75],[104,64],[107,76],[118,77],[109,76],[110,78],[112,62],[114,79],[115,62],[240,80],[239,81],[243,82],[251,83],[252,83],[254,84],[255,84],[253,85],[249,86],[256,14],[257,82],[283,87],[284,88],[259,89],[262,89],[281,87],[282,87],[272,90],[271,90],[269,87],[264,87],[277,87],[275,87],[279,87],[263,87],[276,87],[280,87],[265,87],[266,87],[278,87],[260,87],[267,87],[268,87],[270,87],[274,87],[285,91],[273,87],[261,87],[298,92],[292,91],[294,93],[293,91],[286,91],[287,91],[289,91],[291,91],[295,93],[296,93],[288,93],[290,93],[148,94],[299,95],[164,13],[303,96],[325,97],[317,98],[316,99],[307,100],[308,101],[315,102],[309,101],[310,100],[311,100],[312,100],[313,103],[306,104],[314,99],[318,105],[327,106],[190,107],[192,108],[183,109],[191,110],[184,111],[193,112],[188,113],[189,114],[186,115],[187,116],[185,116],[194,117],[229,118],[321,119],[323,120],[322,121],[320,11],[324,122],[319,123],[175,124],[177,125],[176,124],[179,126],[196,116],[197,127],[195,128],[199,129],[54,130],[53,131],[52,132],[56,133],[58,134],[69,140],[47,136],[67,141],[68,141],[66,139]],"semanticDiagnosticsPerFile":[72,70,75,71,73,74,123,125,127,129,128,126,130,134,122,136,135,137,138,139,141,146,142,145,143,144,133,149,150,151,153,140,154,156,158,159,160,157,163,161,162,167,166,168,169,170,171,172,180,181,206,203,200,201,202,205,204,50,207,208,210,209,211,212,214,215,213,216,217,218,219,220,221,222,223,224,225,226,147,152,227,228,230,231,119,77,120,78,79,80,81,82,83,84,85,86,87,88,89,76,116,90,91,92,121,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,118,109,110,111,112,113,117,114,115,232,233,234,235,240,236,237,239,238,241,242,243,244,245,132,131,250,251,252,254,255,253,246,249,165,256,257,258,248,283,284,259,262,281,282,272,271,269,264,277,275,279,263,276,280,265,266,278,260,267,268,270,274,285,273,261,298,297,292,294,293,286,287,289,291,295,296,288,290,148,299,300,301,302,164,155,303,325,317,316,307,308,315,309,310,311,312,313,306,314,305,318,304,326,327,51,190,192,183,191,184,193,188,189,186,187,185,194,182,48,247,229,321,323,322,320,324,319,173,175,177,176,174,46,179,178,196,197,198,195,199,54,53,52,124,55,45,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,49,56,57,58,69,47,67,68,61,64,60,65,66,63,62,59]},"version":"4.3.2"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`validation schemas AdmonitionsSchema: for value=[] 1`] = `"\\"value\\" must be of type object"`;
|
|
4
|
-
|
|
5
|
-
exports[`validation schemas AdmonitionsSchema: for value=3 1`] = `"\\"value\\" must be of type object"`;
|
|
6
|
-
|
|
7
|
-
exports[`validation schemas AdmonitionsSchema: for value=null 1`] = `"\\"value\\" must be of type object"`;
|
|
8
|
-
|
|
9
|
-
exports[`validation schemas AdmonitionsSchema: for value=true 1`] = `"\\"value\\" must be of type object"`;
|
|
10
|
-
|
|
11
|
-
exports[`validation schemas PluginIdSchema: for value="/docs" 1`] = `"\\"value\\" with value \\"/docs\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
|
|
12
|
-
|
|
13
|
-
exports[`validation schemas PluginIdSchema: for value="do cs" 1`] = `"\\"value\\" with value \\"do cs\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
|
|
14
|
-
|
|
15
|
-
exports[`validation schemas PluginIdSchema: for value="do/cs" 1`] = `"\\"value\\" with value \\"do/cs\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
|
|
16
|
-
|
|
17
|
-
exports[`validation schemas PluginIdSchema: for value="docs/" 1`] = `"\\"value\\" with value \\"docs/\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
|
|
18
|
-
|
|
19
|
-
exports[`validation schemas PluginIdSchema: for value=[] 1`] = `"\\"value\\" must be a string"`;
|
|
20
|
-
|
|
21
|
-
exports[`validation schemas PluginIdSchema: for value=3 1`] = `"\\"value\\" must be a string"`;
|
|
22
|
-
|
|
23
|
-
exports[`validation schemas PluginIdSchema: for value=null 1`] = `"\\"value\\" must be a string"`;
|
|
24
|
-
|
|
25
|
-
exports[`validation schemas PluginIdSchema: for value=true 1`] = `"\\"value\\" must be a string"`;
|
|
26
|
-
|
|
27
|
-
exports[`validation schemas RehypePluginsSchema: for value=[[]] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
28
|
-
|
|
29
|
-
exports[`validation schemas RehypePluginsSchema: for value=[[null,null]] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
30
|
-
|
|
31
|
-
exports[`validation schemas RehypePluginsSchema: for value=[[null,true]] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
32
|
-
|
|
33
|
-
exports[`validation schemas RehypePluginsSchema: for value=[3] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
34
|
-
|
|
35
|
-
exports[`validation schemas RehypePluginsSchema: for value=[false] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
36
|
-
|
|
37
|
-
exports[`validation schemas RehypePluginsSchema: for value=[null] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
38
|
-
|
|
39
|
-
exports[`validation schemas RehypePluginsSchema: for value=3 1`] = `"\\"value\\" must be an array"`;
|
|
40
|
-
|
|
41
|
-
exports[`validation schemas RehypePluginsSchema: for value=false 1`] = `"\\"value\\" must be an array"`;
|
|
42
|
-
|
|
43
|
-
exports[`validation schemas RehypePluginsSchema: for value=null 1`] = `"\\"value\\" must be an array"`;
|
|
44
|
-
|
|
45
|
-
exports[`validation schemas RemarkPluginsSchema: for value=[[]] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
46
|
-
|
|
47
|
-
exports[`validation schemas RemarkPluginsSchema: for value=[[null,null]] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
48
|
-
|
|
49
|
-
exports[`validation schemas RemarkPluginsSchema: for value=[[null,true]] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
50
|
-
|
|
51
|
-
exports[`validation schemas RemarkPluginsSchema: for value=[3] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
52
|
-
|
|
53
|
-
exports[`validation schemas RemarkPluginsSchema: for value=[false] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
54
|
-
|
|
55
|
-
exports[`validation schemas RemarkPluginsSchema: for value=[null] 1`] = `"\\"[0]\\" does not match any of the allowed types"`;
|
|
56
|
-
|
|
57
|
-
exports[`validation schemas RemarkPluginsSchema: for value=3 1`] = `"\\"value\\" must be an array"`;
|
|
58
|
-
|
|
59
|
-
exports[`validation schemas RemarkPluginsSchema: for value=false 1`] = `"\\"value\\" must be an array"`;
|
|
60
|
-
|
|
61
|
-
exports[`validation schemas RemarkPluginsSchema: for value=null 1`] = `"\\"value\\" must be an array"`;
|
|
62
|
-
|
|
63
|
-
exports[`validation schemas URISchema: for value="spaces are invalid in a URL" 1`] = `"\\"value\\" does not match any of the allowed types"`;
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import Joi from '../Joi';
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
AdmonitionsSchema,
|
|
12
|
-
RehypePluginsSchema,
|
|
13
|
-
RemarkPluginsSchema,
|
|
14
|
-
PluginIdSchema,
|
|
15
|
-
URISchema,
|
|
16
|
-
} from '../validationSchemas';
|
|
17
|
-
|
|
18
|
-
function createTestHelpers({
|
|
19
|
-
schema,
|
|
20
|
-
defaultValue,
|
|
21
|
-
}: {
|
|
22
|
-
schema: Joi.Schema;
|
|
23
|
-
defaultValue?: unknown;
|
|
24
|
-
}) {
|
|
25
|
-
function testOK(value: unknown) {
|
|
26
|
-
expect(Joi.attempt(value, schema)).toEqual(value ?? defaultValue);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function testFail(value: unknown) {
|
|
30
|
-
expect(() => Joi.attempt(value, schema)).toThrowErrorMatchingSnapshot(
|
|
31
|
-
`for value=${JSON.stringify(value)}`,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return {testOK, testFail};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function testMarkdownPluginSchemas(schema: Joi.Schema) {
|
|
39
|
-
const {testOK, testFail} = createTestHelpers({
|
|
40
|
-
schema,
|
|
41
|
-
defaultValue: [],
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
testOK(undefined);
|
|
45
|
-
testOK([function () {}]);
|
|
46
|
-
testOK([[function () {}, {attr: 'val'}]]);
|
|
47
|
-
testOK([
|
|
48
|
-
[function () {}, {attr: 'val'}],
|
|
49
|
-
function () {},
|
|
50
|
-
[function () {}, {attr: 'val'}],
|
|
51
|
-
]);
|
|
52
|
-
|
|
53
|
-
testFail(null);
|
|
54
|
-
testFail(false);
|
|
55
|
-
testFail(3);
|
|
56
|
-
testFail([null]);
|
|
57
|
-
testFail([false]);
|
|
58
|
-
testFail([3]);
|
|
59
|
-
testFail([[]]);
|
|
60
|
-
testFail([[function () {}, undefined]]);
|
|
61
|
-
testFail([[function () {}, true]]);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
describe('validation schemas', () => {
|
|
65
|
-
test('PluginIdSchema', () => {
|
|
66
|
-
const {testOK, testFail} = createTestHelpers({
|
|
67
|
-
schema: PluginIdSchema,
|
|
68
|
-
defaultValue: 'default',
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
testOK(undefined);
|
|
72
|
-
testOK('docs');
|
|
73
|
-
testOK('default');
|
|
74
|
-
testOK('plugin-id_with-simple-special-chars');
|
|
75
|
-
|
|
76
|
-
testFail('/docs');
|
|
77
|
-
testFail('docs/');
|
|
78
|
-
testFail('do/cs');
|
|
79
|
-
testFail('do cs');
|
|
80
|
-
testFail(null);
|
|
81
|
-
testFail(3);
|
|
82
|
-
testFail(true);
|
|
83
|
-
testFail([]);
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
test('AdmonitionsSchema', () => {
|
|
87
|
-
const {testOK, testFail} = createTestHelpers({
|
|
88
|
-
schema: AdmonitionsSchema,
|
|
89
|
-
defaultValue: {},
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
testOK(undefined);
|
|
93
|
-
testOK({});
|
|
94
|
-
testOK({attr: 'val'});
|
|
95
|
-
|
|
96
|
-
testFail(null);
|
|
97
|
-
testFail(3);
|
|
98
|
-
testFail(true);
|
|
99
|
-
testFail([]);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
test('RemarkPluginsSchema', () => {
|
|
103
|
-
testMarkdownPluginSchemas(RemarkPluginsSchema);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
test('RehypePluginsSchema', () => {
|
|
107
|
-
testMarkdownPluginSchemas(RehypePluginsSchema);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
test('URISchema', () => {
|
|
111
|
-
const {testFail, testOK} = createTestHelpers({schema: URISchema});
|
|
112
|
-
|
|
113
|
-
const validURL = 'https://docusaurus.io';
|
|
114
|
-
const doubleHash = 'https://docusaurus.io#github#/:';
|
|
115
|
-
const invalidURL = 'spaces are invalid in a URL';
|
|
116
|
-
const relativeURL = 'relativeURL';
|
|
117
|
-
const relativeURLWithParent = '../relativeURLWithParent';
|
|
118
|
-
const urlFromIssue = 'https://riot.im/app/#/room/#ligo-public:matrix.org';
|
|
119
|
-
testOK(validURL);
|
|
120
|
-
testOK(doubleHash);
|
|
121
|
-
testFail(invalidURL);
|
|
122
|
-
testOK(relativeURL);
|
|
123
|
-
testOK(relativeURLWithParent);
|
|
124
|
-
testOK(urlFromIssue);
|
|
125
|
-
|
|
126
|
-
const protocolRelativeUrl1 = '//docusaurus.io/path';
|
|
127
|
-
const protocolRelativeUrl2 = '//docusaurus.io/docs/doc1#hash';
|
|
128
|
-
testOK(protocolRelativeUrl1);
|
|
129
|
-
testOK(protocolRelativeUrl2);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import Joi from '../Joi';
|
|
9
|
-
import {JoiFrontMatter, validateFrontMatter} from '../validationUtils';
|
|
10
|
-
|
|
11
|
-
describe('validateFrontMatter', () => {
|
|
12
|
-
test('should accept good values', () => {
|
|
13
|
-
const schema = Joi.object<{test: string}>({
|
|
14
|
-
test: Joi.string(),
|
|
15
|
-
});
|
|
16
|
-
const frontMatter = {
|
|
17
|
-
test: 'hello',
|
|
18
|
-
};
|
|
19
|
-
expect(validateFrontMatter(frontMatter, schema)).toEqual(frontMatter);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test('should reject bad values', () => {
|
|
23
|
-
const consoleError = jest.spyOn(console, 'error').mockImplementation();
|
|
24
|
-
const schema = Joi.object<{test: string}>({
|
|
25
|
-
test: Joi.string(),
|
|
26
|
-
});
|
|
27
|
-
const frontMatter = {
|
|
28
|
-
test: true,
|
|
29
|
-
};
|
|
30
|
-
expect(() =>
|
|
31
|
-
validateFrontMatter(frontMatter, schema),
|
|
32
|
-
).toThrowErrorMatchingInlineSnapshot(`"\\"test\\" must be a string"`);
|
|
33
|
-
expect(consoleError).toHaveBeenCalledWith(
|
|
34
|
-
expect.stringContaining('The following frontmatter'),
|
|
35
|
-
);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// Fix Yaml trying to convert strings to numbers automatically
|
|
39
|
-
// We only want to deal with a single type in the final frontmatter (not string | number)
|
|
40
|
-
test('should convert number values to string when string schema', () => {
|
|
41
|
-
const schema = Joi.object<{test: string}>({
|
|
42
|
-
test: JoiFrontMatter.string(),
|
|
43
|
-
});
|
|
44
|
-
const frontMatter = {
|
|
45
|
-
test: 42,
|
|
46
|
-
};
|
|
47
|
-
expect(validateFrontMatter(frontMatter, schema)).toEqual({test: '42'});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Helps to fix Yaml trying to convert strings to dates automatically
|
|
51
|
-
// We only want to deal with a single type in the final frontmatter (not string | Date)
|
|
52
|
-
test('should convert date values when string schema', () => {
|
|
53
|
-
const schema = Joi.object<{test: string}>({
|
|
54
|
-
test: JoiFrontMatter.string(),
|
|
55
|
-
});
|
|
56
|
-
const date = new Date();
|
|
57
|
-
const frontMatter = {
|
|
58
|
-
test: date,
|
|
59
|
-
};
|
|
60
|
-
expect(validateFrontMatter(frontMatter, schema)).toEqual({
|
|
61
|
-
test: date.toString(),
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|