@clementine-solutions/jane-io 1.0.6 → 1.0.8
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/core/fluent-registry.d.ts +53 -0
- package/dist/core/fluent-registry.js +67 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +22 -0
- package/package.json +1 -1
|
@@ -135,4 +135,57 @@ export declare const janeRegistry: {
|
|
|
135
135
|
readonly duration: import("./shapes").ParseRule<unknown>;
|
|
136
136
|
readonly scientific: import("./shapes").ParseRule<unknown>;
|
|
137
137
|
};
|
|
138
|
+
readonly normalizers: {
|
|
139
|
+
readonly collapseWhitespace: import("./shapes").NormalizationRule<unknown>;
|
|
140
|
+
readonly compactSparseArray: import("./shapes").NormalizationRule<unknown>;
|
|
141
|
+
readonly emptyToUndefined: import("./shapes").NormalizationRule<unknown>;
|
|
142
|
+
readonly flattenOneLevel: import("./shapes").NormalizationRule<unknown>;
|
|
143
|
+
readonly infinityToUndefined: import("./shapes").NormalizationRule<unknown>;
|
|
144
|
+
readonly invalidDateToUndefined: import("./shapes").NormalizationRule<unknown>;
|
|
145
|
+
readonly nanToUndefined: import("./shapes").NormalizationRule<unknown>;
|
|
146
|
+
readonly normalizeNegativeZero: import("./shapes").NormalizationRule<unknown>;
|
|
147
|
+
readonly removeEmptyArrayKeys: import("./shapes").NormalizationRule<unknown>;
|
|
148
|
+
readonly removeEmptyObjectKeys: import("./shapes").NormalizationRule<unknown>;
|
|
149
|
+
readonly removeEmptyStringItems: import("./shapes").NormalizationRule<unknown>;
|
|
150
|
+
readonly removeEmptyStringKeys: import("./shapes").NormalizationRule<unknown>;
|
|
151
|
+
readonly removeNullItems: import("./shapes").NormalizationRule<unknown>;
|
|
152
|
+
readonly removeNullKeys: import("./shapes").NormalizationRule<unknown>;
|
|
153
|
+
readonly removeUndefinedItems: import("./shapes").NormalizationRule<unknown>;
|
|
154
|
+
readonly removeUndefinedKeys: import("./shapes").NormalizationRule<unknown>;
|
|
155
|
+
readonly trim: import("./shapes").NormalizationRule<unknown>;
|
|
156
|
+
};
|
|
157
|
+
readonly scanners: {
|
|
158
|
+
readonly arrayIsDeep: import("./shapes").ScanRule;
|
|
159
|
+
readonly arrayIsHeterogeneous: import("./shapes").ScanRule;
|
|
160
|
+
readonly arrayIsLarge: import("./shapes").ScanRule;
|
|
161
|
+
readonly bigintIsLarge: import("./shapes").ScanRule;
|
|
162
|
+
readonly bigintNotSafe: import("./shapes").ScanRule;
|
|
163
|
+
readonly dateIsBeforeEpoch: import("./shapes").ScanRule;
|
|
164
|
+
readonly dateIsFarFuture: import("./shapes").ScanRule;
|
|
165
|
+
readonly dateIsInvalid: import("./shapes").ScanRule;
|
|
166
|
+
readonly numberIsInfinite: import("./shapes").ScanRule;
|
|
167
|
+
readonly numberIsNaN: import("./shapes").ScanRule;
|
|
168
|
+
readonly numberIsTooLarge: import("./shapes").ScanRule;
|
|
169
|
+
readonly numberIsUnsafeInteger: import("./shapes").ScanRule;
|
|
170
|
+
readonly objectHasCircularReferences: import("./shapes").ScanRule;
|
|
171
|
+
readonly objectHasManyKeys: import("./shapes").ScanRule;
|
|
172
|
+
readonly objectIsDeep: import("./shapes").ScanRule;
|
|
173
|
+
readonly scanForSentinels: import("./shapes").ScanRule;
|
|
174
|
+
readonly stringHasUnsafeUnicode: import("./shapes").ScanRule;
|
|
175
|
+
readonly stringHasWhitespaceEdges: import("./shapes").ScanRule;
|
|
176
|
+
readonly stringIsLong: import("./shapes").ScanRule;
|
|
177
|
+
readonly unknownNotScannable: import("./shapes").ScanRule;
|
|
178
|
+
};
|
|
179
|
+
readonly policies: {
|
|
180
|
+
readonly default: import("./shapes").Policy;
|
|
181
|
+
readonly lax: import("./shapes").Policy;
|
|
182
|
+
readonly strict: import("./shapes").Policy;
|
|
183
|
+
readonly boundaryDefault: import("./shapes").BoundaryDecideConfig;
|
|
184
|
+
readonly boundaryLax: import("./shapes").BoundaryDecideConfig;
|
|
185
|
+
readonly boundaryStrict: import("./shapes").BoundaryDecideConfig;
|
|
186
|
+
};
|
|
187
|
+
readonly registries: {
|
|
188
|
+
readonly normalizationRuleRegistry: Record<import("./shapes").StructuralType, readonly import("./shapes").NormalizationRule[]>;
|
|
189
|
+
readonly scanRuleRegistry: import("./shapes").ScanRuleSet;
|
|
190
|
+
};
|
|
138
191
|
};
|
|
@@ -14,6 +14,20 @@ import { parseArrayString, parseBigIntString, parseBinaryString, parseBooleanStr
|
|
|
14
14
|
import { parseIntegerString } from './parsers/parse-integer-string';
|
|
15
15
|
import { parseScientificNotationString } from './parsers/parse-scientific-notation-string';
|
|
16
16
|
/* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
|
|
17
|
+
||* Normalizers *|
|
|
18
|
+
\* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
|
|
19
|
+
import { collapseWhitespace, compactSparseArray, emptyToUndefined, flattenOneLevel, infinityToUndefined, invalidDateToUndefined, nanToUndefined, normalizeNegativeZero, removeEmptyArrayKeys, removeEmptyObjectKeys, removeEmptyStringItems, removeEmptyStringKeys, removeNullItems, removeNullKeys, removeUndefinedItems, removeUndefinedKeys, trim, } from './normalizers';
|
|
20
|
+
import { normalizationRuleRegistry } from './normalizers';
|
|
21
|
+
/* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
|
|
22
|
+
||* Scanners *|
|
|
23
|
+
\* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
|
|
24
|
+
import { arrayIsDeep, arrayIsHeterogeneous, arrayIsLarge, bigintIsLarge, bigintNotSafe, dateIsBeforeEpoch, dateIsFarFuture, dateIsInvalid, numberIsInfinite, numberIsNaN, numberIsTooLarge, numberIsUnsafeInteger, objectHasCircularReferences, objectHasManyKeys, objectIsDeep, scanForSentinels, stringHasUnsafeUnicode, stringHasWhitespaceEdges, stringIsLong, unknownNotScannable, } from './scanners';
|
|
25
|
+
import { scanRuleRegistry } from './scanners';
|
|
26
|
+
/* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
|
|
27
|
+
||* Policies *|
|
|
28
|
+
\* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
|
|
29
|
+
import { boundaryPolicyDefault, boundaryPolicyLax, boundaryPolicyStrict, defaultPolicy, laxPolicy, strictPolicy, } from './common/policy';
|
|
30
|
+
/* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
|
|
17
31
|
|* Validators *|
|
|
18
32
|
\* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
|
|
19
33
|
import { alpha, alphaNum, array, arrayMaxItems, arrayMinItems, beforeEpoch, bigint, bigintEquals, bigintMax, bigintMin, bigintNegative, bigintNonNegative, bigintNonPositive, bigintPositive, bigintSafe, boolean, charsEqual, dateNowRequired, deepEquals, endsWith, excludes, finite, hasKey, hasUniqueItems, hasValue, includes, integer, isAscii, isCountryCode, isCurrencyCode, isDate, isEmail, isEmailStrict, isFalse, isFarFuture, isFuture, isIp, isNull, isNullOrUndefined, isPast, isPhone, isPhoneStrict, isPort, isPostalCode, isPrintable, isTrue, isUndefined, isUrl, isUuid, itemsEqual, keysEqual, lessThan, matches, max, maxLength, maxKeys, min, minLength, minKeys, missingKey, moreThan, negative, noEmptyArrayValues, noEmptyObjectValues, noEmptyStringItems, noNullItems, noNullValues, noUndefinedItems, noUndefinedValues, nonEmptyArray, nonEmptyObject, noLeadSpace, noRepeatSpace, noSpace, noTrailSpace, nonNegative, nonPositive, notAfter, notBefore, nonEmpty, notOneOf, notSparse, number, numString, oneOf, onlyKeys, plainObject, positive, safeInteger, sameDay, sameMonth, sameYear, startsWith, string, tooEarly, tooLate, trimmed, weekday, weekend, } from './validators';
|
|
@@ -148,4 +162,57 @@ export const janeRegistry = {
|
|
|
148
162
|
duration: parseDurationString,
|
|
149
163
|
scientific: parseScientificNotationString,
|
|
150
164
|
},
|
|
165
|
+
normalizers: {
|
|
166
|
+
collapseWhitespace,
|
|
167
|
+
compactSparseArray,
|
|
168
|
+
emptyToUndefined,
|
|
169
|
+
flattenOneLevel,
|
|
170
|
+
infinityToUndefined,
|
|
171
|
+
invalidDateToUndefined,
|
|
172
|
+
nanToUndefined,
|
|
173
|
+
normalizeNegativeZero,
|
|
174
|
+
removeEmptyArrayKeys,
|
|
175
|
+
removeEmptyObjectKeys,
|
|
176
|
+
removeEmptyStringItems,
|
|
177
|
+
removeEmptyStringKeys,
|
|
178
|
+
removeNullItems,
|
|
179
|
+
removeNullKeys,
|
|
180
|
+
removeUndefinedItems,
|
|
181
|
+
removeUndefinedKeys,
|
|
182
|
+
trim,
|
|
183
|
+
},
|
|
184
|
+
scanners: {
|
|
185
|
+
arrayIsDeep,
|
|
186
|
+
arrayIsHeterogeneous,
|
|
187
|
+
arrayIsLarge,
|
|
188
|
+
bigintIsLarge,
|
|
189
|
+
bigintNotSafe,
|
|
190
|
+
dateIsBeforeEpoch,
|
|
191
|
+
dateIsFarFuture,
|
|
192
|
+
dateIsInvalid,
|
|
193
|
+
numberIsInfinite,
|
|
194
|
+
numberIsNaN,
|
|
195
|
+
numberIsTooLarge,
|
|
196
|
+
numberIsUnsafeInteger,
|
|
197
|
+
objectHasCircularReferences,
|
|
198
|
+
objectHasManyKeys,
|
|
199
|
+
objectIsDeep,
|
|
200
|
+
scanForSentinels,
|
|
201
|
+
stringHasUnsafeUnicode,
|
|
202
|
+
stringHasWhitespaceEdges,
|
|
203
|
+
stringIsLong,
|
|
204
|
+
unknownNotScannable,
|
|
205
|
+
},
|
|
206
|
+
policies: {
|
|
207
|
+
default: defaultPolicy,
|
|
208
|
+
lax: laxPolicy,
|
|
209
|
+
strict: strictPolicy,
|
|
210
|
+
boundaryDefault: boundaryPolicyDefault,
|
|
211
|
+
boundaryLax: boundaryPolicyLax,
|
|
212
|
+
boundaryStrict: boundaryPolicyStrict,
|
|
213
|
+
},
|
|
214
|
+
registries: {
|
|
215
|
+
normalizationRuleRegistry,
|
|
216
|
+
scanRuleRegistry,
|
|
217
|
+
},
|
|
151
218
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
* @see https://jane-io.com
|
|
9
9
|
* ----------------------------------------------------------------------------
|
|
10
10
|
*/
|
|
11
|
+
import { janeRegistry } from './core/fluent-registry.js';
|
|
12
|
+
export * from './core/validators/index.js';
|
|
13
|
+
export * from './core/parsers/index.js';
|
|
14
|
+
export * from './core/normalizers/index.js';
|
|
15
|
+
export * from './core/scanners/index.js';
|
|
16
|
+
export * from './core/boundary-rules/index.js';
|
|
17
|
+
export * from './core/analysis/index.js';
|
|
18
|
+
export * from './core/common/index.js';
|
|
19
|
+
export * from './core/pipeline/index.js';
|
|
11
20
|
/**
|
|
12
21
|
* The default Jane instance configured with the library’s built‑in policy.
|
|
13
22
|
*
|
|
@@ -81,3 +90,13 @@ export declare const jane: {
|
|
|
81
90
|
};
|
|
82
91
|
}>;
|
|
83
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* Central registry of all built‑in Jane validators, parsers, normalizers,
|
|
95
|
+
* scanners, and policies.
|
|
96
|
+
*
|
|
97
|
+
* This object provides a single, authoritative lookup table for every
|
|
98
|
+
* first‑party rule Jane ships with. Access individual components through
|
|
99
|
+
* the organized namespaces: validators, parsers, normalizers, scanners,
|
|
100
|
+
* policies, and registries.
|
|
101
|
+
*/
|
|
102
|
+
export { janeRegistry };
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
\* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
|
|
14
14
|
import { createJane } from './core/common/index.js';
|
|
15
15
|
import { defaultPolicy } from './core/common/policy.js';
|
|
16
|
+
import { janeRegistry } from './core/fluent-registry.js';
|
|
17
|
+
/* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
|
|
18
|
+
|* Core Modules *|
|
|
19
|
+
\* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
|
|
20
|
+
export * from './core/validators/index.js';
|
|
21
|
+
export * from './core/parsers/index.js';
|
|
22
|
+
export * from './core/normalizers/index.js';
|
|
23
|
+
export * from './core/scanners/index.js';
|
|
24
|
+
export * from './core/boundary-rules/index.js';
|
|
25
|
+
export * from './core/analysis/index.js';
|
|
26
|
+
export * from './core/common/index.js';
|
|
27
|
+
export * from './core/pipeline/index.js';
|
|
16
28
|
/* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
|
|
17
29
|
|* Jane *|
|
|
18
30
|
\* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
|
|
@@ -24,3 +36,13 @@ import { defaultPolicy } from './core/common/policy.js';
|
|
|
24
36
|
* policy configuration.
|
|
25
37
|
*/
|
|
26
38
|
export const jane = createJane(defaultPolicy);
|
|
39
|
+
/**
|
|
40
|
+
* Central registry of all built‑in Jane validators, parsers, normalizers,
|
|
41
|
+
* scanners, and policies.
|
|
42
|
+
*
|
|
43
|
+
* This object provides a single, authoritative lookup table for every
|
|
44
|
+
* first‑party rule Jane ships with. Access individual components through
|
|
45
|
+
* the organized namespaces: validators, parsers, normalizers, scanners,
|
|
46
|
+
* policies, and registries.
|
|
47
|
+
*/
|
|
48
|
+
export { janeRegistry };
|
package/package.json
CHANGED