@valbuild/core 0.15.0 → 0.17.0
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/ROADMAP.md +106 -0
- package/dist/declarations/src/ValApi.d.ts +26 -0
- package/dist/declarations/src/expr/eval.d.ts +1 -1
- package/dist/declarations/src/future/fetchVal.d.ts +5 -0
- package/dist/declarations/src/index.d.ts +38 -9
- package/dist/declarations/src/initSchema.d.ts +2 -10
- package/dist/declarations/src/initVal.d.ts +3 -21
- package/dist/declarations/src/module.d.ts +2 -14
- package/dist/declarations/src/patch/index.d.ts +1 -1
- package/dist/declarations/src/patch/util.d.ts +2 -0
- package/dist/declarations/src/schema/array.d.ts +3 -2
- package/dist/declarations/src/schema/boolean.d.ts +3 -2
- package/dist/declarations/src/schema/image.d.ts +4 -3
- package/dist/declarations/src/schema/index.d.ts +8 -7
- package/dist/declarations/src/schema/keyOf.d.ts +23 -0
- package/dist/declarations/src/schema/literal.d.ts +3 -2
- package/dist/declarations/src/schema/number.d.ts +3 -2
- package/dist/declarations/src/schema/object.d.ts +3 -2
- package/dist/declarations/src/schema/record.d.ts +19 -0
- package/dist/declarations/src/schema/richtext.d.ts +3 -2
- package/dist/declarations/src/schema/string.d.ts +3 -2
- package/dist/declarations/src/schema/union.d.ts +4 -2
- package/dist/declarations/src/schema/validation/ValidationError.d.ts +14 -0
- package/dist/declarations/src/schema/validation/ValidationFix.d.ts +2 -0
- package/dist/declarations/src/selector/SelectorProxy.d.ts +7 -0
- package/dist/declarations/src/selector/array.d.ts +2 -13
- package/dist/declarations/src/selector/file.d.ts +1 -4
- package/dist/declarations/src/selector/future/array.d.ts +17 -0
- package/dist/declarations/src/selector/future/boolean.d.ts +2 -0
- package/dist/declarations/src/selector/future/file.d.ts +9 -0
- package/dist/declarations/src/selector/{i18n.d.ts → future/i18n.d.ts} +2 -2
- package/dist/declarations/src/selector/future/index.d.ts +81 -0
- package/dist/declarations/src/selector/future/number.d.ts +2 -0
- package/dist/declarations/src/selector/future/object.d.ts +10 -0
- package/dist/declarations/src/selector/future/primitive.d.ts +9 -0
- package/dist/declarations/src/selector/{remote.d.ts → future/remote.d.ts} +1 -1
- package/dist/declarations/src/selector/future/string.d.ts +2 -0
- package/dist/declarations/src/selector/index.d.ts +5 -32
- package/dist/declarations/src/selector/object.d.ts +2 -9
- package/dist/declarations/src/selector/primitive.d.ts +3 -9
- package/dist/declarations/src/source/{i18n.d.ts → future/i18n.d.ts} +2 -2
- package/dist/declarations/src/source/{remote.d.ts → future/remote.d.ts} +3 -3
- package/dist/declarations/src/source/index.d.ts +4 -3
- package/dist/declarations/src/val/index.d.ts +2 -2
- package/dist/index-369caccf.esm.js +550 -0
- package/dist/{index-06df0a5b.esm.js → index-3e3e839e.esm.js} +190 -555
- package/dist/{index-9663f28a.cjs.dev.js → index-486c7fbf.cjs.dev.js} +224 -617
- package/dist/{index-b2270f8f.cjs.prod.js → index-601a7d73.cjs.prod.js} +224 -617
- package/dist/index-8706c87e.cjs.prod.js +582 -0
- package/dist/index-a6e642dd.cjs.dev.js +582 -0
- package/dist/ops-0d09f8ee.cjs.prod.js +684 -0
- package/dist/ops-23a5abb2.esm.js +671 -0
- package/dist/ops-f3015423.cjs.dev.js +684 -0
- package/dist/valbuild-core.cjs.dev.js +640 -633
- package/dist/valbuild-core.cjs.prod.js +640 -633
- package/dist/valbuild-core.esm.js +578 -572
- package/expr/dist/valbuild-core-expr.cjs.dev.js +8 -8
- package/expr/dist/valbuild-core-expr.cjs.prod.js +8 -8
- package/expr/dist/valbuild-core-expr.esm.js +2 -2
- package/package.json +2 -2
- package/patch/dist/valbuild-core-patch.cjs.dev.js +32 -23
- package/patch/dist/valbuild-core-patch.cjs.prod.js +32 -23
- package/patch/dist/valbuild-core-patch.esm.js +12 -4
- package/src/ValApi.ts +85 -0
- package/src/expr/eval.test.ts +2 -2
- package/src/expr/eval.ts +2 -2
- package/src/expr/repl.ts +2 -2
- package/src/{fetchVal.test.ts → future/fetchVal.test.ts} +57 -57
- package/src/{fetchVal.ts → future/fetchVal.ts} +17 -22
- package/src/index.ts +51 -14
- package/src/initSchema.ts +11 -12
- package/src/initVal.ts +42 -52
- package/src/module.test.ts +40 -40
- package/src/module.ts +53 -43
- package/src/patch/deref.test.ts +1 -1
- package/src/patch/deref.ts +1 -1
- package/src/patch/index.ts +1 -0
- package/src/patch/json.test.ts +0 -1
- package/src/patch/util.ts +7 -0
- package/src/schema/array.ts +45 -4
- package/src/schema/boolean.ts +14 -3
- package/src/schema/{i18n.ts → future/i18n.ts} +15 -11
- package/src/schema/{oneOf.ts → future/oneOf.ts} +21 -18
- package/src/schema/image.ts +66 -6
- package/src/schema/index.ts +37 -13
- package/src/schema/keyOf.ts +167 -0
- package/src/schema/literal.ts +24 -3
- package/src/schema/number.ts +14 -3
- package/src/schema/object.ts +50 -7
- package/src/schema/record.ts +103 -0
- package/src/schema/richtext.ts +63 -3
- package/src/schema/string.ts +14 -3
- package/src/schema/union.ts +4 -3
- package/src/schema/validation/ValidationError.ts +16 -0
- package/src/schema/validation/ValidationFix.ts +6 -0
- package/src/schema/validation.test.ts +291 -0
- package/src/selector/SelectorProxy.ts +16 -16
- package/src/selector/array.ts +2 -26
- package/src/selector/file.ts +1 -9
- package/src/selector/{ExprProxy.test.ts → future/ExprProxy.test.ts} +2 -2
- package/src/selector/{ExprProxy.ts → future/ExprProxy.ts} +9 -2
- package/src/selector/{SelectorProxy.test.ts → future/SelectorProxy.test.ts} +4 -4
- package/src/selector/future/SelectorProxy.ts +238 -0
- package/src/selector/future/array.ts +37 -0
- package/src/selector/future/boolean.ts +4 -0
- package/src/selector/future/file.ts +14 -0
- package/src/selector/{i18n.ts → future/i18n.ts} +2 -2
- package/src/selector/future/index.ts +165 -0
- package/src/selector/future/number.ts +4 -0
- package/src/selector/future/object.ts +22 -0
- package/src/selector/future/primitive.ts +17 -0
- package/src/selector/{remote.ts → future/remote.ts} +1 -1
- package/src/selector/{selector.test.ts → future/selector.test.ts} +8 -28
- package/src/selector/{selectorOf.ts → future/selectorOf.ts} +1 -1
- package/src/selector/future/string.ts +4 -0
- package/src/selector/index.ts +4 -46
- package/src/selector/object.ts +2 -19
- package/src/selector/primitive.ts +3 -16
- package/src/source/{i18n.ts → future/i18n.ts} +2 -2
- package/src/source/{remote.ts → future/remote.ts} +3 -3
- package/src/source/index.ts +3 -2
- package/src/val/array.ts +1 -1
- package/src/val/index.ts +2 -2
- package/src/val/object.ts +1 -1
- package/dist/createClass-012eebbf.esm.js +0 -109
- package/dist/createClass-a436dbfe.cjs.dev.js +0 -116
- package/dist/createClass-de7426aa.cjs.prod.js +0 -116
- package/dist/declarations/src/fetchVal.d.ts +0 -5
- package/dist/declarations/src/schema/i18n.d.ts +0 -21
- package/dist/declarations/src/schema/oneOf.d.ts +0 -22
- package/dist/ops-6fae92a1.esm.js +0 -12
- package/dist/ops-87cdbafc.cjs.dev.js +0 -14
- package/dist/ops-ae4d1bc2.cjs.prod.js +0 -14
package/src/selector/object.ts
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
Selector as UnknownSelector,
|
3
|
-
GenericSelector,
|
4
|
-
SelectorOf,
|
5
|
-
SelectorSource,
|
6
|
-
} from ".";
|
1
|
+
import { GenericSelector } from "./index";
|
7
2
|
import { SourceObject } from "../source";
|
8
3
|
|
9
4
|
// TODO: docs
|
10
|
-
export type Selector<T extends SourceObject> = GenericSelector<T
|
11
|
-
fold<Tag extends string>(
|
12
|
-
key: Tag
|
13
|
-
): <U extends SelectorSource>(cases: {
|
14
|
-
[key in T[Tag & keyof T] & string]: (v: UnknownSelector<T>) => U;
|
15
|
-
}) => SelectorOf<U>;
|
16
|
-
|
17
|
-
andThen<U extends SelectorSource>(
|
18
|
-
f: (v: UnknownSelector<NonNullable<T>>) => U
|
19
|
-
): SelectorOf<U>;
|
20
|
-
} & {
|
21
|
-
readonly [key in keyof T]: UnknownSelector<T[key]>;
|
22
|
-
};
|
5
|
+
export type Selector<T extends SourceObject> = GenericSelector<T>;
|
@@ -1,17 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
GenericSelector,
|
4
|
-
SelectorOf,
|
5
|
-
SelectorSource,
|
6
|
-
} from ".";
|
7
|
-
import { Source, SourcePrimitive } from "../source";
|
8
|
-
import { Selector as BooleanSelector } from "./boolean";
|
1
|
+
import { GenericSelector } from "./index";
|
2
|
+
import { SourcePrimitive } from "../source";
|
9
3
|
|
10
|
-
export type Selector<T extends SourcePrimitive> = GenericSelector<T
|
11
|
-
eq(other: Source): BooleanSelector<boolean>;
|
12
|
-
andThen<U extends SelectorSource>(
|
13
|
-
f: (v: UnknownSelector<NonNullable<T>>) => U
|
14
|
-
): SelectorOf<U | NullableOf<T>>;
|
15
|
-
};
|
16
|
-
|
17
|
-
type NullableOf<T extends Source> = T extends null ? null : never;
|
4
|
+
export type Selector<T extends SourcePrimitive> = GenericSelector<T>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { F } from "ts-toolbelt";
|
2
|
-
import { SourcePrimitive, VAL_EXTENSION } from "
|
3
|
-
import { FileSource } from "
|
2
|
+
import { SourcePrimitive, VAL_EXTENSION } from "..";
|
3
|
+
import { FileSource } from "../file";
|
4
4
|
|
5
5
|
/**
|
6
6
|
* I18n sources cannot have nested remote sources.
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { SourcePrimitive, VAL_EXTENSION, PhantomType } from "
|
2
|
-
import { FileSource } from "
|
1
|
+
import { SourcePrimitive, VAL_EXTENSION, PhantomType } from "..";
|
2
|
+
import { FileSource } from "../file";
|
3
3
|
import { I18nCompatibleSource, I18nSource } from "./i18n";
|
4
|
-
import { RichTextSource } from "
|
4
|
+
import { RichTextSource } from "../richtext";
|
5
5
|
|
6
6
|
/**
|
7
7
|
* Remote sources cannot include other remote sources.
|
package/src/source/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FileSource } from "./file";
|
2
|
-
import { I18nSource, I18nCompatibleSource } from "./i18n";
|
3
|
-
import { RemoteSource, RemoteCompatibleSource } from "./remote";
|
2
|
+
import { I18nSource, I18nCompatibleSource } from "./future/i18n";
|
3
|
+
import { RemoteSource, RemoteCompatibleSource } from "./future/remote";
|
4
4
|
import { RichTextSource } from "./richtext";
|
5
5
|
|
6
6
|
export type Source =
|
@@ -15,6 +15,7 @@ export type Source =
|
|
15
15
|
export type SourceObject = { [key in string]: Source } & {
|
16
16
|
// TODO: update these restricted parameters:
|
17
17
|
fold?: never;
|
18
|
+
assert?: never;
|
18
19
|
andThen?: never;
|
19
20
|
_ref?: never;
|
20
21
|
_type?: never;
|
package/src/val/array.ts
CHANGED
package/src/val/index.ts
CHANGED
@@ -4,8 +4,8 @@ import { Val as ArrayVal } from "./array";
|
|
4
4
|
import { Val as PrimitiveVal } from "./primitive";
|
5
5
|
import { Json, JsonArray, JsonObject, JsonPrimitive } from "../Json";
|
6
6
|
import { Path, Selector } from "../selector";
|
7
|
-
import { I18nSource } from "../source/i18n";
|
8
|
-
import { RemoteSource } from "../source/remote";
|
7
|
+
import { I18nSource } from "../source/future/i18n";
|
8
|
+
import { RemoteSource } from "../source/future/remote";
|
9
9
|
import { FileSource } from "../source/file";
|
10
10
|
|
11
11
|
export type SerializedVal = {
|
package/src/val/object.ts
CHANGED
@@ -1,109 +0,0 @@
|
|
1
|
-
import { b as _arrayLikeToArray, c as _unsupportedIterableToArray } from './result-b96df128.esm.js';
|
2
|
-
|
3
|
-
function _toPrimitive(input, hint) {
|
4
|
-
if (typeof input !== "object" || input === null) return input;
|
5
|
-
var prim = input[Symbol.toPrimitive];
|
6
|
-
if (prim !== undefined) {
|
7
|
-
var res = prim.call(input, hint || "default");
|
8
|
-
if (typeof res !== "object") return res;
|
9
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
10
|
-
}
|
11
|
-
return (hint === "string" ? String : Number)(input);
|
12
|
-
}
|
13
|
-
|
14
|
-
function _toPropertyKey(arg) {
|
15
|
-
var key = _toPrimitive(arg, "string");
|
16
|
-
return typeof key === "symbol" ? key : String(key);
|
17
|
-
}
|
18
|
-
|
19
|
-
function _arrayWithoutHoles(arr) {
|
20
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
21
|
-
}
|
22
|
-
|
23
|
-
function _iterableToArray(iter) {
|
24
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
25
|
-
}
|
26
|
-
|
27
|
-
function _nonIterableSpread() {
|
28
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
29
|
-
}
|
30
|
-
|
31
|
-
function _toConsumableArray(arr) {
|
32
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
33
|
-
}
|
34
|
-
|
35
|
-
function _typeof(obj) {
|
36
|
-
"@babel/helpers - typeof";
|
37
|
-
|
38
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
39
|
-
return typeof obj;
|
40
|
-
} : function (obj) {
|
41
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
42
|
-
}, _typeof(obj);
|
43
|
-
}
|
44
|
-
|
45
|
-
function _arrayWithHoles(arr) {
|
46
|
-
if (Array.isArray(arr)) return arr;
|
47
|
-
}
|
48
|
-
|
49
|
-
function _iterableToArrayLimit(arr, i) {
|
50
|
-
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
51
|
-
if (null != _i) {
|
52
|
-
var _s,
|
53
|
-
_e,
|
54
|
-
_x,
|
55
|
-
_r,
|
56
|
-
_arr = [],
|
57
|
-
_n = !0,
|
58
|
-
_d = !1;
|
59
|
-
try {
|
60
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
61
|
-
if (Object(_i) !== _i) return;
|
62
|
-
_n = !1;
|
63
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
64
|
-
} catch (err) {
|
65
|
-
_d = !0, _e = err;
|
66
|
-
} finally {
|
67
|
-
try {
|
68
|
-
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
69
|
-
} finally {
|
70
|
-
if (_d) throw _e;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
return _arr;
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
function _nonIterableRest() {
|
78
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
79
|
-
}
|
80
|
-
|
81
|
-
function _slicedToArray(arr, i) {
|
82
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
83
|
-
}
|
84
|
-
|
85
|
-
function _classCallCheck(instance, Constructor) {
|
86
|
-
if (!(instance instanceof Constructor)) {
|
87
|
-
throw new TypeError("Cannot call a class as a function");
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
function _defineProperties(target, props) {
|
92
|
-
for (var i = 0; i < props.length; i++) {
|
93
|
-
var descriptor = props[i];
|
94
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
95
|
-
descriptor.configurable = true;
|
96
|
-
if ("value" in descriptor) descriptor.writable = true;
|
97
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
98
|
-
}
|
99
|
-
}
|
100
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
101
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
102
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
103
|
-
Object.defineProperty(Constructor, "prototype", {
|
104
|
-
writable: false
|
105
|
-
});
|
106
|
-
return Constructor;
|
107
|
-
}
|
108
|
-
|
109
|
-
export { _classCallCheck as _, _createClass as a, _typeof as b, _slicedToArray as c, _toConsumableArray as d, _toPropertyKey as e };
|
@@ -1,116 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var result = require('./result-48320acd.cjs.dev.js');
|
4
|
-
|
5
|
-
function _toPrimitive(input, hint) {
|
6
|
-
if (typeof input !== "object" || input === null) return input;
|
7
|
-
var prim = input[Symbol.toPrimitive];
|
8
|
-
if (prim !== undefined) {
|
9
|
-
var res = prim.call(input, hint || "default");
|
10
|
-
if (typeof res !== "object") return res;
|
11
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
12
|
-
}
|
13
|
-
return (hint === "string" ? String : Number)(input);
|
14
|
-
}
|
15
|
-
|
16
|
-
function _toPropertyKey(arg) {
|
17
|
-
var key = _toPrimitive(arg, "string");
|
18
|
-
return typeof key === "symbol" ? key : String(key);
|
19
|
-
}
|
20
|
-
|
21
|
-
function _arrayWithoutHoles(arr) {
|
22
|
-
if (Array.isArray(arr)) return result._arrayLikeToArray(arr);
|
23
|
-
}
|
24
|
-
|
25
|
-
function _iterableToArray(iter) {
|
26
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
27
|
-
}
|
28
|
-
|
29
|
-
function _nonIterableSpread() {
|
30
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
31
|
-
}
|
32
|
-
|
33
|
-
function _toConsumableArray(arr) {
|
34
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || result._unsupportedIterableToArray(arr) || _nonIterableSpread();
|
35
|
-
}
|
36
|
-
|
37
|
-
function _typeof(obj) {
|
38
|
-
"@babel/helpers - typeof";
|
39
|
-
|
40
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
41
|
-
return typeof obj;
|
42
|
-
} : function (obj) {
|
43
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
44
|
-
}, _typeof(obj);
|
45
|
-
}
|
46
|
-
|
47
|
-
function _arrayWithHoles(arr) {
|
48
|
-
if (Array.isArray(arr)) return arr;
|
49
|
-
}
|
50
|
-
|
51
|
-
function _iterableToArrayLimit(arr, i) {
|
52
|
-
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
53
|
-
if (null != _i) {
|
54
|
-
var _s,
|
55
|
-
_e,
|
56
|
-
_x,
|
57
|
-
_r,
|
58
|
-
_arr = [],
|
59
|
-
_n = !0,
|
60
|
-
_d = !1;
|
61
|
-
try {
|
62
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
63
|
-
if (Object(_i) !== _i) return;
|
64
|
-
_n = !1;
|
65
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
66
|
-
} catch (err) {
|
67
|
-
_d = !0, _e = err;
|
68
|
-
} finally {
|
69
|
-
try {
|
70
|
-
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
71
|
-
} finally {
|
72
|
-
if (_d) throw _e;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
return _arr;
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
function _nonIterableRest() {
|
80
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
81
|
-
}
|
82
|
-
|
83
|
-
function _slicedToArray(arr, i) {
|
84
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || result._unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
85
|
-
}
|
86
|
-
|
87
|
-
function _classCallCheck(instance, Constructor) {
|
88
|
-
if (!(instance instanceof Constructor)) {
|
89
|
-
throw new TypeError("Cannot call a class as a function");
|
90
|
-
}
|
91
|
-
}
|
92
|
-
|
93
|
-
function _defineProperties(target, props) {
|
94
|
-
for (var i = 0; i < props.length; i++) {
|
95
|
-
var descriptor = props[i];
|
96
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
97
|
-
descriptor.configurable = true;
|
98
|
-
if ("value" in descriptor) descriptor.writable = true;
|
99
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
103
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
104
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
105
|
-
Object.defineProperty(Constructor, "prototype", {
|
106
|
-
writable: false
|
107
|
-
});
|
108
|
-
return Constructor;
|
109
|
-
}
|
110
|
-
|
111
|
-
exports._classCallCheck = _classCallCheck;
|
112
|
-
exports._createClass = _createClass;
|
113
|
-
exports._slicedToArray = _slicedToArray;
|
114
|
-
exports._toConsumableArray = _toConsumableArray;
|
115
|
-
exports._toPropertyKey = _toPropertyKey;
|
116
|
-
exports._typeof = _typeof;
|
@@ -1,116 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var result = require('./result-26f67b40.cjs.prod.js');
|
4
|
-
|
5
|
-
function _toPrimitive(input, hint) {
|
6
|
-
if (typeof input !== "object" || input === null) return input;
|
7
|
-
var prim = input[Symbol.toPrimitive];
|
8
|
-
if (prim !== undefined) {
|
9
|
-
var res = prim.call(input, hint || "default");
|
10
|
-
if (typeof res !== "object") return res;
|
11
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
12
|
-
}
|
13
|
-
return (hint === "string" ? String : Number)(input);
|
14
|
-
}
|
15
|
-
|
16
|
-
function _toPropertyKey(arg) {
|
17
|
-
var key = _toPrimitive(arg, "string");
|
18
|
-
return typeof key === "symbol" ? key : String(key);
|
19
|
-
}
|
20
|
-
|
21
|
-
function _arrayWithoutHoles(arr) {
|
22
|
-
if (Array.isArray(arr)) return result._arrayLikeToArray(arr);
|
23
|
-
}
|
24
|
-
|
25
|
-
function _iterableToArray(iter) {
|
26
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
27
|
-
}
|
28
|
-
|
29
|
-
function _nonIterableSpread() {
|
30
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
31
|
-
}
|
32
|
-
|
33
|
-
function _toConsumableArray(arr) {
|
34
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || result._unsupportedIterableToArray(arr) || _nonIterableSpread();
|
35
|
-
}
|
36
|
-
|
37
|
-
function _typeof(obj) {
|
38
|
-
"@babel/helpers - typeof";
|
39
|
-
|
40
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
41
|
-
return typeof obj;
|
42
|
-
} : function (obj) {
|
43
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
44
|
-
}, _typeof(obj);
|
45
|
-
}
|
46
|
-
|
47
|
-
function _arrayWithHoles(arr) {
|
48
|
-
if (Array.isArray(arr)) return arr;
|
49
|
-
}
|
50
|
-
|
51
|
-
function _iterableToArrayLimit(arr, i) {
|
52
|
-
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
53
|
-
if (null != _i) {
|
54
|
-
var _s,
|
55
|
-
_e,
|
56
|
-
_x,
|
57
|
-
_r,
|
58
|
-
_arr = [],
|
59
|
-
_n = !0,
|
60
|
-
_d = !1;
|
61
|
-
try {
|
62
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
63
|
-
if (Object(_i) !== _i) return;
|
64
|
-
_n = !1;
|
65
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
66
|
-
} catch (err) {
|
67
|
-
_d = !0, _e = err;
|
68
|
-
} finally {
|
69
|
-
try {
|
70
|
-
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
71
|
-
} finally {
|
72
|
-
if (_d) throw _e;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
return _arr;
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
function _nonIterableRest() {
|
80
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
81
|
-
}
|
82
|
-
|
83
|
-
function _slicedToArray(arr, i) {
|
84
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || result._unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
85
|
-
}
|
86
|
-
|
87
|
-
function _classCallCheck(instance, Constructor) {
|
88
|
-
if (!(instance instanceof Constructor)) {
|
89
|
-
throw new TypeError("Cannot call a class as a function");
|
90
|
-
}
|
91
|
-
}
|
92
|
-
|
93
|
-
function _defineProperties(target, props) {
|
94
|
-
for (var i = 0; i < props.length; i++) {
|
95
|
-
var descriptor = props[i];
|
96
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
97
|
-
descriptor.configurable = true;
|
98
|
-
if ("value" in descriptor) descriptor.writable = true;
|
99
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
103
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
104
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
105
|
-
Object.defineProperty(Constructor, "prototype", {
|
106
|
-
writable: false
|
107
|
-
});
|
108
|
-
return Constructor;
|
109
|
-
}
|
110
|
-
|
111
|
-
exports._classCallCheck = _classCallCheck;
|
112
|
-
exports._createClass = _createClass;
|
113
|
-
exports._slicedToArray = _slicedToArray;
|
114
|
-
exports._toConsumableArray = _toConsumableArray;
|
115
|
-
exports._toPropertyKey = _toPropertyKey;
|
116
|
-
exports._typeof = _typeof;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { GenericSelector, SelectorOf, SelectorSource } from "./selector/index.js";
|
2
|
-
import { JsonOfSource, Val } from "./val/index.js";
|
3
|
-
export declare function fetchVal<T extends SelectorSource>(selector: T, locale?: string): SelectorOf<T> extends GenericSelector<infer S> ? Promise<Val<JsonOfSource<S>>> : never;
|
4
|
-
export declare function getVal<T extends SelectorSource>(selector: T, locale?: string): SelectorOf<T> extends GenericSelector<infer S> ? Val<JsonOfSource<S>> : never;
|
5
|
-
export declare function serializedValOfSelectorSource<T extends SelectorSource>(selector: T): any;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { Schema, SchemaTypeOf, SerializedSchema } from "./index.js";
|
2
|
-
import { I18nCompatibleSource, I18nSource } from "../source/i18n.js";
|
3
|
-
import { SourcePath } from "../val/index.js";
|
4
|
-
export type SerializedI18nSchema = {
|
5
|
-
type: "i18n";
|
6
|
-
locales: readonly string[];
|
7
|
-
item: SerializedSchema;
|
8
|
-
opt: boolean;
|
9
|
-
};
|
10
|
-
export declare class I18nSchema<Locales extends readonly string[]> extends Schema<I18nSource<Locales, SchemaTypeOf<Schema<I18nCompatibleSource>>>> {
|
11
|
-
readonly locales: Locales;
|
12
|
-
readonly item: Schema<SchemaTypeOf<Schema<I18nCompatibleSource>>>;
|
13
|
-
readonly opt: boolean;
|
14
|
-
constructor(locales: Locales, item: Schema<SchemaTypeOf<Schema<I18nCompatibleSource>>>, opt?: boolean);
|
15
|
-
validate(src: I18nSource<Locales, SchemaTypeOf<Schema<I18nCompatibleSource>>>): false | Record<SourcePath, string[]>;
|
16
|
-
match(src: I18nSource<Locales, SchemaTypeOf<Schema<I18nCompatibleSource>>>): boolean;
|
17
|
-
optional(): Schema<I18nSource<Locales, SchemaTypeOf<Schema<I18nCompatibleSource>>> | null>;
|
18
|
-
serialize(): SerializedSchema;
|
19
|
-
}
|
20
|
-
export type I18n<Locales extends readonly string[]> = <S extends Schema<I18nCompatibleSource>>(schema: S) => Schema<I18nSource<Locales, SchemaTypeOf<S>>>;
|
21
|
-
export declare const i18n: <Locales extends readonly string[]>(locales: Locales) => <S extends Schema<I18nCompatibleSource>>(schema: S) => Schema<I18nSource<Locales, SchemaTypeOf<S>>>;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { Schema, SerializedSchema } from "./index.js";
|
2
|
-
import { ValModuleBrand } from "../module.js";
|
3
|
-
import { GenericSelector } from "../selector/index.js";
|
4
|
-
import { Source, SourceArray } from "../source/index.js";
|
5
|
-
import { SourcePath } from "../val/index.js";
|
6
|
-
export type SerializedOneOfSchema = {
|
7
|
-
type: "oneOf";
|
8
|
-
selector: SourcePath;
|
9
|
-
opt: boolean;
|
10
|
-
};
|
11
|
-
type OneOfSelector<Sel extends GenericSelector<SourceArray>> = Sel extends GenericSelector<infer S> ? S extends (infer IS)[] ? IS extends Source ? GenericSelector<IS> : never : never : never;
|
12
|
-
export declare class OneOfSchema<Sel extends GenericSelector<SourceArray>> extends Schema<OneOfSelector<Sel>> {
|
13
|
-
readonly selector: Sel;
|
14
|
-
readonly opt: boolean;
|
15
|
-
constructor(selector: Sel, opt?: boolean);
|
16
|
-
validate(src: OneOfSelector<Sel>): false | Record<SourcePath, string[]>;
|
17
|
-
match(src: OneOfSelector<Sel>): boolean;
|
18
|
-
optional(): Schema<OneOfSelector<Sel> | null>;
|
19
|
-
serialize(): SerializedSchema;
|
20
|
-
}
|
21
|
-
export declare const oneOf: <Src extends GenericSelector<SourceArray, undefined> & ValModuleBrand>(valModule: Src) => Schema<OneOfSelector<Src>>;
|
22
|
-
export {};
|
package/dist/ops-6fae92a1.esm.js
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
import { a as _createClass, _ as _classCallCheck } from './createClass-012eebbf.esm.js';
|
2
|
-
|
3
|
-
var PatchError = /*#__PURE__*/_createClass(function PatchError(message) {
|
4
|
-
_classCallCheck(this, PatchError);
|
5
|
-
this.message = message;
|
6
|
-
});
|
7
|
-
|
8
|
-
/**
|
9
|
-
* NOTE: MAY mutate the input document.
|
10
|
-
*/
|
11
|
-
|
12
|
-
export { PatchError as P };
|
@@ -1,14 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var createClass = require('./createClass-a436dbfe.cjs.dev.js');
|
4
|
-
|
5
|
-
var PatchError = /*#__PURE__*/createClass._createClass(function PatchError(message) {
|
6
|
-
createClass._classCallCheck(this, PatchError);
|
7
|
-
this.message = message;
|
8
|
-
});
|
9
|
-
|
10
|
-
/**
|
11
|
-
* NOTE: MAY mutate the input document.
|
12
|
-
*/
|
13
|
-
|
14
|
-
exports.PatchError = PatchError;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var createClass = require('./createClass-de7426aa.cjs.prod.js');
|
4
|
-
|
5
|
-
var PatchError = /*#__PURE__*/createClass._createClass(function PatchError(message) {
|
6
|
-
createClass._classCallCheck(this, PatchError);
|
7
|
-
this.message = message;
|
8
|
-
});
|
9
|
-
|
10
|
-
/**
|
11
|
-
* NOTE: MAY mutate the input document.
|
12
|
-
*/
|
13
|
-
|
14
|
-
exports.PatchError = PatchError;
|