@elliemae/ds-legacy-props-helpers 1.0.0-rc.1
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/dist/cjs/defaultProps/index.js +36 -0
- package/dist/cjs/defaultProps/index.js.map +7 -0
- package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js +49 -0
- package/dist/cjs/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
- package/dist/cjs/getProps/index.js +42 -0
- package/dist/cjs/getProps/index.js.map +7 -0
- package/dist/cjs/globalProps/constants.js +401 -0
- package/dist/cjs/globalProps/constants.js.map +7 -0
- package/dist/cjs/globalProps/getGlobalAttributes.js +53 -0
- package/dist/cjs/globalProps/getGlobalAttributes.js.map +7 -0
- package/dist/cjs/globalProps/globalAttributesPropTypes.js +408 -0
- package/dist/cjs/globalProps/globalAttributesPropTypes.js.map +7 -0
- package/dist/cjs/globalProps/index.js +40 -0
- package/dist/cjs/globalProps/index.js.map +7 -0
- package/dist/cjs/globalProps/useGetGlobalAttributes.js +44 -0
- package/dist/cjs/globalProps/useGetGlobalAttributes.js.map +7 -0
- package/dist/cjs/index.js +59 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/propTypes/PropTypes.js +142 -0
- package/dist/cjs/propTypes/PropTypes.js.map +7 -0
- package/dist/cjs/propTypes/customPropTypes.js +39 -0
- package/dist/cjs/propTypes/customPropTypes.js.map +7 -0
- package/dist/cjs/propTypes/describe.js +79 -0
- package/dist/cjs/propTypes/describe.js.map +7 -0
- package/dist/cjs/propTypes/describeConversions.js +107 -0
- package/dist/cjs/propTypes/describeConversions.js.map +7 -0
- package/dist/cjs/propTypes/describeGuards.js +50 -0
- package/dist/cjs/propTypes/describeGuards.js.map +7 -0
- package/dist/cjs/propTypes/index.js +38 -0
- package/dist/cjs/propTypes/index.js.map +7 -0
- package/dist/cjs/propTypes/toTypescript.js +151 -0
- package/dist/cjs/propTypes/toTypescript.js.map +7 -0
- package/dist/cjs/propTypes/types.js +28 -0
- package/dist/cjs/propTypes/types.js.map +7 -0
- package/dist/cjs/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js +66 -0
- package/dist/cjs/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js.map +7 -0
- package/dist/cjs/propsPerDataTestId/getPropsPerDatatestid.js +45 -0
- package/dist/cjs/propsPerDataTestId/getPropsPerDatatestid.js.map +7 -0
- package/dist/cjs/propsPerDataTestId/index.js +38 -0
- package/dist/cjs/propsPerDataTestId/index.js.map +7 -0
- package/dist/cjs/tests/globalProps/TestComponent.js +42 -0
- package/dist/cjs/tests/globalProps/TestComponent.js.map +7 -0
- package/dist/cjs/tests/validation/test.schema.js +72 -0
- package/dist/cjs/tests/validation/test.schema.js.map +7 -0
- package/dist/cjs/tests/xstyledProps/TestComponent.js +43 -0
- package/dist/cjs/tests/xstyledProps/TestComponent.js.map +7 -0
- package/dist/cjs/useDeprecateComponent/index.js +42 -0
- package/dist/cjs/useDeprecateComponent/index.js.map +7 -0
- package/dist/cjs/validation/errorTemplates.js +53 -0
- package/dist/cjs/validation/errorTemplates.js.map +7 -0
- package/dist/cjs/validation/index.js +40 -0
- package/dist/cjs/validation/index.js.map +7 -0
- package/dist/cjs/validation/typescriptGuards.js +86 -0
- package/dist/cjs/validation/typescriptGuards.js.map +7 -0
- package/dist/cjs/validation/typescriptParsers.js +77 -0
- package/dist/cjs/validation/typescriptParsers.js.map +7 -0
- package/dist/cjs/validation/typescriptValidator.js +220 -0
- package/dist/cjs/validation/typescriptValidator.js.map +7 -0
- package/dist/cjs/xstyledProps/constants.js +132 -0
- package/dist/cjs/xstyledProps/constants.js.map +7 -0
- package/dist/cjs/xstyledProps/index.js +38 -0
- package/dist/cjs/xstyledProps/index.js.map +7 -0
- package/dist/cjs/xstyledProps/useGetXstyledProps.js +49 -0
- package/dist/cjs/xstyledProps/useGetXstyledProps.js.map +7 -0
- package/dist/cjs/xstyledProps/xstyledPropTypes.js +127 -0
- package/dist/cjs/xstyledProps/xstyledPropTypes.js.map +7 -0
- package/dist/esm/defaultProps/index.js +6 -0
- package/dist/esm/defaultProps/index.js.map +7 -0
- package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js +19 -0
- package/dist/esm/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
- package/dist/esm/getProps/index.js +12 -0
- package/dist/esm/getProps/index.js.map +7 -0
- package/dist/esm/globalProps/constants.js +371 -0
- package/dist/esm/globalProps/constants.js.map +7 -0
- package/dist/esm/globalProps/getGlobalAttributes.js +23 -0
- package/dist/esm/globalProps/getGlobalAttributes.js.map +7 -0
- package/dist/esm/globalProps/globalAttributesPropTypes.js +378 -0
- package/dist/esm/globalProps/globalAttributesPropTypes.js.map +7 -0
- package/dist/esm/globalProps/index.js +10 -0
- package/dist/esm/globalProps/index.js.map +7 -0
- package/dist/esm/globalProps/useGetGlobalAttributes.js +14 -0
- package/dist/esm/globalProps/useGetGlobalAttributes.js.map +7 -0
- package/dist/esm/index.js +38 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/propTypes/PropTypes.js +112 -0
- package/dist/esm/propTypes/PropTypes.js.map +7 -0
- package/dist/esm/propTypes/customPropTypes.js +9 -0
- package/dist/esm/propTypes/customPropTypes.js.map +7 -0
- package/dist/esm/propTypes/describe.js +49 -0
- package/dist/esm/propTypes/describe.js.map +7 -0
- package/dist/esm/propTypes/describeConversions.js +86 -0
- package/dist/esm/propTypes/describeConversions.js.map +7 -0
- package/dist/esm/propTypes/describeGuards.js +20 -0
- package/dist/esm/propTypes/describeGuards.js.map +7 -0
- package/dist/esm/propTypes/index.js +8 -0
- package/dist/esm/propTypes/index.js.map +7 -0
- package/dist/esm/propTypes/toTypescript.js +121 -0
- package/dist/esm/propTypes/toTypescript.js.map +7 -0
- package/dist/esm/propTypes/types.js +2 -0
- package/dist/esm/propTypes/types.js.map +7 -0
- package/dist/esm/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js +36 -0
- package/dist/esm/propsPerDataTestId/getPropsPerDatatestIdPropTypes.js.map +7 -0
- package/dist/esm/propsPerDataTestId/getPropsPerDatatestid.js +15 -0
- package/dist/esm/propsPerDataTestId/getPropsPerDatatestid.js.map +7 -0
- package/dist/esm/propsPerDataTestId/index.js +8 -0
- package/dist/esm/propsPerDataTestId/index.js.map +7 -0
- package/dist/esm/tests/globalProps/TestComponent.js +12 -0
- package/dist/esm/tests/globalProps/TestComponent.js.map +7 -0
- package/dist/esm/tests/validation/test.schema.js +42 -0
- package/dist/esm/tests/validation/test.schema.js.map +7 -0
- package/dist/esm/tests/xstyledProps/TestComponent.js +13 -0
- package/dist/esm/tests/xstyledProps/TestComponent.js.map +7 -0
- package/dist/esm/useDeprecateComponent/index.js +12 -0
- package/dist/esm/useDeprecateComponent/index.js.map +7 -0
- package/dist/esm/validation/errorTemplates.js +23 -0
- package/dist/esm/validation/errorTemplates.js.map +7 -0
- package/dist/esm/validation/index.js +10 -0
- package/dist/esm/validation/index.js.map +7 -0
- package/dist/esm/validation/typescriptGuards.js +56 -0
- package/dist/esm/validation/typescriptGuards.js.map +7 -0
- package/dist/esm/validation/typescriptParsers.js +47 -0
- package/dist/esm/validation/typescriptParsers.js.map +7 -0
- package/dist/esm/validation/typescriptValidator.js +202 -0
- package/dist/esm/validation/typescriptValidator.js.map +7 -0
- package/dist/esm/xstyledProps/constants.js +102 -0
- package/dist/esm/xstyledProps/constants.js.map +7 -0
- package/dist/esm/xstyledProps/index.js +8 -0
- package/dist/esm/xstyledProps/index.js.map +7 -0
- package/dist/esm/xstyledProps/useGetXstyledProps.js +19 -0
- package/dist/esm/xstyledProps/useGetXstyledProps.js.map +7 -0
- package/dist/esm/xstyledProps/xstyledPropTypes.js +97 -0
- package/dist/esm/xstyledProps/xstyledPropTypes.js.map +7 -0
- package/dist/types/defaultProps/index.d.ts +1 -0
- package/dist/types/defaultProps/useMemoMergePropsWithDefault.d.ts +1 -0
- package/dist/types/getProps/index.d.ts +3 -0
- package/dist/types/globalProps/constants.d.ts +3 -0
- package/dist/types/globalProps/getGlobalAttributes.d.ts +6 -0
- package/dist/types/globalProps/globalAttributesPropTypes.d.ts +372 -0
- package/dist/types/globalProps/index.d.ts +3 -0
- package/dist/types/globalProps/useGetGlobalAttributes.d.ts +3 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/propTypes/PropTypes.d.ts +3 -0
- package/dist/types/propTypes/customPropTypes.d.ts +2 -0
- package/dist/types/propTypes/describe.d.ts +3 -0
- package/dist/types/propTypes/describeConversions.d.ts +3 -0
- package/dist/types/propTypes/describeGuards.d.ts +9 -0
- package/dist/types/propTypes/index.d.ts +4 -0
- package/dist/types/propTypes/toTypescript.d.ts +3 -0
- package/dist/types/propTypes/types.d.ts +118 -0
- package/dist/types/propsPerDataTestId/getPropsPerDatatestIdPropTypes.d.ts +39 -0
- package/dist/types/propsPerDataTestId/getPropsPerDatatestid.d.ts +43 -0
- package/dist/types/propsPerDataTestId/index.d.ts +2 -0
- package/dist/types/tests/globalProps/TestComponent.d.ts +1 -0
- package/dist/types/tests/globalProps/globalAttributes.test.d.ts +1 -0
- package/dist/types/tests/propsPerDataTestId/getPropsPerDatatestIdPropTypes.test.d.ts +1 -0
- package/dist/types/tests/propsPerDataTestId/getPropsPerDatatestid.test.d.ts +1 -0
- package/dist/types/tests/validation/any.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/array.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/boolean.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/function.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/isRequiredIf.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/number.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/object.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/objectOf.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/schema.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/string.validation.test.d.ts +1 -0
- package/dist/types/tests/validation/test.schema.d.ts +1 -0
- package/dist/types/tests/validation/union.validation.test.d.ts +1 -0
- package/dist/types/tests/xstyledProps/TestComponent.d.ts +1 -0
- package/dist/types/tests/xstyledProps/xstyledProps.test.d.ts +1 -0
- package/dist/types/useDeprecateComponent/index.d.ts +6 -0
- package/dist/types/validation/errorTemplates.d.ts +2 -0
- package/dist/types/validation/index.d.ts +2 -0
- package/dist/types/validation/typescriptGuards.d.ts +13 -0
- package/dist/types/validation/typescriptParsers.d.ts +1 -0
- package/dist/types/validation/typescriptValidator.d.ts +4 -0
- package/dist/types/xstyledProps/constants.d.ts +7 -0
- package/dist/types/xstyledProps/index.d.ts +2 -0
- package/dist/types/xstyledProps/useGetXstyledProps.d.ts +6 -0
- package/dist/types/xstyledProps/xstyledPropTypes.d.ts +84 -0
- package/package.json +64 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useDeprecateComponent_exports = {};
|
|
30
|
+
__export(useDeprecateComponent_exports, {
|
|
31
|
+
useDeprecateComponent: () => useDeprecateComponent
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useDeprecateComponent_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
const useDeprecateComponent = ({ componentName, version }) => {
|
|
37
|
+
(0, import_react.useEffect)(() => {
|
|
38
|
+
if (true)
|
|
39
|
+
console.error(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);
|
|
40
|
+
}, [componentName, version]);
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/useDeprecateComponent/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n if (process.env.NODE_ENV !== 'production')\n console.error(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA0B;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,8BAAU,MAAM;AACd,QAAI;AACF,cAAQ,MAAM,YAAY,iEAAiE,UAAU;AAAA,EACzG,GAAG,CAAC,eAAe,OAAO,CAAC;AAC7B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var errorTemplates_exports = {};
|
|
30
|
+
__export(errorTemplates_exports, {
|
|
31
|
+
throwRequiredError: () => throwRequiredError,
|
|
32
|
+
throwTypeError: () => throwTypeError
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(errorTemplates_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
const throwTypeError = (componentName, validPropKey, invalidProp, validFormat) => {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`${componentName}:: You are trying to pass a not valid "${validPropKey}" property,
|
|
39
|
+
please provide a valid type.
|
|
40
|
+
|
|
41
|
+
Received: ${invalidProp} (${typeof invalidProp})
|
|
42
|
+
Expected: (${validFormat.replace("\n", " or ")})
|
|
43
|
+
`
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
const throwRequiredError = (componentName, validPropKey) => {
|
|
47
|
+
throw new Error(
|
|
48
|
+
`${componentName}:: Please provide a/an "${validPropKey}" property to use this component.
|
|
49
|
+
This property is required.
|
|
50
|
+
`
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=errorTemplates.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/validation/errorTemplates.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-params */\nexport const throwTypeError = (\n componentName: string,\n validPropKey: string,\n invalidProp: unknown,\n validFormat: string,\n): void => {\n throw new Error(\n `${componentName}:: You are trying to pass a not valid \"${validPropKey}\" property, \n please provide a valid type.\n\n Received: ${invalidProp} (${typeof invalidProp})\n Expected: (${validFormat.replace('\\n', ' or ')})\n `,\n );\n};\n\nexport const throwRequiredError = (componentName: string, validPropKey: string): void => {\n throw new Error(\n `${componentName}:: Please provide a/an \"${validPropKey}\" property to use this component. \n This property is required.\n `,\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADChB,MAAM,iBAAiB,CAC5B,eACA,cACA,aACA,gBACS;AACT,QAAM,IAAI;AAAA,IACR,GAAG,uDAAuD;AAAA;AAAA;AAAA,cAGhD,gBAAgB,OAAO;AAAA,eACtB,YAAY,QAAQ,MAAM,MAAM;AAAA;AAAA,EAE7C;AACF;AAEO,MAAM,qBAAqB,CAAC,eAAuB,iBAA+B;AACvF,QAAM,IAAI;AAAA,IACR,GAAG,wCAAwC;AAAA;AAAA;AAAA,EAG7C;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var validation_exports = {};
|
|
30
|
+
__export(validation_exports, {
|
|
31
|
+
throwRequiredError: () => import_errorTemplates.throwRequiredError,
|
|
32
|
+
throwTypeError: () => import_errorTemplates.throwTypeError,
|
|
33
|
+
useValidateTypescriptPropTypes: () => import_typescriptValidator.useValidateTypescriptPropTypes,
|
|
34
|
+
validateTypescriptPropTypesImplementation: () => import_typescriptValidator.validateTypescriptPropTypesImplementation
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(validation_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_errorTemplates = require("./errorTemplates.js");
|
|
39
|
+
var import_typescriptValidator = require("./typescriptValidator.js");
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/validation/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { throwTypeError, throwRequiredError } from './errorTemplates.js';\nexport { validateTypescriptPropTypesImplementation, useValidateTypescriptPropTypes } from './typescriptValidator.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,4BAAmD;AACnD,iCAA0F;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var typescriptGuards_exports = {};
|
|
30
|
+
__export(typescriptGuards_exports, {
|
|
31
|
+
isArray: () => isArray,
|
|
32
|
+
isFunction: () => isFunction,
|
|
33
|
+
isJSXorNode: () => isJSXorNode,
|
|
34
|
+
isNull: () => isNull,
|
|
35
|
+
isObject: () => isObject,
|
|
36
|
+
isObjectOf: () => isObjectOf,
|
|
37
|
+
isPrimitiveType: () => isPrimitiveType,
|
|
38
|
+
isSomethingWithParenthesis: () => isSomethingWithParenthesis,
|
|
39
|
+
isString: () => isString,
|
|
40
|
+
isUndefined: () => isUndefined,
|
|
41
|
+
isUnion: () => isUnion
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(typescriptGuards_exports);
|
|
44
|
+
var React = __toESM(require("react"));
|
|
45
|
+
const isPrimitiveType = (format) => ["string", "number", "boolean"].includes(format);
|
|
46
|
+
const isUndefined = (format) => format === '"undefined"';
|
|
47
|
+
const isNull = (format) => format === '"null"';
|
|
48
|
+
const isUnion = (format) => {
|
|
49
|
+
let depth = 0;
|
|
50
|
+
let satisfies = false;
|
|
51
|
+
format.split("").forEach((char) => {
|
|
52
|
+
if (["{", "("].includes(char))
|
|
53
|
+
depth += 1;
|
|
54
|
+
else if (["}", ")"].includes(char))
|
|
55
|
+
depth -= 1;
|
|
56
|
+
else if (char === "|" && depth === 0)
|
|
57
|
+
satisfies = true;
|
|
58
|
+
});
|
|
59
|
+
return satisfies;
|
|
60
|
+
};
|
|
61
|
+
const isString = (format) => !isUnion(format) && format[0] === '"' && format.slice(-1) === '"';
|
|
62
|
+
const isArray = (format) => !isUnion(format) && format.slice(-2) === "[]";
|
|
63
|
+
const isObjectOf = (format) => format !== "object" && !isUnion(format) && format.startsWith("{ [key: string]: ");
|
|
64
|
+
const isObject = (format) => format === "object" || !isUnion(format) && format[0] === "{" && format.slice(-1) === "}";
|
|
65
|
+
const isFunction = (format) => {
|
|
66
|
+
if (isUnion(format))
|
|
67
|
+
return false;
|
|
68
|
+
if (!format.startsWith("((") && format.slice(-1) !== ")")
|
|
69
|
+
return false;
|
|
70
|
+
let depth = 0;
|
|
71
|
+
let arrowOccursAtDepth1 = false;
|
|
72
|
+
for (let i = 0; i < format.length; i += 1) {
|
|
73
|
+
const char = format[i];
|
|
74
|
+
if (["{", "("].includes(char))
|
|
75
|
+
depth += 1;
|
|
76
|
+
else if (["}", ")"].includes(char))
|
|
77
|
+
depth -= 1;
|
|
78
|
+
else if (i < format.length - 1 && format.slice(i, i + 2) === "=>") {
|
|
79
|
+
arrowOccursAtDepth1 = arrowOccursAtDepth1 || depth === 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return arrowOccursAtDepth1;
|
|
83
|
+
};
|
|
84
|
+
const isJSXorNode = (format) => !isUnion(format) && ["React.ReactNode", "JSX.Element"].includes(format);
|
|
85
|
+
const isSomethingWithParenthesis = (format) => !isUnion(format) && format[0] === "(" && format.slice(-1) === ")";
|
|
86
|
+
//# sourceMappingURL=typescriptGuards.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/validation/typescriptGuards.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["type GuardFn = (format: string) => boolean;\n\nexport const isPrimitiveType: GuardFn = (format) => ['string', 'number', 'boolean'].includes(format);\nexport const isUndefined: GuardFn = (format) => format === '\"undefined\"';\nexport const isNull: GuardFn = (format) => format === '\"null\"';\nexport const isUnion: GuardFn = (format) => {\n let depth = 0;\n let satisfies = false;\n format.split('').forEach((char) => {\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (char === '|' && depth === 0) satisfies = true;\n });\n return satisfies;\n};\n\nexport const isString: GuardFn = (format) => !isUnion(format) && format[0] === '\"' && format.slice(-1) === '\"';\n\nexport const isArray: GuardFn = (format) => !isUnion(format) && format.slice(-2) === '[]';\n\nexport const isObjectOf: GuardFn = (format) =>\n format !== 'object' && !isUnion(format) && format.startsWith('{ [key: string]: ');\n\nexport const isObject: GuardFn = (format) =>\n format === 'object' || (!isUnion(format) && format[0] === '{' && format.slice(-1) === '}');\n\nexport const isFunction: GuardFn = (format) => {\n // It's isn't an union\n if (isUnion(format)) return false;\n // Has to start with (( and end with )\n if (!format.startsWith('((') && format.slice(-1) !== ')') return false;\n\n // The arrow MUST occur at depth 1 (when couting parenthesis)\n // Otherwise the only possibility is that we have \"something with parenthesis\" (look down below)\n let depth = 0;\n let arrowOccursAtDepth1 = false;\n for (let i = 0; i < format.length; i += 1) {\n const char = format[i];\n if (['{', '('].includes(char)) depth += 1;\n else if (['}', ')'].includes(char)) depth -= 1;\n else if (i < format.length - 1 && format.slice(i, i + 2) === '=>') {\n arrowOccursAtDepth1 = arrowOccursAtDepth1 || depth === 1;\n }\n }\n return arrowOccursAtDepth1;\n};\n\nexport const isJSXorNode: GuardFn = (format) => !isUnion(format) && ['React.ReactNode', 'JSX.Element'].includes(format);\n\nexport const isSomethingWithParenthesis: GuardFn = (format) =>\n !isUnion(format) && format[0] === '(' && format.slice(-1) === ')';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,kBAA2B,CAAC,WAAW,CAAC,UAAU,UAAU,SAAS,EAAE,SAAS,MAAM;AAC5F,MAAM,cAAuB,CAAC,WAAW,WAAW;AACpD,MAAM,SAAkB,CAAC,WAAW,WAAW;AAC/C,MAAM,UAAmB,CAAC,WAAW;AAC1C,MAAI,QAAQ;AACZ,MAAI,YAAY;AAChB,SAAO,MAAM,EAAE,EAAE,QAAQ,CAAC,SAAS;AACjC,QAAI,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aAC/B,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI;AAAG,eAAS;AAAA,aACpC,SAAS,OAAO,UAAU;AAAG,kBAAY;AAAA,EACpD,CAAC;AACD,SAAO;AACT;AAEO,MAAM,WAAoB,C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
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var typescriptParsers_exports = {};
|
|
30
|
+
__export(typescriptParsers_exports, {
|
|
31
|
+
typescriptObjectParser: () => typescriptObjectParser
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(typescriptParsers_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const typescriptObjectParser = (format) => {
|
|
36
|
+
const keyValuePairs = [];
|
|
37
|
+
let lastKey = "";
|
|
38
|
+
let lastValue = "";
|
|
39
|
+
let shouldAppendToKey = true;
|
|
40
|
+
const pushPair = () => {
|
|
41
|
+
if (lastKey)
|
|
42
|
+
keyValuePairs.push([lastKey, lastValue]);
|
|
43
|
+
lastKey = "";
|
|
44
|
+
lastValue = "";
|
|
45
|
+
shouldAppendToKey = true;
|
|
46
|
+
};
|
|
47
|
+
let depth = 0;
|
|
48
|
+
format.split("").forEach((char) => {
|
|
49
|
+
if (char === "{") {
|
|
50
|
+
depth += 1;
|
|
51
|
+
if (depth > 1)
|
|
52
|
+
lastValue += char;
|
|
53
|
+
} else if (char === "}") {
|
|
54
|
+
if (depth > 1)
|
|
55
|
+
lastValue += char;
|
|
56
|
+
depth -= 1;
|
|
57
|
+
if (depth === 1)
|
|
58
|
+
pushPair();
|
|
59
|
+
} else if (char === ":") {
|
|
60
|
+
shouldAppendToKey = false;
|
|
61
|
+
if (depth > 1)
|
|
62
|
+
lastValue += char;
|
|
63
|
+
} else if (char === ",") {
|
|
64
|
+
if (depth === 1)
|
|
65
|
+
pushPair();
|
|
66
|
+
else
|
|
67
|
+
lastValue += char;
|
|
68
|
+
} else if (char === " ") {
|
|
69
|
+
} else if (shouldAppendToKey)
|
|
70
|
+
lastKey += char;
|
|
71
|
+
else
|
|
72
|
+
lastValue += char;
|
|
73
|
+
});
|
|
74
|
+
pushPair();
|
|
75
|
+
return keyValuePairs;
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=typescriptParsers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/validation/typescriptParsers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nexport const typescriptObjectParser = (format: string): [string, string][] => {\n const keyValuePairs: [string, string][] = [];\n\n // State of the algorithm\n let lastKey = '';\n let lastValue = '';\n let shouldAppendToKey = true;\n\n const pushPair = () => {\n if (lastKey) keyValuePairs.push([lastKey, lastValue]);\n lastKey = '';\n lastValue = '';\n shouldAppendToKey = true;\n };\n\n // Complex -- but working -- logic\n let depth = 0;\n format.split('').forEach((char) => {\n if (char === '{') {\n depth += 1;\n if (depth > 1) lastValue += char;\n } else if (char === '}') {\n if (depth > 1) lastValue += char;\n depth -= 1;\n if (depth === 1) pushPair();\n } else if (char === ':') {\n shouldAppendToKey = false;\n if (depth > 1) lastValue += char;\n } else if (char === ',') {\n if (depth === 1) pushPair();\n else lastValue += char;\n } else if (char === ' ') {\n // Do nothing\n } else if (shouldAppendToKey) lastKey += char;\n else lastValue += char;\n });\n pushPair();\n\n return keyValuePairs;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADChB,MAAM,yBAAyB,CAAC,WAAuC;AAC5E,QAAM,gBAAoC,CAAC;AAG3C,MAAI,UAAU;AACd,MAAI,YAAY;AAChB,MAAI,oBAAoB;AAExB,QAAM,WAAW,MAAM;AACrB,QAAI;AAAS,oBAAc,KAAK,CAAC,SAAS,SAAS,CAAC;AACpD,cAAU;AACV,gBAAY;AACZ,wBAAoB;AAAA,EACtB;AAGA,MAAI,QAAQ;AACZ,SAAO,MAAM,EAAE,EAAE,QAAQ,CAAC,SAAS;AACjC,QAAI,SAAS,KAAK;AAChB,eAAS;AACT,UAAI,QAAQ;AAAG,qBAAa;AAAA,IAC9B,WAAW,SAAS,KAAK;AACvB,UAAI,QAAQ;AAAG,qBAAa;AAC5B,eAAS;AACT,UAAI,UAAU;AAAG,iBAAS;AAAA,IAC5B,WAAW,SAAS,KAAK;AACvB,0BAAoB;AACpB,UAAI,QAAQ;AAAG,qBAAa;AAAA,IAC9B,WAAW,SAAS,KAAK;AACvB,UAAI,UAAU;AAAG,iBAAS;AAAA;AACrB,qBAAa;AAAA,IACpB,WAAW,SAAS,KAAK;AAAA,IAEzB,WAAW;AAAmB,iBAAW;AAAA;AACpC,mBAAa;AAAA,EACpB,CAAC;AACD,WAAS;AAET,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var typescriptValidator_exports = {};
|
|
30
|
+
__export(typescriptValidator_exports, {
|
|
31
|
+
useValidateTypescriptPropTypes: () => useValidateTypescriptPropTypes,
|
|
32
|
+
validateTypescriptPropTypesImplementation: () => validateTypescriptPropTypesImplementation
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(typescriptValidator_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_propTypes = require("../propTypes/index.js");
|
|
38
|
+
var import_errorTemplates = require("./errorTemplates.js");
|
|
39
|
+
var import_typescriptGuards = require("./typescriptGuards.js");
|
|
40
|
+
var import_typescriptParsers = require("./typescriptParsers.js");
|
|
41
|
+
const validateUndefined = (schemaName, key, value, format) => {
|
|
42
|
+
if (value !== void 0 || value === "undefined") {
|
|
43
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const validateNull = (schemaName, key, value, format) => {
|
|
47
|
+
if (value !== null || value === "null") {
|
|
48
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const validatePrimitiveType = (schemaName, key, value, format) => {
|
|
52
|
+
if (typeof value !== format) {
|
|
53
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const validateString = (schemaName, key, value, format) => {
|
|
57
|
+
if (value !== format.slice(1, -1)) {
|
|
58
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const validateArray = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {
|
|
62
|
+
if (!Array.isArray(value)) {
|
|
63
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
64
|
+
}
|
|
65
|
+
value.forEach((val, index) => {
|
|
66
|
+
validateValueWithFormat(
|
|
67
|
+
schemaName,
|
|
68
|
+
`${key}[${index}]`,
|
|
69
|
+
val,
|
|
70
|
+
format.slice(0, -2),
|
|
71
|
+
validationsMemo,
|
|
72
|
+
nextValidationsMemo
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
function isObjectType(value) {
|
|
77
|
+
return !(typeof value !== "object" || Array.isArray(value));
|
|
78
|
+
}
|
|
79
|
+
const validateObjectOf = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {
|
|
80
|
+
const valuesIsObject = isObjectType(value);
|
|
81
|
+
if (!valuesIsObject) {
|
|
82
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const valuesFormat = format.slice("{ [key: string]: ".length, -2);
|
|
86
|
+
Object.keys(value).forEach((objectKey) => {
|
|
87
|
+
validateValueWithFormat(
|
|
88
|
+
schemaName,
|
|
89
|
+
`${key}[${objectKey}]`,
|
|
90
|
+
value[objectKey],
|
|
91
|
+
valuesFormat,
|
|
92
|
+
validationsMemo,
|
|
93
|
+
nextValidationsMemo
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const validateObject = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {
|
|
98
|
+
const valuesIsObject = isObjectType(value);
|
|
99
|
+
if (!valuesIsObject) {
|
|
100
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (format === "object")
|
|
104
|
+
return;
|
|
105
|
+
const keyValuePairs = (0, import_typescriptParsers.typescriptObjectParser)(format);
|
|
106
|
+
keyValuePairs.forEach(([objectKey, objectValue]) => {
|
|
107
|
+
const trueKey = objectKey.slice(-1) === "?" ? objectKey.slice(0, -1) : objectKey;
|
|
108
|
+
if (trueKey === objectKey && !(trueKey in value)) {
|
|
109
|
+
(0, import_errorTemplates.throwRequiredError)(schemaName, key);
|
|
110
|
+
}
|
|
111
|
+
if (trueKey in value) {
|
|
112
|
+
validateValueWithFormat(
|
|
113
|
+
schemaName,
|
|
114
|
+
`${key}[${trueKey}]`,
|
|
115
|
+
value[trueKey],
|
|
116
|
+
objectValue,
|
|
117
|
+
validationsMemo,
|
|
118
|
+
nextValidationsMemo
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const validateUnion = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {
|
|
124
|
+
const possibilities = format.split(/\s?\|\s?/);
|
|
125
|
+
const errors = [];
|
|
126
|
+
possibilities.forEach((possibility) => {
|
|
127
|
+
try {
|
|
128
|
+
validateValueWithFormat(schemaName, key, value, possibility, validationsMemo, nextValidationsMemo);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
errors.push(e);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
if (errors.length === possibilities.length) {
|
|
134
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const validateFunction = (schemaName, key, value, format) => {
|
|
138
|
+
if (typeof value !== "function") {
|
|
139
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
function isJSXElement(value) {
|
|
143
|
+
return value === null || typeof value === "object" && value !== null && "$$typeof" in value;
|
|
144
|
+
}
|
|
145
|
+
const validateJSXorNode = (schemaName, key, value, format) => {
|
|
146
|
+
const valueIsJSX = isJSXElement(value);
|
|
147
|
+
if (format === "JSX.Element" && !valueIsJSX) {
|
|
148
|
+
(0, import_errorTemplates.throwTypeError)(schemaName, key, value, format);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const validateValueWithFormat = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {
|
|
152
|
+
nextValidationsMemo[value] = format;
|
|
153
|
+
if (value in validationsMemo) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if ((0, import_typescriptGuards.isUndefined)(format)) {
|
|
157
|
+
validateUndefined(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
158
|
+
} else if ((0, import_typescriptGuards.isNull)(format)) {
|
|
159
|
+
validateNull(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
160
|
+
} else if ((0, import_typescriptGuards.isPrimitiveType)(format)) {
|
|
161
|
+
validatePrimitiveType(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
162
|
+
} else if ((0, import_typescriptGuards.isUnion)(format)) {
|
|
163
|
+
validateUnion(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
164
|
+
} else if ((0, import_typescriptGuards.isString)(format)) {
|
|
165
|
+
validateString(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
166
|
+
} else if ((0, import_typescriptGuards.isArray)(format)) {
|
|
167
|
+
validateArray(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
168
|
+
} else if ((0, import_typescriptGuards.isObjectOf)(format)) {
|
|
169
|
+
validateObjectOf(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
170
|
+
} else if ((0, import_typescriptGuards.isObject)(format)) {
|
|
171
|
+
validateObject(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
172
|
+
} else if ((0, import_typescriptGuards.isFunction)(format)) {
|
|
173
|
+
validateFunction(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
174
|
+
} else if ((0, import_typescriptGuards.isJSXorNode)(format)) {
|
|
175
|
+
validateJSXorNode(schemaName, key, value, format, validationsMemo, nextValidationsMemo);
|
|
176
|
+
} else if ((0, import_typescriptGuards.isSomethingWithParenthesis)(format)) {
|
|
177
|
+
validateValueWithFormat(schemaName, key, value, format.slice(1, -1), validationsMemo, nextValidationsMemo);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const validateTypescriptPropTypesImplementation = (props, schema, validationsMemo = {}, nextValidationsMemo = {}) => {
|
|
181
|
+
const { properties, name: schemaName } = schema;
|
|
182
|
+
properties.forEach((property) => {
|
|
183
|
+
const { name, format, required, isRequiredIf, omitValidation } = property;
|
|
184
|
+
const requiredConditionally = isRequiredIf && isRequiredIf(props);
|
|
185
|
+
if (omitValidation) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (required && !(name in props)) {
|
|
189
|
+
(0, import_errorTemplates.throwRequiredError)(schema.name, name);
|
|
190
|
+
}
|
|
191
|
+
if (requiredConditionally && !(name in props)) {
|
|
192
|
+
(0, import_errorTemplates.throwRequiredError)(schema.name, name);
|
|
193
|
+
}
|
|
194
|
+
const shouldValidateProperty = props[name] !== void 0 || required || requiredConditionally;
|
|
195
|
+
if (name in props && format && shouldValidateProperty) {
|
|
196
|
+
validateValueWithFormat(schemaName, name, props[name], format, validationsMemo, nextValidationsMemo);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
const useValidateTypescriptPropTypes = (props, propTypes, componentDisplayName) => {
|
|
201
|
+
if (!Boolean(componentDisplayName)) {
|
|
202
|
+
throw new Error("Provide display name for the component to use for validation");
|
|
203
|
+
}
|
|
204
|
+
const validationsMemo = (0, import_react.useRef)({});
|
|
205
|
+
const typescriptSchema = (0, import_react.useMemo)(() => {
|
|
206
|
+
const Component = () => {
|
|
207
|
+
};
|
|
208
|
+
const DescribedComponent = (0, import_propTypes.describe)(Component);
|
|
209
|
+
DescribedComponent.propTypes = propTypes;
|
|
210
|
+
DescribedComponent.displayName = componentDisplayName;
|
|
211
|
+
return DescribedComponent.toTypescript();
|
|
212
|
+
}, [propTypes]);
|
|
213
|
+
(0, import_react.useMemo)(() => {
|
|
214
|
+
const nextValidationsMemo = {};
|
|
215
|
+
validateTypescriptPropTypesImplementation(props, typescriptSchema, validationsMemo.current, nextValidationsMemo);
|
|
216
|
+
validationsMemo.current = nextValidationsMemo;
|
|
217
|
+
return "WE DONT NEED RETURN just the memo";
|
|
218
|
+
}, [props]);
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=typescriptValidator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/validation/typescriptValidator.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable max-params */\nimport type { PropsWithChildren, WeakValidationMap } from 'react';\nimport { useMemo, useRef } from 'react';\nimport type { TypescriptDocumentation } from '../propTypes/types.js';\nimport { describe } from '../propTypes/index.js';\nimport { throwRequiredError, throwTypeError } from './errorTemplates.js';\nimport {\n isArray,\n isFunction,\n isJSXorNode,\n isObject,\n isPrimitiveType,\n isSomethingWithParenthesis,\n isString,\n isUnion,\n isUndefined,\n isNull,\n isObjectOf,\n} from './typescriptGuards.js';\nimport { typescriptObjectParser } from './typescriptParsers.js';\n\ntype ValidatorFn = (\n schemaName: string,\n key: string,\n value: unknown,\n format: string,\n validationsMemo: Record<symbol, string>,\n nextValidationsMemo: Record<symbol, string>,\n) => void;\n\n// =============================================================================\n// Atom Validators\n// =============================================================================\n\n// This functions will validate something from the data\n// and optionally recursively apply `validateValueWithFormat`\n// in smaller parts\n\nconst validateUndefined: ValidatorFn = (schemaName, key, value, format) => {\n if (value !== undefined || value === 'undefined') {\n throwTypeError(schemaName, key, value, format);\n }\n};\nconst validateNull: ValidatorFn = (schemaName, key, value, format) => {\n if (value !== null || value === 'null') {\n throwTypeError(schemaName, key, value, format);\n }\n};\nconst validatePrimitiveType: ValidatorFn = (schemaName, key, value, format) => {\n if (typeof value !== format) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nconst validateString: ValidatorFn = (schemaName, key, value, format) => {\n if (value !== format.slice(1, -1)) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nconst validateArray: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n // Check that we have an array\n if (!Array.isArray(value)) {\n throwTypeError(schemaName, key, value, format);\n }\n\n // Check that each element inside satisfies the format\n (value as unknown[]).forEach((val, index) => {\n // this is a recursive func, we need to invoke it before it's defined.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n validateValueWithFormat(\n schemaName,\n `${key}[${index}]`,\n val,\n format.slice(0, -2),\n validationsMemo,\n nextValidationsMemo,\n );\n });\n};\nfunction isObjectType(value: unknown): value is Record<string, unknown> {\n return !(typeof value !== 'object' || Array.isArray(value));\n}\n\nconst validateObjectOf: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n const valuesIsObject = isObjectType(value);\n // Check that we have an object\n if (!valuesIsObject) {\n throwTypeError(schemaName, key, value, format);\n return;\n }\n\n const valuesFormat = format.slice('{ [key: string]: '.length, -2);\n\n Object.keys(value).forEach((objectKey) => {\n // this is a recursive func, we need to invoke it before it's defined.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n validateValueWithFormat(\n schemaName,\n `${key}[${objectKey}]`,\n value[objectKey],\n valuesFormat,\n validationsMemo,\n nextValidationsMemo,\n );\n });\n};\n\nconst validateObject: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n const valuesIsObject = isObjectType(value);\n // Check that we have an object\n if (!valuesIsObject) {\n throwTypeError(schemaName, key, value, format);\n return;\n }\n\n if (format === 'object') return;\n\n const keyValuePairs = typescriptObjectParser(format);\n // Now we have the key - value pairs\n // Each key could either be required or not\n // Just recursively check the object\n\n keyValuePairs.forEach(([objectKey, objectValue]) => {\n const trueKey = objectKey.slice(-1) === '?' ? objectKey.slice(0, -1) : objectKey;\n\n if (trueKey === objectKey && !(trueKey in value)) {\n throwRequiredError(schemaName, key);\n }\n\n if (trueKey in value) {\n // this is a recursive func, we need to invoke it before it's defined.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n validateValueWithFormat(\n schemaName,\n `${key}[${trueKey}]`,\n value[trueKey],\n objectValue,\n validationsMemo,\n nextValidationsMemo,\n );\n }\n });\n};\n\nconst validateUnion: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n const possibilities = format.split(/\\s?\\|\\s?/);\n\n const errors = [];\n\n possibilities.forEach((possibility) => {\n try {\n // this is a recursive func, we need to invoke it before it's defined.\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n validateValueWithFormat(schemaName, key, value, possibility, validationsMemo, nextValidationsMemo);\n } catch (e) {\n errors.push(e);\n }\n });\n\n if (errors.length === possibilities.length) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nconst validateFunction: ValidatorFn = (schemaName, key, value, format) => {\n // Check that we have a function\n if (typeof value !== 'function') {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\nfunction isJSXElement(value: unknown): value is JSX.Element {\n return value === null || (typeof value === 'object' && value !== null && '$$typeof' in value);\n}\nconst validateJSXorNode: ValidatorFn = (schemaName, key, value, format) => {\n const valueIsJSX = isJSXElement(value);\n if (format === 'JSX.Element' && !valueIsJSX) {\n throwTypeError(schemaName, key, value, format);\n }\n};\n\n// =============================================================================\n// Schema validator\n// =============================================================================\n\nconst validateValueWithFormat: ValidatorFn = (schemaName, key, value, format, validationsMemo, nextValidationsMemo) => {\n nextValidationsMemo[value as symbol] = format;\n\n if ((value as symbol) in validationsMemo) {\n // We already validated this value on this format\n return;\n }\n\n if (isUndefined(format)) {\n validateUndefined(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isNull(format)) {\n validateNull(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isPrimitiveType(format)) {\n validatePrimitiveType(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isUnion(format)) {\n validateUnion(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isString(format)) {\n validateString(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isArray(format)) {\n validateArray(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isObjectOf(format)) {\n validateObjectOf(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isObject(format)) {\n validateObject(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isFunction(format)) {\n validateFunction(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isJSXorNode(format)) {\n validateJSXorNode(schemaName, key, value, format, validationsMemo, nextValidationsMemo);\n } else if (isSomethingWithParenthesis(format)) {\n validateValueWithFormat(schemaName, key, value, format.slice(1, -1), validationsMemo, nextValidationsMemo);\n }\n};\n\nexport const validateTypescriptPropTypesImplementation = (\n props: PropsWithChildren<Record<string, unknown>>,\n schema: TypescriptDocumentation,\n validationsMemo: Record<string, string> = {},\n nextValidationsMemo: Record<string, string> = {},\n): void => {\n const { properties, name: schemaName } = schema;\n\n properties.forEach((property) => {\n const { name, format, required, isRequiredIf, omitValidation } = property;\n\n const requiredConditionally = isRequiredIf && isRequiredIf(props);\n\n if (omitValidation) {\n return;\n }\n\n if (required && !(name in props)) {\n throwRequiredError(schema.name, name);\n }\n\n if (requiredConditionally && !(name in props)) {\n throwRequiredError(schema.name, name);\n }\n\n const shouldValidateProperty = props[name] !== undefined || required || requiredConditionally;\n\n if (name in props && format && shouldValidateProperty) {\n validateValueWithFormat(schemaName, name, props[name], format, validationsMemo, nextValidationsMemo);\n }\n });\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const useValidateTypescriptPropTypes = <T = Record<string, any>>(\n props: PropsWithChildren<T>,\n propTypes: WeakValidationMap<unknown>,\n componentDisplayName: string,\n): void => {\n if (!Boolean(componentDisplayName)) {\n throw new Error('Provide display name for the component to use for validation');\n }\n\n const validationsMemo = useRef<Record<string, string>>({});\n\n const typescriptSchema = useMemo(() => {\n const Component = () => {};\n\n const DescribedComponent = describe(Component);\n DescribedComponent.propTypes = propTypes;\n DescribedComponent.displayName = componentDisplayName;\n return DescribedComponent.toTypescript();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [propTypes]);\n\n useMemo(() => {\n const nextValidationsMemo = {};\n\n validateTypescriptPropTypesImplementation(props, typescriptSchema, validationsMemo.current, nextValidationsMemo);\n validationsMemo.current = nextValidationsMemo;\n return 'WE DONT NEED RETURN just the memo';\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAAgC;AAEhC,uBAAyB;AACzB,4BAAmD;AACnD,8BAYO;AACP,+BAAuC;AAmBvC,MAAM,oBAAiC,CAAC,YAAY,KAAK,OAAO,WAAW;AACzE,MAAI,UAAU,UAAa,UAAU,aAAa;AAChD,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AACF;AACA,MAAM,eAA4B,CAAC,YAAY,KAAK,OAAO,WAAW;AACpE,MAAI,UAAU,QAAQ,UAAU,QAAQ;AACtC,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AACF;AACA,MAAM,wBAAqC,CAAC,YAAY,KAAK,OAAO,WAAW;AAC7E,MAAI,OAAO,UAAU,QAAQ;AAC3B,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AACF;AAEA,MAAM,iBAA8B,CAAC,YAAY,KAAK,OAAO,WAAW;AACtE,MAAI,UAAU,OAAO,MAAM,GAAG,EAAE,GAAG;AACjC,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AACF;AAEA,MAAM,gBAA6B,CAAC,YAAY,KAAK,OAAO,QAAQ,iBAAiB,wBAAwB;AAE3G,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AACzB,8CAAe,YAAY,KAAK,OAAO,MAAM;AAAA,EAC/C;AAGA,EAAC,MAAoB,QAAQ,CAAC,KAAK,UAAU;AAG3C;AAAA,MACE;AAAA,MACA,GAAG,OAAO;AAAA,MACV;AAAA,MAC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