n4s 5.0.0-dev-781e21 → 5.0.0-dev-ec989a
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/README.md +2 -0
- package/dist/cjs/compose.development.js +9 -13
- package/dist/cjs/compose.production.js +1 -1
- package/dist/cjs/compounds.development.js +16 -32
- package/dist/cjs/compounds.production.js +1 -1
- package/dist/cjs/n4s.development.js +137 -213
- package/dist/cjs/n4s.production.js +1 -1
- package/dist/cjs/schema.development.js +13 -22
- package/dist/cjs/schema.production.js +1 -1
- package/dist/es/compose.development.js +11 -15
- package/dist/es/compose.production.js +1 -1
- package/dist/es/compounds.development.js +16 -32
- package/dist/es/compounds.production.js +1 -1
- package/dist/es/n4s.development.js +158 -232
- package/dist/es/n4s.production.js +1 -1
- package/dist/es/schema.development.js +13 -20
- package/dist/es/schema.production.js +1 -1
- package/dist/umd/compose.development.js +12 -16
- package/dist/umd/compose.production.js +1 -1
- package/dist/umd/compounds.development.js +19 -35
- package/dist/umd/compounds.production.js +1 -1
- package/dist/umd/n4s.development.js +140 -216
- package/dist/umd/n4s.production.js +1 -1
- package/dist/umd/schema.development.js +16 -25
- package/dist/umd/schema.production.js +1 -1
- package/package.json +62 -55
- package/testUtils/TEnforceMock.ts +3 -0
- package/types/compose.d.ts +17 -21
- package/types/compose.d.ts.map +1 -0
- package/types/compounds.d.ts +17 -22
- package/types/compounds.d.ts.map +1 -0
- package/types/n4s.d.ts +22 -22
- package/types/n4s.d.ts.map +1 -0
- package/types/schema.d.ts +17 -21
- package/types/schema.d.ts.map +1 -0
- package/tsconfig.json +0 -8
package/types/schema.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
unknown,
|
|
3
|
-
...infer U
|
|
4
|
-
] ? U : never;
|
|
5
|
-
type Stringable = string | ((...args: any[]) => string);
|
|
6
|
-
type CB = (...args: any[]) => any;
|
|
1
|
+
import { CB, DropFirst, Stringable } from "vest-utils";
|
|
7
2
|
type EnforceCustomMatcher<F extends CB, R> = (...args: DropFirst<Parameters<F>>) => R;
|
|
8
3
|
type RuleReturn = boolean | {
|
|
9
4
|
pass: boolean;
|
|
@@ -42,16 +37,16 @@ declare const baseRules: {
|
|
|
42
37
|
doesNotStartWith: (value: string, arg1: string) => boolean;
|
|
43
38
|
endsWith: typeof endsWith;
|
|
44
39
|
equals: typeof equals;
|
|
45
|
-
greaterThan: typeof import("
|
|
40
|
+
greaterThan: typeof import("vest-utils").greaterThan;
|
|
46
41
|
greaterThanOrEquals: typeof greaterThanOrEquals;
|
|
47
|
-
gt: typeof import("
|
|
42
|
+
gt: typeof import("vest-utils").greaterThan;
|
|
48
43
|
gte: typeof greaterThanOrEquals;
|
|
49
44
|
inside: typeof inside;
|
|
50
|
-
isArray: typeof import("
|
|
45
|
+
isArray: typeof import("vest-utils").isArray;
|
|
51
46
|
isBetween: typeof isBetween;
|
|
52
47
|
isBlank: typeof isBlank;
|
|
53
|
-
isBoolean: typeof import("
|
|
54
|
-
isEmpty: typeof import("
|
|
48
|
+
isBoolean: typeof import("vest-utils").isBoolean;
|
|
49
|
+
isEmpty: typeof import("vest-utils").isEmpty;
|
|
55
50
|
isEven: (value: any) => boolean;
|
|
56
51
|
isFalsy: (value: unknown) => boolean;
|
|
57
52
|
isKeyOf: typeof isKeyOf;
|
|
@@ -71,21 +66,21 @@ declare const baseRules: {
|
|
|
71
66
|
isNotString: (v: unknown) => boolean;
|
|
72
67
|
isNotUndefined: (value?: unknown) => boolean;
|
|
73
68
|
isNotValueOf: (value: any, objectToCheck: any) => boolean;
|
|
74
|
-
isNull: typeof import("
|
|
75
|
-
isNullish: typeof import("
|
|
69
|
+
isNull: typeof import("vest-utils").isNull;
|
|
70
|
+
isNullish: typeof import("vest-utils").isNullish;
|
|
76
71
|
isNumber: typeof isNumber;
|
|
77
|
-
isNumeric: typeof import("
|
|
72
|
+
isNumeric: typeof import("vest-utils").isNumeric;
|
|
78
73
|
isOdd: (value: any) => boolean;
|
|
79
|
-
isPositive: typeof import("
|
|
80
|
-
isString: typeof import("
|
|
74
|
+
isPositive: typeof import("vest-utils").isPositive;
|
|
75
|
+
isString: typeof import("vest-utils").isStringValue;
|
|
81
76
|
isTruthy: typeof isTruthy;
|
|
82
|
-
isUndefined: typeof import("
|
|
77
|
+
isUndefined: typeof import("vest-utils").isUndefined;
|
|
83
78
|
isValueOf: typeof isValueOf;
|
|
84
|
-
lengthEquals: typeof import("
|
|
79
|
+
lengthEquals: typeof import("vest-utils").lengthEquals;
|
|
85
80
|
lengthNotEquals: (value: string | unknown[], arg1: string | number) => boolean;
|
|
86
81
|
lessThan: typeof lessThan;
|
|
87
82
|
lessThanOrEquals: typeof lessThanOrEquals;
|
|
88
|
-
longerThan: typeof import("
|
|
83
|
+
longerThan: typeof import("vest-utils").longerThan;
|
|
89
84
|
longerThanOrEquals: typeof longerThanOrEquals;
|
|
90
85
|
lt: typeof lessThan;
|
|
91
86
|
lte: typeof lessThanOrEquals;
|
|
@@ -93,13 +88,13 @@ declare const baseRules: {
|
|
|
93
88
|
notEquals: (value: unknown, arg1: unknown) => boolean;
|
|
94
89
|
notInside: (value: unknown, arg1: string | unknown[]) => boolean;
|
|
95
90
|
notMatches: (value: string, regex: string | RegExp) => boolean;
|
|
96
|
-
numberEquals: typeof import("
|
|
91
|
+
numberEquals: typeof import("vest-utils").numberEquals;
|
|
97
92
|
numberNotEquals: (value: string | number, eq: string | number) => boolean;
|
|
98
93
|
shorterThan: typeof shorterThan;
|
|
99
94
|
shorterThanOrEquals: typeof shorterThanOrEquals;
|
|
100
95
|
startsWith: typeof startsWith;
|
|
101
96
|
};
|
|
102
|
-
type Rules<E
|
|
97
|
+
type Rules<E = Record<string, unknown>> = n4s.EnforceCustomMatchers<Rules<E> & E> & Record<string, (...args: Args) => Rules<E> & E> & {
|
|
103
98
|
[P in KBaseRules]: (...args: DropFirst<Parameters<BaseRules[P]>> | Args) => Rules<E> & E;
|
|
104
99
|
};
|
|
105
100
|
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-empty-interface */
|
|
@@ -142,3 +137,4 @@ declare global {
|
|
|
142
137
|
}
|
|
143
138
|
}
|
|
144
139
|
export { partial };
|
|
140
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/exports/schema.ts","../src/lib/enforceUtilityTypes.ts","../src/runtime/enforceContext.ts","../src/lib/ruleReturn.ts","../src/rules/endsWith.ts","../src/rules/equals.ts","../src/rules/greaterThanOrEquals.ts","../src/rules/inside.ts","../src/rules/lessThan.ts","../src/rules/lessThanOrEquals.ts","../src/rules/isBetween.ts","../src/rules/isBlank.ts","../src/rules/isBoolean.ts","../src/rules/isEven.ts","../src/rules/isKeyOf.ts","../src/rules/isNaN.ts","../src/rules/isNegative.ts","../src/rules/isNumber.ts","../src/rules/isOdd.ts","../src/rules/isString.ts","../src/rules/isTruthy.ts","../src/rules/isValueOf.ts","../src/rules/longerThanOrEquals.ts","../src/rules/matches.ts","../src/rules/ruleCondition.ts","../src/rules/shorterThan.ts","../src/rules/shorterThanOrEquals.ts","../src/rules/startsWith.ts","../src/runtime/rules.ts","../src/runtime/runtimeRules.ts","../src/lib/transformResult.ts","../src/runtime/genEnforceLazy.ts","../src/lib/runLazyRule.ts","../src/plugins/schema/isArrayOf.ts","../src/plugins/schema/schemaTypes.ts","../src/plugins/schema/loose.ts","../src/plugins/schema/optional.ts","../src/plugins/schema/shape.ts","../src/plugins/schema/partial.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,QAAQ,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,qBAAqB,CAAC,CAAC;YAC/B,SAAS,EAAE,oBAAoB,CAAC,OAAO,SAAS,EAAE,CAAC,CAAC,CAAC;YACrD,KAAK,EAAE,oBAAoB,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7C,KAAK,EAAE,oBAAoB,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7C,QAAQ,EAAE,oBAAoB,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC;SACpD;KACF;CACF;AAdD,OAAO,WAAW,CAAgB"}
|