xanv 1.0.5 → 1.0.6
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/XanvType.d.ts +11 -11
- package/XanvType.js +51 -51
- package/XanvType.js.map +1 -1
- package/XanvType.mjs +51 -51
- package/XanvType.mjs.map +1 -1
- package/index.d.ts +14 -13
- package/index.js +14 -14
- package/index.js.map +1 -1
- package/index.mjs +13 -13
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/readme.md +121 -121
- package/types/Any.d.ts +3 -3
- package/types/Any.js +3 -3
- package/types/Any.js.map +1 -1
- package/types/Any.mjs +3 -3
- package/types/Any.mjs.map +1 -1
- package/types/Array.d.ts +9 -9
- package/types/Array.js +82 -82
- package/types/Array.js.map +1 -1
- package/types/Array.mjs +82 -82
- package/types/Array.mjs.map +1 -1
- package/types/Boolean.d.ts +3 -3
- package/types/Boolean.js +6 -6
- package/types/Boolean.js.map +1 -1
- package/types/Boolean.mjs +6 -6
- package/types/Boolean.mjs.map +1 -1
- package/types/Date.d.ts +3 -3
- package/types/Date.js +6 -6
- package/types/Date.js.map +1 -1
- package/types/Date.mjs +6 -6
- package/types/Date.mjs.map +1 -1
- package/types/Enum.d.ts +5 -5
- package/types/Enum.js +16 -16
- package/types/Enum.js.map +1 -1
- package/types/Enum.mjs +16 -16
- package/types/Enum.mjs.map +1 -1
- package/types/File.d.ts +8 -8
- package/types/File.js +49 -49
- package/types/File.js.map +1 -1
- package/types/File.mjs +49 -49
- package/types/File.mjs.map +1 -1
- package/types/Map.d.ts +6 -6
- package/types/Map.js +22 -22
- package/types/Map.js.map +1 -1
- package/types/Map.mjs +22 -22
- package/types/Map.mjs.map +1 -1
- package/types/Number.d.ts +10 -10
- package/types/Number.js +64 -64
- package/types/Number.js.map +1 -1
- package/types/Number.mjs +64 -64
- package/types/Number.mjs.map +1 -1
- package/types/Object.d.ts +5 -5
- package/types/Object.js +25 -25
- package/types/Object.js.map +1 -1
- package/types/Object.mjs +25 -25
- package/types/Object.mjs.map +1 -1
- package/types/Record.d.ts +7 -7
- package/types/Record.js +23 -23
- package/types/Record.js.map +1 -1
- package/types/Record.mjs +23 -23
- package/types/Record.mjs.map +1 -1
- package/types/Set.d.ts +7 -7
- package/types/Set.js +34 -34
- package/types/Set.js.map +1 -1
- package/types/Set.mjs +34 -34
- package/types/Set.mjs.map +1 -1
- package/types/String.d.ts +12 -12
- package/types/String.js +82 -82
- package/types/String.js.map +1 -1
- package/types/String.mjs +82 -82
- package/types/String.mjs.map +1 -1
- package/types/Tuple.d.ts +5 -5
- package/types/Tuple.js +22 -22
- package/types/Tuple.js.map +1 -1
- package/types/Tuple.mjs +22 -22
- package/types/Tuple.mjs.map +1 -1
- package/types/Union.d.ts +5 -5
- package/types/Union.js +27 -27
- package/types/Union.js.map +1 -1
- package/types/Union.mjs +27 -27
- package/types/Union.mjs.map +1 -1
- package/types.d.ts +7 -6
package/XanvType.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { XVCheckCallback, XanvTransformCallback } from './types.js';
|
|
2
2
|
|
|
3
|
-
declare abstract class XanvType<TypeKeys extends string | number | symbol, Default> {
|
|
4
|
-
private checkes;
|
|
5
|
-
meta: Record<string, any>;
|
|
6
|
-
protected abstract check(value: any): any;
|
|
7
|
-
set(key: TypeKeys, check: XVCheckCallback<Default>, args?: any): void;
|
|
8
|
-
get(key: TypeKeys): XVCheckCallback<Default> | undefined;
|
|
9
|
-
optional(): this;
|
|
10
|
-
default(def: Default | (() => Default)): this;
|
|
11
|
-
nullable(): this;
|
|
12
|
-
transform(cb: XanvTransformCallback<any>): this;
|
|
13
|
-
parse(value: any): Default | null;
|
|
3
|
+
declare abstract class XanvType<TypeKeys extends string | number | symbol, Default> {
|
|
4
|
+
private checkes;
|
|
5
|
+
meta: Record<string, any>;
|
|
6
|
+
protected abstract check(value: any): any;
|
|
7
|
+
set(key: TypeKeys, check: XVCheckCallback<Default>, args?: any): void;
|
|
8
|
+
get(key: TypeKeys): XVCheckCallback<Default> | undefined;
|
|
9
|
+
optional(): this;
|
|
10
|
+
default(def: Default | (() => Default)): this;
|
|
11
|
+
nullable(): this;
|
|
12
|
+
transform(cb: XanvTransformCallback<any>): this;
|
|
13
|
+
parse(value: any): Default | null;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export { XanvType as default };
|
package/XanvType.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});class XanvType {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.checkes = new Map();
|
|
4
|
-
this.meta = {
|
|
5
|
-
optional: false,
|
|
6
|
-
nullable: false,
|
|
7
|
-
default: undefined,
|
|
8
|
-
transform: undefined,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
set(key, check, args) {
|
|
12
|
-
this.checkes.set(key, check);
|
|
13
|
-
this.meta[key] = args || true; // Store the key in meta for reference
|
|
14
|
-
}
|
|
15
|
-
get(key) {
|
|
16
|
-
return this.checkes.get(key);
|
|
17
|
-
}
|
|
18
|
-
optional() {
|
|
19
|
-
this.meta.optional = true;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
default(def) {
|
|
23
|
-
this.meta.default = def;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
nullable() {
|
|
27
|
-
this.meta.nullable = true;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
transform(cb) {
|
|
31
|
-
this.meta.transform = cb;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
parse(value) {
|
|
35
|
-
if (this.meta.nullable || this.meta.optional) {
|
|
36
|
-
if (value === undefined || value === null) {
|
|
37
|
-
if (this.meta.default !== undefined) {
|
|
38
|
-
return typeof this.meta.default === 'function' ? this.meta.default() : this.meta.default;
|
|
39
|
-
}
|
|
40
|
-
return value;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
value = this.check(value) || value;
|
|
44
|
-
for (const [, check] of Array.from(this.checkes.entries())) {
|
|
45
|
-
check(value);
|
|
46
|
-
}
|
|
47
|
-
if (this.meta.transform) {
|
|
48
|
-
value = this.meta.transform(value);
|
|
49
|
-
}
|
|
50
|
-
return value;
|
|
51
|
-
}
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});class XanvType {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.checkes = new Map();
|
|
4
|
+
this.meta = {
|
|
5
|
+
optional: false,
|
|
6
|
+
nullable: false,
|
|
7
|
+
default: undefined,
|
|
8
|
+
transform: undefined,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
set(key, check, args) {
|
|
12
|
+
this.checkes.set(key, check);
|
|
13
|
+
this.meta[key] = args || true; // Store the key in meta for reference
|
|
14
|
+
}
|
|
15
|
+
get(key) {
|
|
16
|
+
return this.checkes.get(key);
|
|
17
|
+
}
|
|
18
|
+
optional() {
|
|
19
|
+
this.meta.optional = true;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
default(def) {
|
|
23
|
+
this.meta.default = def;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
nullable() {
|
|
27
|
+
this.meta.nullable = true;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
transform(cb) {
|
|
31
|
+
this.meta.transform = cb;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
parse(value) {
|
|
35
|
+
if (this.meta.nullable || this.meta.optional) {
|
|
36
|
+
if (value === undefined || value === null) {
|
|
37
|
+
if (this.meta.default !== undefined) {
|
|
38
|
+
return typeof this.meta.default === 'function' ? this.meta.default() : this.meta.default;
|
|
39
|
+
}
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
value = this.check(value) || value;
|
|
44
|
+
for (const [, check] of Array.from(this.checkes.entries())) {
|
|
45
|
+
check(value);
|
|
46
|
+
}
|
|
47
|
+
if (this.meta.transform) {
|
|
48
|
+
value = this.meta.transform(value);
|
|
49
|
+
}
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
52
|
}exports.default=XanvType;//# sourceMappingURL=XanvType.js.map
|
package/XanvType.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XanvType.js","sources":["../src/XanvType.ts"],"sourcesContent":["import { XanvTransformCallback, XVCheckCallback } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"XanvType.js","sources":["../src/XanvType.ts"],"sourcesContent":["import { XanvTransformCallback, XVCheckCallback } from \"./types\";\n\nabstract class XanvType<TypeKeys extends string | number | symbol, Default> {\n private checkes = new Map<TypeKeys, XVCheckCallback<Default>>();\n meta: Record<string, any> = {\n optional: false,\n nullable: false,\n default: undefined,\n transform: undefined,\n }\n\n protected abstract check(value: any): any;\n\n set(key: TypeKeys, check: XVCheckCallback<Default>, args?: any): void {\n this.checkes.set(key, check);\n (this.meta as any)[key] = args || true; // Store the key in meta for reference\n }\n\n get(key: TypeKeys) {\n return this.checkes.get(key);\n }\n\n optional(): this {\n this.meta.optional = true;\n return this\n }\n\n default(def: Default | (() => Default)): this {\n this.meta.default = def;\n return this\n }\n\n nullable(): this {\n this.meta.nullable = true;\n return this\n }\n\n transform(cb: XanvTransformCallback<any>) {\n this.meta.transform = cb\n return this\n }\n\n parse(value: any): Default | null {\n if (this.meta.nullable || this.meta.optional) {\n if (value === undefined || value === null) {\n if (this.meta.default !== undefined) {\n return typeof this.meta.default === 'function' ? this.meta.default() : this.meta.default\n }\n return value;\n }\n }\n\n\n value = this.check(value) || value;\n\n for (const [, check] of Array.from(this.checkes.entries())) {\n check(value);\n }\n\n if (this.meta.transform) {\n value = this.meta.transform(value);\n }\n\n return value;\n }\n}\n\nexport default XanvType;"],"names":[],"mappings":"sEAEA,MAAe,QAAQ,CAAA;AAAvB,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,GAAG,EAAsC;AAC/D,QAAA,IAAA,CAAA,IAAI,GAAwB;AACzB,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;SACtB;IAwDJ;AApDG,IAAA,GAAG,CAAC,GAAa,EAAE,KAA+B,EAAE,IAAU,EAAA;QAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAY,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC;IAC1C;AAEA,IAAA,GAAG,CAAC,GAAa,EAAA;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAC/B;IAEA,QAAQ,GAAA;AACL,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI;AACzB,QAAA,OAAO,IAAI;IACd;AAEA,IAAA,OAAO,CAAC,GAA8B,EAAA;AACnC,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG;AACvB,QAAA,OAAO,IAAI;IACd;IAEA,QAAQ,GAAA;AACL,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI;AACzB,QAAA,OAAO,IAAI;IACd;AAEA,IAAA,SAAS,CAAC,EAA8B,EAAA;AACrC,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE;AACxB,QAAA,OAAO,IAAI;IACd;AAEA,IAAA,KAAK,CAAC,KAAU,EAAA;QACb,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC3C,YAAA,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;AACxC,gBAAA,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;oBAClC,OAAO,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;AAC1F,gBAAA;AACD,gBAAA,OAAO,KAAK;AACd,YAAA;AACH,QAAA;QAGD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK;AAElC,QAAA,KAAK,MAAM,GAAG,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;YACzD,KAAK,CAAC,KAAK,CAAC;AACd,QAAA;AAED,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACtB,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AACpC,QAAA;AAED,QAAA,OAAO,KAAK;IACf;AACF"}
|
package/XanvType.mjs
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
class XanvType {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.checkes = new Map();
|
|
4
|
-
this.meta = {
|
|
5
|
-
optional: false,
|
|
6
|
-
nullable: false,
|
|
7
|
-
default: undefined,
|
|
8
|
-
transform: undefined,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
set(key, check, args) {
|
|
12
|
-
this.checkes.set(key, check);
|
|
13
|
-
this.meta[key] = args || true; // Store the key in meta for reference
|
|
14
|
-
}
|
|
15
|
-
get(key) {
|
|
16
|
-
return this.checkes.get(key);
|
|
17
|
-
}
|
|
18
|
-
optional() {
|
|
19
|
-
this.meta.optional = true;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
default(def) {
|
|
23
|
-
this.meta.default = def;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
nullable() {
|
|
27
|
-
this.meta.nullable = true;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
transform(cb) {
|
|
31
|
-
this.meta.transform = cb;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
parse(value) {
|
|
35
|
-
if (this.meta.nullable || this.meta.optional) {
|
|
36
|
-
if (value === undefined || value === null) {
|
|
37
|
-
if (this.meta.default !== undefined) {
|
|
38
|
-
return typeof this.meta.default === 'function' ? this.meta.default() : this.meta.default;
|
|
39
|
-
}
|
|
40
|
-
return value;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
value = this.check(value) || value;
|
|
44
|
-
for (const [, check] of Array.from(this.checkes.entries())) {
|
|
45
|
-
check(value);
|
|
46
|
-
}
|
|
47
|
-
if (this.meta.transform) {
|
|
48
|
-
value = this.meta.transform(value);
|
|
49
|
-
}
|
|
50
|
-
return value;
|
|
51
|
-
}
|
|
1
|
+
class XanvType {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.checkes = new Map();
|
|
4
|
+
this.meta = {
|
|
5
|
+
optional: false,
|
|
6
|
+
nullable: false,
|
|
7
|
+
default: undefined,
|
|
8
|
+
transform: undefined,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
set(key, check, args) {
|
|
12
|
+
this.checkes.set(key, check);
|
|
13
|
+
this.meta[key] = args || true; // Store the key in meta for reference
|
|
14
|
+
}
|
|
15
|
+
get(key) {
|
|
16
|
+
return this.checkes.get(key);
|
|
17
|
+
}
|
|
18
|
+
optional() {
|
|
19
|
+
this.meta.optional = true;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
default(def) {
|
|
23
|
+
this.meta.default = def;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
nullable() {
|
|
27
|
+
this.meta.nullable = true;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
transform(cb) {
|
|
31
|
+
this.meta.transform = cb;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
parse(value) {
|
|
35
|
+
if (this.meta.nullable || this.meta.optional) {
|
|
36
|
+
if (value === undefined || value === null) {
|
|
37
|
+
if (this.meta.default !== undefined) {
|
|
38
|
+
return typeof this.meta.default === 'function' ? this.meta.default() : this.meta.default;
|
|
39
|
+
}
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
value = this.check(value) || value;
|
|
44
|
+
for (const [, check] of Array.from(this.checkes.entries())) {
|
|
45
|
+
check(value);
|
|
46
|
+
}
|
|
47
|
+
if (this.meta.transform) {
|
|
48
|
+
value = this.meta.transform(value);
|
|
49
|
+
}
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
52
|
}export{XanvType as default};//# sourceMappingURL=XanvType.mjs.map
|
package/XanvType.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XanvType.mjs","sources":["../src/XanvType.ts"],"sourcesContent":["import { XanvTransformCallback, XVCheckCallback } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"XanvType.mjs","sources":["../src/XanvType.ts"],"sourcesContent":["import { XanvTransformCallback, XVCheckCallback } from \"./types\";\n\nabstract class XanvType<TypeKeys extends string | number | symbol, Default> {\n private checkes = new Map<TypeKeys, XVCheckCallback<Default>>();\n meta: Record<string, any> = {\n optional: false,\n nullable: false,\n default: undefined,\n transform: undefined,\n }\n\n protected abstract check(value: any): any;\n\n set(key: TypeKeys, check: XVCheckCallback<Default>, args?: any): void {\n this.checkes.set(key, check);\n (this.meta as any)[key] = args || true; // Store the key in meta for reference\n }\n\n get(key: TypeKeys) {\n return this.checkes.get(key);\n }\n\n optional(): this {\n this.meta.optional = true;\n return this\n }\n\n default(def: Default | (() => Default)): this {\n this.meta.default = def;\n return this\n }\n\n nullable(): this {\n this.meta.nullable = true;\n return this\n }\n\n transform(cb: XanvTransformCallback<any>) {\n this.meta.transform = cb\n return this\n }\n\n parse(value: any): Default | null {\n if (this.meta.nullable || this.meta.optional) {\n if (value === undefined || value === null) {\n if (this.meta.default !== undefined) {\n return typeof this.meta.default === 'function' ? this.meta.default() : this.meta.default\n }\n return value;\n }\n }\n\n\n value = this.check(value) || value;\n\n for (const [, check] of Array.from(this.checkes.entries())) {\n check(value);\n }\n\n if (this.meta.transform) {\n value = this.meta.transform(value);\n }\n\n return value;\n }\n}\n\nexport default XanvType;"],"names":[],"mappings":"AAEA,MAAe,QAAQ,CAAA;AAAvB,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,GAAG,EAAsC;AAC/D,QAAA,IAAA,CAAA,IAAI,GAAwB;AACzB,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,SAAS,EAAE,SAAS;SACtB;IAwDJ;AApDG,IAAA,GAAG,CAAC,GAAa,EAAE,KAA+B,EAAE,IAAU,EAAA;QAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAY,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC;IAC1C;AAEA,IAAA,GAAG,CAAC,GAAa,EAAA;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAC/B;IAEA,QAAQ,GAAA;AACL,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI;AACzB,QAAA,OAAO,IAAI;IACd;AAEA,IAAA,OAAO,CAAC,GAA8B,EAAA;AACnC,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG;AACvB,QAAA,OAAO,IAAI;IACd;IAEA,QAAQ,GAAA;AACL,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI;AACzB,QAAA,OAAO,IAAI;IACd;AAEA,IAAA,SAAS,CAAC,EAA8B,EAAA;AACrC,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE;AACxB,QAAA,OAAO,IAAI;IACd;AAEA,IAAA,KAAK,CAAC,KAAU,EAAA;QACb,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC3C,YAAA,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;AACxC,gBAAA,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;oBAClC,OAAO,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;AAC1F,gBAAA;AACD,gBAAA,OAAO,KAAK;AACd,YAAA;AACH,QAAA;QAGD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK;AAElC,QAAA,KAAK,MAAM,GAAG,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;YACzD,KAAK,CAAC,KAAK,CAAC;AACd,QAAA;AAED,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACtB,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AACpC,QAAA;AAED,QAAA,OAAO,KAAK;IACf;AACF"}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as XanvType } from './XanvType.js';
|
|
1
2
|
export { default as XVAny } from './types/Any.js';
|
|
2
3
|
import XVArray from './types/Array.js';
|
|
3
4
|
import XVBoolean from './types/Boolean.js';
|
|
@@ -15,19 +16,19 @@ import XVUnion from './types/Union.js';
|
|
|
15
16
|
import { XVInstanceType, XVEnumValues, XVObjectType } from './types.js';
|
|
16
17
|
export { XVCheckCallback, XVObjectKeyType, XVObjectValueType } from './types.js';
|
|
17
18
|
|
|
18
|
-
declare const xv: {
|
|
19
|
-
array: (type: XVInstanceType, length?: number) => XVArray;
|
|
20
|
-
boolean: () => XVBoolean;
|
|
21
|
-
date: () => XVDate;
|
|
22
|
-
enum: (values: XVEnumValues) => XVEnum;
|
|
23
|
-
map: (key: XVInstanceType, value: XVInstanceType) => XVMap;
|
|
24
|
-
number: (length?: number) => XVNumber;
|
|
25
|
-
object: (arg?: XVObjectType) => XVObject;
|
|
26
|
-
record: (key: XVInstanceType, value: XVInstanceType) => XVRecord;
|
|
27
|
-
set: (type: XVInstanceType) => XVSet;
|
|
28
|
-
string: (length?: number) => XVString;
|
|
29
|
-
tuple: (type: XVInstanceType[]) => XVTuple;
|
|
30
|
-
union: (type: XVInstanceType[]) => XVUnion;
|
|
19
|
+
declare const xv: {
|
|
20
|
+
array: (type: XVInstanceType, length?: number) => XVArray;
|
|
21
|
+
boolean: () => XVBoolean;
|
|
22
|
+
date: () => XVDate;
|
|
23
|
+
enum: (values: XVEnumValues) => XVEnum;
|
|
24
|
+
map: (key: XVInstanceType, value: XVInstanceType) => XVMap;
|
|
25
|
+
number: (length?: number) => XVNumber;
|
|
26
|
+
object: (arg?: XVObjectType) => XVObject;
|
|
27
|
+
record: (key: XVInstanceType, value: XVInstanceType) => XVRecord;
|
|
28
|
+
set: (type: XVInstanceType) => XVSet;
|
|
29
|
+
string: (length?: number) => XVString;
|
|
30
|
+
tuple: (type: XVInstanceType[]) => XVTuple;
|
|
31
|
+
union: (type: XVInstanceType[]) => XVUnion;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
export { XVArray, XVBoolean, XVDate, XVEnum, XVEnumValues, XVInstanceType, XVMap, XVNumber, XVObject, XVObjectType, XVRecord, XVSet, XVString, XVTuple, XVUnion, xv };
|
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var Any=require('./types/Any.js'),Array=require('./types/Array.js'),Boolean=require('./types/Boolean.js'),Date=require('./types/Date.js'),Enum=require('./types/Enum.js'),File=require('./types/File.js'),Map=require('./types/Map.js'),Number=require('./types/Number.js'),Object$1=require('./types/Object.js'),Record=require('./types/Record.js'),Set=require('./types/Set.js'),String=require('./types/String.js'),Tuple=require('./types/Tuple.js'),Union=require('./types/Union.js');const xv = {
|
|
2
|
-
array: (type, length) => new Array.default(type, length),
|
|
3
|
-
boolean: () => new Boolean.default(),
|
|
4
|
-
date: () => new Date.default(),
|
|
5
|
-
enum: (values) => new Enum.default(values),
|
|
6
|
-
map: (key, value) => new Map.default(key, value),
|
|
7
|
-
number: (length) => new Number.default(length),
|
|
8
|
-
object: (arg) => new Object$1.default(arg),
|
|
9
|
-
record: (key, value) => new Record.default(key, value),
|
|
10
|
-
set: (type) => new Set.default(type),
|
|
11
|
-
string: (length) => new String.default(length),
|
|
12
|
-
tuple: (type) => new Tuple.default(type),
|
|
13
|
-
union: (type) => new Union.default(type),
|
|
14
|
-
};exports.XVAny=Any.default;exports.XVArray=Array.default;exports.XVBoolean=Boolean.default;exports.XVDate=Date.default;exports.XVEnum=Enum.default;exports.XVFile=File.default;exports.XVMap=Map.default;exports.XVNumber=Number.default;exports.XVObject=Object$1.default;exports.XVRecord=Record.default;exports.XVSet=Set.default;exports.XVString=String.default;exports.XVTuple=Tuple.default;exports.XVUnion=Union.default;exports.xv=xv;//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var XanvType=require('./XanvType.js'),Any=require('./types/Any.js'),Array=require('./types/Array.js'),Boolean=require('./types/Boolean.js'),Date=require('./types/Date.js'),Enum=require('./types/Enum.js'),File=require('./types/File.js'),Map=require('./types/Map.js'),Number=require('./types/Number.js'),Object$1=require('./types/Object.js'),Record=require('./types/Record.js'),Set=require('./types/Set.js'),String=require('./types/String.js'),Tuple=require('./types/Tuple.js'),Union=require('./types/Union.js');const xv = {
|
|
2
|
+
array: (type, length) => new Array.default(type, length),
|
|
3
|
+
boolean: () => new Boolean.default(),
|
|
4
|
+
date: () => new Date.default(),
|
|
5
|
+
enum: (values) => new Enum.default(values),
|
|
6
|
+
map: (key, value) => new Map.default(key, value),
|
|
7
|
+
number: (length) => new Number.default(length),
|
|
8
|
+
object: (arg) => new Object$1.default(arg),
|
|
9
|
+
record: (key, value) => new Record.default(key, value),
|
|
10
|
+
set: (type) => new Set.default(type),
|
|
11
|
+
string: (length) => new String.default(length),
|
|
12
|
+
tuple: (type) => new Tuple.default(type),
|
|
13
|
+
union: (type) => new Union.default(type),
|
|
14
|
+
};exports.XanvType=XanvType.default;exports.XVAny=Any.default;exports.XVArray=Array.default;exports.XVBoolean=Boolean.default;exports.XVDate=Date.default;exports.XVEnum=Enum.default;exports.XVFile=File.default;exports.XVMap=Map.default;exports.XVNumber=Number.default;exports.XVObject=Object$1.default;exports.XVRecord=Record.default;exports.XVSet=Set.default;exports.XVString=String.default;exports.XVTuple=Tuple.default;exports.XVUnion=Union.default;exports.xv=xv;//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import XVAny from \"./types/Any\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import XanvType from \"./XanvType\";\nimport XVAny from \"./types/Any\";\nimport XVArray from \"./types/Array\";\nimport XVBoolean from \"./types/Boolean\";\nimport XVDate from \"./types/Date\";\nimport XVEnum from \"./types/Enum\";\nimport XVFile from \"./types/File\";\nimport XVMap from \"./types/Map\";\nimport XVNumber from \"./types/Number\";\nimport XVObject from \"./types/Object\";\nimport XVRecord from \"./types/Record\";\nimport XVSet from \"./types/Set\";\nimport XVString from \"./types/String\";\nimport XVTuple from \"./types/Tuple\";\nimport XVUnion from \"./types/Union\";\n\nimport {\n XVEnumValues,\n XVInstanceType,\n XVObjectType,\n XVCheckCallback,\n XVObjectKeyType,\n XVObjectValueType,\n} from \"./types\";\n\nexport type {\n XVEnumValues,\n XVInstanceType,\n XVObjectType,\n XVCheckCallback,\n XVObjectKeyType,\n XVObjectValueType,\n};\n\nexport {\n XanvType,\n XVAny,\n XVArray,\n XVBoolean,\n XVDate,\n XVEnum,\n XVFile,\n XVMap,\n XVNumber,\n XVObject,\n XVRecord,\n XVSet,\n XVString,\n XVTuple,\n XVUnion,\n};\n\nexport const xv = {\n array: (type: XVInstanceType, length?: number) => new XVArray(type, length),\n boolean: () => new XVBoolean(),\n date: () => new XVDate(),\n enum: (values: XVEnumValues) => new XVEnum(values),\n map: (key: XVInstanceType, value: XVInstanceType) => new XVMap(key, value),\n number: (length?: number) => new XVNumber(length),\n object: (arg?: XVObjectType) => new XVObject(arg),\n record: (key: XVInstanceType, value: XVInstanceType) => new XVRecord(key, value),\n set: (type: XVInstanceType) => new XVSet(type),\n string: (length?: number) => new XVString(length),\n tuple: (type: XVInstanceType[]) => new XVTuple(type),\n union: (type: XVInstanceType[]) => new XVUnion(type),\n}\n\n"],"names":["XVArray","XVBoolean","XVDate","XVEnum","XVMap","XVNumber","XVObject","XVRecord","XVSet","XVString","XVTuple","XVUnion"],"mappings":"okBAoDO,MAAM,EAAE,GAAG;AACf,IAAA,KAAK,EAAE,CAAC,IAAoB,EAAE,MAAe,KAAK,IAAIA,aAAO,CAAC,IAAI,EAAE,MAAM,CAAC;AAC3E,IAAA,OAAO,EAAE,MAAM,IAAIC,eAAS,EAAE;AAC9B,IAAA,IAAI,EAAE,MAAM,IAAIC,YAAM,EAAE;IACxB,IAAI,EAAE,CAAC,MAAoB,KAAK,IAAIC,YAAM,CAAC,MAAM,CAAC;AAClD,IAAA,GAAG,EAAE,CAAC,GAAmB,EAAE,KAAqB,KAAK,IAAIC,WAAK,CAAC,GAAG,EAAE,KAAK,CAAC;IAC1E,MAAM,EAAE,CAAC,MAAe,KAAK,IAAIC,cAAQ,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,CAAC,GAAkB,KAAK,IAAIC,gBAAQ,CAAC,GAAG,CAAC;AACjD,IAAA,MAAM,EAAE,CAAC,GAAmB,EAAE,KAAqB,KAAK,IAAIC,cAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;IAChF,GAAG,EAAE,CAAC,IAAoB,KAAK,IAAIC,WAAK,CAAC,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC,MAAe,KAAK,IAAIC,cAAQ,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,CAAC,IAAsB,KAAK,IAAIC,aAAO,CAAC,IAAI,CAAC;IACpD,KAAK,EAAE,CAAC,IAAsB,KAAK,IAAIC,aAAO,CAAC,IAAI,CAAC;"}
|
package/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export{default as XVAny}from'./types/Any.mjs';import XVArray from'./types/Array.mjs';import XVBoolean from'./types/Boolean.mjs';import XVDate from'./types/Date.mjs';import XVEnum from'./types/Enum.mjs';export{default as XVFile}from'./types/File.mjs';import XVMap from'./types/Map.mjs';import XVNumber from'./types/Number.mjs';import XVObject from'./types/Object.mjs';import XVRecord from'./types/Record.mjs';import XVSet from'./types/Set.mjs';import XVString from'./types/String.mjs';import XVTuple from'./types/Tuple.mjs';import XVUnion from'./types/Union.mjs';const xv = {
|
|
2
|
-
array: (type, length) => new XVArray(type, length),
|
|
3
|
-
boolean: () => new XVBoolean(),
|
|
4
|
-
date: () => new XVDate(),
|
|
5
|
-
enum: (values) => new XVEnum(values),
|
|
6
|
-
map: (key, value) => new XVMap(key, value),
|
|
7
|
-
number: (length) => new XVNumber(length),
|
|
8
|
-
object: (arg) => new XVObject(arg),
|
|
9
|
-
record: (key, value) => new XVRecord(key, value),
|
|
10
|
-
set: (type) => new XVSet(type),
|
|
11
|
-
string: (length) => new XVString(length),
|
|
12
|
-
tuple: (type) => new XVTuple(type),
|
|
13
|
-
union: (type) => new XVUnion(type),
|
|
1
|
+
export{default as XanvType}from'./XanvType.mjs';export{default as XVAny}from'./types/Any.mjs';import XVArray from'./types/Array.mjs';import XVBoolean from'./types/Boolean.mjs';import XVDate from'./types/Date.mjs';import XVEnum from'./types/Enum.mjs';export{default as XVFile}from'./types/File.mjs';import XVMap from'./types/Map.mjs';import XVNumber from'./types/Number.mjs';import XVObject from'./types/Object.mjs';import XVRecord from'./types/Record.mjs';import XVSet from'./types/Set.mjs';import XVString from'./types/String.mjs';import XVTuple from'./types/Tuple.mjs';import XVUnion from'./types/Union.mjs';const xv = {
|
|
2
|
+
array: (type, length) => new XVArray(type, length),
|
|
3
|
+
boolean: () => new XVBoolean(),
|
|
4
|
+
date: () => new XVDate(),
|
|
5
|
+
enum: (values) => new XVEnum(values),
|
|
6
|
+
map: (key, value) => new XVMap(key, value),
|
|
7
|
+
number: (length) => new XVNumber(length),
|
|
8
|
+
object: (arg) => new XVObject(arg),
|
|
9
|
+
record: (key, value) => new XVRecord(key, value),
|
|
10
|
+
set: (type) => new XVSet(type),
|
|
11
|
+
string: (length) => new XVString(length),
|
|
12
|
+
tuple: (type) => new XVTuple(type),
|
|
13
|
+
union: (type) => new XVUnion(type),
|
|
14
14
|
};export{XVArray,XVBoolean,XVDate,XVEnum,XVMap,XVNumber,XVObject,XVRecord,XVSet,XVString,XVTuple,XVUnion,xv};//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import XVAny from \"./types/Any\";\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import XanvType from \"./XanvType\";\nimport XVAny from \"./types/Any\";\nimport XVArray from \"./types/Array\";\nimport XVBoolean from \"./types/Boolean\";\nimport XVDate from \"./types/Date\";\nimport XVEnum from \"./types/Enum\";\nimport XVFile from \"./types/File\";\nimport XVMap from \"./types/Map\";\nimport XVNumber from \"./types/Number\";\nimport XVObject from \"./types/Object\";\nimport XVRecord from \"./types/Record\";\nimport XVSet from \"./types/Set\";\nimport XVString from \"./types/String\";\nimport XVTuple from \"./types/Tuple\";\nimport XVUnion from \"./types/Union\";\n\nimport {\n XVEnumValues,\n XVInstanceType,\n XVObjectType,\n XVCheckCallback,\n XVObjectKeyType,\n XVObjectValueType,\n} from \"./types\";\n\nexport type {\n XVEnumValues,\n XVInstanceType,\n XVObjectType,\n XVCheckCallback,\n XVObjectKeyType,\n XVObjectValueType,\n};\n\nexport {\n XanvType,\n XVAny,\n XVArray,\n XVBoolean,\n XVDate,\n XVEnum,\n XVFile,\n XVMap,\n XVNumber,\n XVObject,\n XVRecord,\n XVSet,\n XVString,\n XVTuple,\n XVUnion,\n};\n\nexport const xv = {\n array: (type: XVInstanceType, length?: number) => new XVArray(type, length),\n boolean: () => new XVBoolean(),\n date: () => new XVDate(),\n enum: (values: XVEnumValues) => new XVEnum(values),\n map: (key: XVInstanceType, value: XVInstanceType) => new XVMap(key, value),\n number: (length?: number) => new XVNumber(length),\n object: (arg?: XVObjectType) => new XVObject(arg),\n record: (key: XVInstanceType, value: XVInstanceType) => new XVRecord(key, value),\n set: (type: XVInstanceType) => new XVSet(type),\n string: (length?: number) => new XVString(length),\n tuple: (type: XVInstanceType[]) => new XVTuple(type),\n union: (type: XVInstanceType[]) => new XVUnion(type),\n}\n\n"],"names":[],"mappings":"kmBAoDO,MAAM,EAAE,GAAG;AACf,IAAA,KAAK,EAAE,CAAC,IAAoB,EAAE,MAAe,KAAK,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;AAC3E,IAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE;AAC9B,IAAA,IAAI,EAAE,MAAM,IAAI,MAAM,EAAE;IACxB,IAAI,EAAE,CAAC,MAAoB,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;AAClD,IAAA,GAAG,EAAE,CAAC,GAAmB,EAAE,KAAqB,KAAK,IAAI,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC;IAC1E,MAAM,EAAE,CAAC,MAAe,KAAK,IAAI,QAAQ,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,CAAC,GAAkB,KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC;AACjD,IAAA,MAAM,EAAE,CAAC,GAAmB,EAAE,KAAqB,KAAK,IAAI,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;IAChF,GAAG,EAAE,CAAC,IAAoB,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC,MAAe,KAAK,IAAI,QAAQ,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,CAAC,IAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IACpD,KAAK,EAAE,CAAC,IAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;"}
|