@adobe/data 0.3.2 → 0.4.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/dist/ecs/database/create-database.d.ts +1 -1
- package/dist/ecs/database/create-database.js +22 -23
- package/dist/ecs/database/create-database.js.map +1 -1
- package/dist/ecs/database/create-database.test.js +44 -57
- package/dist/ecs/database/create-database.test.js.map +1 -1
- package/dist/ecs/database/database-schema/create-database-schema-test.js +6 -8
- package/dist/ecs/database/database-schema/create-database-schema-test.js.map +1 -1
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +2 -3
- package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -1
- package/dist/ecs/database/database-schema/database-schema.d.ts +3 -3
- package/dist/ecs/database/database.d.ts +6 -6
- package/dist/ecs/database/observe-dependent-value.test.js +21 -21
- package/dist/ecs/database/observe-dependent-value.test.js.map +1 -1
- package/dist/ecs/database/observe-select-entities.performance.test.js +11 -11
- package/dist/ecs/database/observe-select-entities.performance.test.js.map +1 -1
- package/dist/ecs/database/observe-select-entities.test.js +11 -11
- package/dist/ecs/database/observe-select-entities.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/apply-operations.d.ts +2 -0
- package/dist/ecs/database/transactional-store/apply-operations.js +20 -0
- package/dist/ecs/database/transactional-store/apply-operations.js.map +1 -0
- package/dist/ecs/database/transactional-store/apply-write-operations.d.ts +7 -0
- package/dist/ecs/database/transactional-store/apply-write-operations.js +20 -0
- package/dist/ecs/database/transactional-store/apply-write-operations.js.map +1 -0
- package/dist/ecs/database/transactional-store/applyWriteOperations.d.ts +7 -0
- package/dist/ecs/database/transactional-store/applyWriteOperations.js +20 -0
- package/dist/ecs/database/transactional-store/applyWriteOperations.js.map +1 -0
- package/dist/ecs/database/transactional-store/coalesce-transactions.d.ts +12 -0
- package/dist/ecs/database/transactional-store/coalesce-transactions.js +151 -0
- package/dist/ecs/database/transactional-store/coalesce-transactions.js.map +1 -0
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.d.ts +1 -0
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.js +356 -0
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.js.map +1 -0
- package/dist/ecs/database/transactional-store/create-transactional-store.js +6 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js +4 -4
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/transaction-options.d.ts +12 -0
- package/dist/ecs/database/transactional-store/transaction-options.js +23 -0
- package/dist/ecs/database/transactional-store/transaction-options.js.map +1 -0
- package/dist/ecs/database/transactional-store/transactional-store.d.ts +7 -1
- package/dist/ecs/database/transactional-store/undoable.d.ts +13 -0
- package/dist/ecs/database/transactional-store/undoable.js +23 -0
- package/dist/ecs/database/transactional-store/undoable.js.map +1 -0
- package/dist/ecs/database/transactional-store/with-undoable.d.ts +10 -0
- package/dist/ecs/database/transactional-store/with-undoable.js +13 -0
- package/dist/ecs/database/transactional-store/with-undoable.js.map +1 -0
- package/dist/ecs/database/undoable.d.ts +8 -0
- package/dist/ecs/database/undoable.js +23 -0
- package/dist/ecs/database/undoable.js.map +1 -0
- package/dist/ecs/database/with-undoable.d.ts +10 -0
- package/dist/ecs/database/with-undoable.js +13 -0
- package/dist/ecs/database/with-undoable.js.map +1 -0
- package/dist/ecs/undo-redo/create-undo-redo-actions.d.ts +10 -0
- package/dist/ecs/undo-redo/create-undo-redo-actions.js +48 -0
- package/dist/ecs/undo-redo/create-undo-redo-actions.js.map +1 -0
- package/dist/ecs/undo-redo/create-undo-redo-actions.test.d.ts +1 -0
- package/dist/ecs/undo-redo/create-undo-redo-actions.test.js +295 -0
- package/dist/ecs/undo-redo/create-undo-redo-actions.test.js.map +1 -0
- package/dist/ecs/undo-redo/do.d.ts +3 -0
- package/dist/ecs/undo-redo/do.js +3 -0
- package/dist/ecs/undo-redo/do.js.map +1 -0
- package/dist/equals.js.map +1 -1
- package/dist/functions/serialization/register-blob-codecs.d.ts +1 -0
- package/dist/functions/serialization/register-blob-codecs.js +10 -0
- package/dist/functions/serialization/register-blob-codecs.js.map +1 -0
- package/dist/functions/serialization/register-typed-array-codecs copy.d.ts +1 -0
- package/dist/functions/serialization/register-typed-array-codecs copy.js +13 -0
- package/dist/functions/serialization/register-typed-array-codecs copy.js.map +1 -0
- package/dist/functions/serialization/serialization.test.js +11 -3
- package/dist/functions/serialization/serialization.test.js.map +1 -1
- package/dist/functions/serialization/serialize.js +0 -1
- package/dist/functions/serialization/serialize.js.map +1 -1
- package/dist/observe/index.d.ts +1 -0
- package/dist/observe/index.js +1 -0
- package/dist/observe/index.js.map +1 -1
- package/dist/observe/observe.test.js +25 -9
- package/dist/observe/observe.test.js.map +1 -1
- package/dist/observe/with-filter.d.ts +6 -0
- package/dist/observe/with-filter.js +15 -0
- package/dist/observe/with-filter.js.map +1 -0
- package/dist/observe/with-filter.test.d.ts +1 -0
- package/dist/observe/with-filter.test.js +70 -0
- package/dist/observe/with-filter.test.js.map +1 -0
- package/dist/observe/with-map copy.d.ts +5 -0
- package/dist/observe/with-map copy.js +14 -0
- package/dist/observe/with-map copy.js.map +1 -0
- package/dist/observe/with-map.d.ts +1 -1
- package/dist/observe/with-map.js +1 -4
- package/dist/observe/with-map.js.map +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/schema.d.ts +4 -1
- package/dist/schema/schema.js.map +1 -1
- package/dist/schema/validation/index.d.ts +2 -0
- package/dist/schema/validation/index.js +24 -0
- package/dist/schema/validation/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typed-buffer/register-typed-buffer-codecs.js.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a new Observe function that converts the original observe functions notify values into a new value at each notification,
|
|
3
|
+
* optionally returning undefined to filter out the value.
|
|
4
|
+
*/
|
|
5
|
+
export function withFilter(observable, filter) {
|
|
6
|
+
return (observer) => {
|
|
7
|
+
return observable((value) => {
|
|
8
|
+
const filtered = filter(value);
|
|
9
|
+
if (filtered !== undefined) {
|
|
10
|
+
observer(filtered);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=with-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-filter.js","sourceRoot":"","sources":["../../src/observe/with-filter.ts"],"names":[],"mappings":"AAuBA;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,UAAsB,EACtB,MAAmC;IAEnC,OAAO,CAAC,QAAQ,EAAE,EAAE;QAClB,OAAO,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACrB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { describe, test, expect } from "vitest";
|
|
23
|
+
import { withFilter } from "./with-filter.js";
|
|
24
|
+
import { fromConstant } from "./from-constant.js";
|
|
25
|
+
describe("withFilter", () => {
|
|
26
|
+
test("should filter out undefined values", () => {
|
|
27
|
+
const observable = fromConstant(5);
|
|
28
|
+
const filtered = withFilter(observable, (value) => value > 3 ? value * 2 : undefined);
|
|
29
|
+
let result;
|
|
30
|
+
filtered((value) => {
|
|
31
|
+
result = value;
|
|
32
|
+
})();
|
|
33
|
+
expect(result).toBe(10);
|
|
34
|
+
});
|
|
35
|
+
test("should filter out all values when filter returns undefined", () => {
|
|
36
|
+
const observable = fromConstant(5);
|
|
37
|
+
const filtered = withFilter(observable, () => undefined);
|
|
38
|
+
let called = false;
|
|
39
|
+
filtered(() => {
|
|
40
|
+
called = true;
|
|
41
|
+
})();
|
|
42
|
+
expect(called).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
test("should pass through values when filter returns non-undefined", () => {
|
|
45
|
+
const observable = fromConstant("hello");
|
|
46
|
+
const filtered = withFilter(observable, (value) => value.length > 3 ? value.toUpperCase() : undefined);
|
|
47
|
+
let result;
|
|
48
|
+
filtered((value) => {
|
|
49
|
+
result = value;
|
|
50
|
+
})();
|
|
51
|
+
expect(result).toBe("HELLO");
|
|
52
|
+
});
|
|
53
|
+
test("should handle mixed filtering in sequence", () => {
|
|
54
|
+
const values = [];
|
|
55
|
+
const observable = (observer) => {
|
|
56
|
+
observer(1);
|
|
57
|
+
observer(2);
|
|
58
|
+
observer(3);
|
|
59
|
+
observer(4);
|
|
60
|
+
observer(5);
|
|
61
|
+
return () => { };
|
|
62
|
+
};
|
|
63
|
+
const filtered = withFilter(observable, (value) => value % 2 === 0 ? value * 2 : undefined);
|
|
64
|
+
filtered((value) => {
|
|
65
|
+
values.push(value);
|
|
66
|
+
})();
|
|
67
|
+
expect(values).toEqual([4, 8]);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=with-filter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-filter.test.js","sourceRoot":"","sources":["../../src/observe/with-filter.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IACxB,IAAI,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAC9C,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CACpC,CAAC;QAEF,IAAI,MAA0B,CAAC;QAC/B,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,MAAM,GAAG,KAAK,CAAC;QACnB,CAAC,CAAC,EAAE,CAAC;QAEL,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAEzD,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,QAAQ,CAAC,GAAG,EAAE;YACV,MAAM,GAAG,IAAI,CAAC;QAClB,CAAC,CAAC,EAAE,CAAC;QAEL,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAC9C,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CACrD,CAAC;QAEF,IAAI,MAA0B,CAAC;QAC/B,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,MAAM,GAAG,KAAK,CAAC;QACnB,CAAC,CAAC,EAAE,CAAC;QAEL,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,CAAC,QAAiC,EAAE,EAAE;YACrD,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;QACrB,CAAC,CAAC;QAEF,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAC9C,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAC1C,CAAC;QAEF,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,EAAE,CAAC;QAEL,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Observe } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new Observe function that converts the original observe functions notify values into a new value at each notification.
|
|
4
|
+
*/
|
|
5
|
+
export declare function withMap<T, U>(observable: Observe<T>, map: (value: T) => U | undefined): Observe<U>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a new Observe function that converts the original observe functions notify values into a new value at each notification.
|
|
3
|
+
*/
|
|
4
|
+
export function withMap(observable, map) {
|
|
5
|
+
return (observer) => {
|
|
6
|
+
return observable((value) => {
|
|
7
|
+
const mapped = map(value);
|
|
8
|
+
if (mapped !== undefined) {
|
|
9
|
+
observer(mapped);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=with-map%20copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-map copy.js","sourceRoot":"","sources":["../../src/observe/with-map copy.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,MAAM,UAAU,OAAO,CACrB,UAAsB,EACtB,GAAgC;IAEhC,OAAO,CAAC,QAAQ,EAAE,EAAE;QAClB,OAAO,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;YAC1B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -2,4 +2,4 @@ import { Observe } from "./types.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Creates a new Observe function that converts the original observe functions notify values into a new value at each notification.
|
|
4
4
|
*/
|
|
5
|
-
export declare function withMap<T, U>(observable: Observe<T>, map: (value: T) => U
|
|
5
|
+
export declare function withMap<T, U>(observable: Observe<T>, map: (value: T) => U): Observe<U>;
|
package/dist/observe/with-map.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-map.js","sourceRoot":"","sources":["../../src/observe/with-map.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,MAAM,UAAU,OAAO,CACrB,UAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"with-map.js","sourceRoot":"","sources":["../../src/observe/with-map.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,MAAM,UAAU,OAAO,CACrB,UAAsB,EACtB,GAAoB;IAEpB,OAAO,CAAC,QAAQ,EAAE,EAAE;QAClB,OAAO,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1B,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { Schema, FromSchema, FromSchemas } from "./schema.js";
|
|
2
2
|
export { Nullable } from "./nullable.js";
|
|
3
3
|
export type { getDynamicSchema } from "./dynamic/index.js";
|
|
4
|
-
export
|
|
4
|
+
export * from "./validation/index.js";
|
|
5
5
|
export { type F32, F32Schema } from "./f32.js";
|
|
6
6
|
export { type I32, I32Schema } from "./i32.js";
|
|
7
7
|
export { type U32, U32Schema } from "./u32.js";
|
package/dist/schema/index.js
CHANGED
|
@@ -20,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
22
|
export { Nullable } from "./nullable.js";
|
|
23
|
-
export
|
|
23
|
+
export * from "./validation/index.js";
|
|
24
24
|
export { F32Schema } from "./f32.js";
|
|
25
25
|
export { I32Schema } from "./i32.js";
|
|
26
26
|
export { U32Schema } from "./u32.js";
|
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAY,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAY,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAY,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAa,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAa,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/schema/schema.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface UIProperties {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
export interface Schema {
|
|
32
|
-
type?: 'number' | 'integer' | 'string' | 'boolean' | 'null' | 'array' | 'object' | 'typed-buffer';
|
|
32
|
+
type?: 'number' | 'integer' | 'string' | 'boolean' | 'null' | 'array' | 'object' | 'typed-buffer' | 'blob';
|
|
33
33
|
conditionals?: readonly Conditional[];
|
|
34
34
|
ui?: UIProperties;
|
|
35
35
|
transient?: boolean;
|
|
@@ -84,6 +84,9 @@ export type FromSchema<T, Depth extends number = 5> = DeepReadonly<Depth extends
|
|
|
84
84
|
} | {
|
|
85
85
|
items: any;
|
|
86
86
|
} ? FromSchemaArray<T, Decrement<Depth>> : T extends {
|
|
87
|
+
type?: undefined;
|
|
88
|
+
default: infer D;
|
|
89
|
+
} ? D : T extends {
|
|
87
90
|
type: 'object';
|
|
88
91
|
} | {
|
|
89
92
|
properties: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAmMX,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrB,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrB,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;KACvB;IACD,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,KAAK;CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
export { validate } from "./validate.js";
|
|
23
|
+
export { withValidation } from "./with-validation.js";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|