@adobe/data 0.2.3 → 0.2.5
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/_/data.d.ts +11 -0
- package/dist/{schemas/index.js → _/data.js} +2 -2
- package/dist/_/data.js.map +1 -0
- package/dist/_/equals.d.ts +11 -0
- package/dist/_/equals.js +73 -0
- package/dist/_/equals.js.map +1 -0
- package/dist/_/equals.test.js +150 -0
- package/dist/_/equals.test.js.map +1 -0
- package/dist/_/index.d.ts +4 -0
- package/dist/{core/schema → _}/index.js +2 -4
- package/dist/_/index.js.map +1 -0
- package/dist/_/is-data.d.ts +11 -0
- package/dist/_/is-data.js +2 -0
- package/dist/_/is-data.js.map +1 -0
- package/dist/_/normalize.d.ts +1 -0
- package/dist/_/normalize.js +34 -0
- package/dist/_/normalize.js.map +1 -0
- package/dist/_/normalize.test.js +48 -0
- package/dist/_/normalize.test.js.map +1 -0
- package/dist/_/schema.test.js +16 -0
- package/dist/_/schema.test.js.map +1 -0
- package/dist/blob-store/blob-store.d.ts +94 -0
- package/dist/blob-store/blob-store.js +194 -0
- package/dist/blob-store/blob-store.js.map +1 -0
- package/dist/blob-store/blob-store.test.js +142 -0
- package/dist/blob-store/blob-store.test.js.map +1 -0
- package/dist/core/IsData.d.ts +6 -0
- package/dist/core/IsData.js +2 -0
- package/dist/core/IsData.js.map +1 -0
- package/dist/core/data.d.ts +1 -12
- package/dist/core/data.js +1 -30
- package/dist/core/data.js.map +1 -1
- package/dist/core/data.test.js +1 -1
- package/dist/core/data.test.js.map +1 -1
- package/dist/core/equals.d.ts +11 -0
- package/dist/core/equals.js +73 -0
- package/dist/core/equals.js.map +1 -0
- package/dist/core/equals.test.js +150 -0
- package/dist/core/equals.test.js.map +1 -0
- package/dist/core/functions/array-equals-shallow.d.ts +1 -0
- package/dist/core/functions/{array-equals.js → array-equals-shallow.js} +2 -2
- package/dist/core/functions/array-equals-shallow.js.map +1 -0
- package/dist/core/functions/deep-assign.d.ts +11 -0
- package/dist/core/functions/deep-assign.js +61 -0
- package/dist/core/functions/deep-assign.js.map +1 -0
- package/dist/core/functions/deep-assign.test.d.ts +1 -0
- package/dist/core/functions/deep-assign.test.js +180 -0
- package/dist/core/functions/deep-assign.test.js.map +1 -0
- package/dist/core/functions/index.d.ts +1 -3
- package/dist/core/functions/index.js +1 -3
- package/dist/core/functions/index.js.map +1 -1
- package/dist/core/functions/memoize-factory.d.ts +1 -0
- package/dist/core/functions/memoize-factory.js +12 -0
- package/dist/core/functions/memoize-factory.js.map +1 -0
- package/dist/core/index.d.ts +4 -3
- package/dist/core/index.js +2 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/is-data.d.ts +11 -0
- package/dist/core/is-data.js +2 -0
- package/dist/core/is-data.js.map +1 -0
- package/dist/core/normalize.d.ts +1 -0
- package/dist/core/normalize.js +34 -0
- package/dist/core/normalize.js.map +1 -0
- package/dist/core/normalize.test.d.ts +1 -0
- package/dist/core/normalize.test.js +48 -0
- package/dist/core/normalize.test.js.map +1 -0
- package/dist/ecs/action-ecs/action-ecs.js +1 -1
- package/dist/ecs/action-ecs/action-ecs.js.map +1 -1
- package/dist/ecs/action-ecs/action-ecs.test.js +4 -3
- package/dist/ecs/action-ecs/action-ecs.test.js.map +1 -1
- package/dist/ecs/action-ecs/action-types.d.ts +3 -3
- package/dist/ecs/action-ecs/index.d.ts +1 -0
- package/dist/ecs/action-ecs/index.js +1 -0
- package/dist/ecs/action-ecs/index.js.map +1 -1
- package/dist/ecs/action-ecs/sequential-action.d.ts +18 -0
- package/dist/{core/schema/validation/validate.js → ecs/action-ecs/sequential-action.js} +21 -14
- package/dist/ecs/action-ecs/sequential-action.js.map +1 -0
- package/dist/ecs/core-components.js +0 -21
- package/dist/ecs/core-components.js.map +1 -1
- package/dist/ecs/core-ecs/core-ecs-serialization.test.js +3 -2
- package/dist/ecs/core-ecs/core-ecs-serialization.test.js.map +1 -1
- package/dist/ecs/core-ecs/core-ecs-types.d.ts +2 -1
- package/dist/ecs/core-ecs/core-ecs.js +2 -2
- package/dist/ecs/core-ecs/core-ecs.js.map +1 -1
- package/dist/ecs/core-ecs/core-ecs.test.js +3 -2
- package/dist/ecs/core-ecs/core-ecs.test.js.map +1 -1
- package/dist/ecs/database/create-database.d.ts +3 -3
- package/dist/ecs/database/create-database.js +12 -11
- package/dist/ecs/database/create-database.js.map +1 -1
- package/dist/ecs/database/create-database.test.js +17 -13
- package/dist/ecs/database/create-database.test.js.map +1 -1
- package/dist/ecs/database/database-schema/create-database-from-schemas.d.ts +15 -0
- package/dist/ecs/database/database-schema/create-database-from-schemas.js +33 -0
- package/dist/ecs/database/database-schema/create-database-from-schemas.js.map +1 -0
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +7 -0
- package/dist/ecs/database/database-schema/create-database-schema.js +5 -0
- package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -0
- package/dist/ecs/database/database-schema/database-schema.d.ts +12 -0
- package/dist/ecs/database/database-schema/database-schema.js +2 -0
- package/dist/ecs/database/database-schema/database-schema.js.map +1 -0
- package/dist/ecs/database/database-schema/index.d.ts +3 -0
- package/dist/ecs/database/database-schema/index.js +3 -0
- package/dist/ecs/database/database-schema/index.js.map +1 -0
- package/dist/ecs/database/database.d.ts +7 -9
- package/dist/ecs/database/index.d.ts +1 -0
- package/dist/ecs/database/index.js +1 -0
- package/dist/ecs/database/index.js.map +1 -1
- package/dist/ecs/database/observe-dependent-value.js.map +1 -1
- 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/transactional-store/create-transactional-store.d.ts +2 -2
- package/dist/ecs/database/transactional-store/create-transactional-store.js +1 -0
- package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js +11 -9
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/transactional-store.d.ts +3 -2
- package/dist/ecs/ecs/ecs-types.d.ts +14 -13
- package/dist/ecs/ecs/ecs.js.map +1 -1
- package/dist/ecs/ecs/ecs.test.js +1 -1
- package/dist/ecs/ecs/ecs.test.js.map +1 -1
- package/dist/ecs/ecs/index.d.ts +0 -1
- package/dist/ecs/ecs/index.js +21 -0
- package/dist/ecs/ecs/index.js.map +1 -1
- package/dist/ecs/index.d.ts +4 -0
- package/dist/ecs/index.js +4 -0
- package/dist/ecs/index.js.map +1 -1
- package/dist/ecs/resource-schemas.d.ts +6 -0
- package/dist/ecs/resource-schemas.js +2 -0
- package/dist/ecs/resource-schemas.js.map +1 -0
- package/dist/ecs/store/components.d.ts +1 -0
- package/dist/{core/schema.js → ecs/store/components.js} +1 -11
- package/dist/ecs/store/components.js.map +1 -0
- package/dist/ecs/store/core/core.d.ts +10 -9
- package/dist/ecs/store/core/core.js +21 -0
- package/dist/ecs/store/core/core.js.map +1 -1
- package/dist/ecs/store/core/create-core.d.ts +1 -2
- package/dist/ecs/store/create-store.d.ts +5 -6
- package/dist/ecs/store/create-store.js +5 -6
- package/dist/ecs/store/create-store.js.map +1 -1
- package/dist/ecs/store/create-store.test.js +21 -21
- package/dist/ecs/store/create-store.test.js.map +1 -1
- package/dist/ecs/store/resource-components copy.d.ts +1 -0
- package/dist/{core/schema/schema.js → ecs/store/resource-components copy.js } +1 -12
- package/dist/ecs/store/resource-components copy.js.map +1 -0
- package/dist/ecs/store/store.d.ts +5 -4
- package/dist/ecs/systems/index.d.ts +2 -0
- package/dist/ecs/systems/index.js +2 -0
- package/dist/ecs/systems/index.js.map +1 -0
- package/dist/ecs/systems/system-phase.d.ts +5 -0
- package/dist/ecs/systems/system-phase.js +16 -0
- package/dist/ecs/systems/system-phase.js.map +1 -0
- package/dist/ecs/systems/system.d.ts +7 -0
- package/dist/ecs/systems/system.js +2 -0
- package/dist/ecs/systems/system.js.map +1 -0
- package/dist/ecs/transaction-ecs/transaction-ecs.js +2 -2
- package/dist/ecs/transaction-ecs/transaction-ecs.js.map +1 -1
- package/dist/ecs/transaction-ecs/transaction-types.d.ts +7 -6
- package/dist/ecs/transaction-ecs/transactions.js.map +1 -1
- package/dist/equalsShallow.d.ts +1 -0
- package/dist/equalsShallow.js +37 -0
- package/dist/equalsShallow.js.map +1 -0
- package/dist/equalsShallow.test.d.ts +1 -0
- package/dist/equalsShallow.test.js +113 -0
- package/dist/equalsShallow.test.js.map +1 -0
- package/dist/functions/apply-args.d.ts +7 -0
- package/dist/functions/apply-args.js +19 -0
- package/dist/functions/apply-args.js.map +1 -0
- package/dist/functions/index.d.ts +1 -0
- package/dist/functions/index.js +2 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/internal/object/mutable-clone.d.ts +5 -0
- package/dist/internal/object/mutable-clone.js +4 -0
- package/dist/internal/object/mutable-clone.js.map +1 -0
- package/dist/internal/typed-array/get-byte-size.d.ts +1 -1
- package/dist/lit/decorators/apply-service-decorators.js +1 -1
- package/dist/lit/decorators/apply-service-decorators.js.map +1 -1
- package/dist/lit/elements/service-application.d.ts +3 -2
- package/dist/lit/elements/service-application.js +10 -6
- package/dist/lit/elements/service-application.js.map +1 -1
- package/dist/lit/elements/service-element.d.ts +1 -1
- package/dist/lit/elements/service-element.js +2 -2
- package/dist/lit/elements/service-element.js.map +1 -1
- package/dist/old-ecs/ecs/ecs-where-cache.test.d.ts +1 -0
- package/dist/old-ecs/ecs/ecs-where-cache.test.js +164 -0
- package/dist/old-ecs/ecs/ecs-where-cache.test.js.map +1 -0
- package/dist/package.json +24 -24
- package/dist/schema/FromSchema.d.ts +25 -0
- package/dist/schema/FromSchema.js +2 -0
- package/dist/schema/FromSchema.js.map +1 -0
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/schema.d.ts +6 -0
- package/dist/schema/schema.js.map +1 -1
- package/dist/service/isService.d.ts +2 -0
- package/dist/service/isService.js +5 -0
- package/dist/service/isService.js.map +1 -0
- package/dist/table/copy-column-to-gpu-buffer.d.ts +5 -0
- package/dist/table/copy-column-to-gpu-buffer.js +26 -0
- package/dist/table/copy-column-to-gpu-buffer.js.map +1 -0
- package/dist/table/copy-to-gpu-buffer.d.ts +2 -0
- package/dist/table/copy-to-gpu-buffer.js +16 -0
- package/dist/table/copy-to-gpu-buffer.js.map +1 -0
- package/dist/table/create-composite-table.d.ts +5 -0
- package/dist/table/create-composite-table.js +20 -0
- package/dist/table/create-composite-table.js.map +1 -0
- package/dist/table/create-table.test.d.ts +1 -0
- package/dist/{core/schema/validation/is-valid.test.js → table/create-table.test.js} +17 -16
- package/dist/table/create-table.test.js.map +1 -0
- package/dist/table/index.d.ts +1 -0
- package/dist/table/index.js +1 -0
- package/dist/table/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typed-buffer/copy-to-gpu-buffer.js +1 -1
- package/dist/typed-buffer/copy-to-gpu-buffer.js.map +1 -1
- package/dist/typed-buffer/create-array-buffer.js +7 -2
- package/dist/typed-buffer/create-array-buffer.js.map +1 -1
- package/dist/typed-buffer/create-composite-buffer.d.ts +2 -0
- package/dist/typed-buffer/create-composite-buffer.js +85 -0
- package/dist/typed-buffer/create-composite-buffer.js.map +1 -0
- package/dist/typed-buffer/create-composite-buffer.test.d.ts +1 -0
- package/dist/typed-buffer/create-composite-buffer.test.js +291 -0
- package/dist/typed-buffer/create-composite-buffer.test.js.map +1 -0
- package/dist/typed-buffer/create-const-buffer.d.ts +2 -0
- package/dist/typed-buffer/create-const-buffer.js +30 -0
- package/dist/typed-buffer/create-const-buffer.js.map +1 -0
- package/dist/typed-buffer/create-const-buffer.test.d.ts +1 -0
- package/dist/typed-buffer/create-const-buffer.test.js +128 -0
- package/dist/typed-buffer/create-const-buffer.test.js.map +1 -0
- package/dist/typed-buffer/create-mapped-buffer.d.ts +6 -0
- package/dist/typed-buffer/create-mapped-buffer.js +32 -0
- package/dist/typed-buffer/create-mapped-buffer.js.map +1 -0
- package/dist/typed-buffer/create-mapped-buffer.test.d.ts +1 -0
- package/dist/typed-buffer/create-mapped-buffer.test.js +202 -0
- package/dist/typed-buffer/create-mapped-buffer.test.js.map +1 -0
- package/dist/typed-buffer/create-number-buffer.js +4 -2
- package/dist/typed-buffer/create-number-buffer.js.map +1 -1
- package/dist/typed-buffer/create-struct-buffer.js +8 -16
- package/dist/typed-buffer/create-struct-buffer.js.map +1 -1
- package/dist/typed-buffer/create-typed-buffer.js +4 -0
- package/dist/typed-buffer/create-typed-buffer.js.map +1 -1
- package/dist/typed-buffer/index.js.map +1 -1
- package/dist/typed-buffer/typed-buffer.d.ts +3 -1
- package/dist/typed-buffer/typed-buffer.test.js +103 -0
- package/dist/typed-buffer/typed-buffer.test.js.map +1 -1
- package/dist/types/array/equalsShallow.d.ts +1 -0
- package/dist/types/array/equalsShallow.js +37 -0
- package/dist/types/array/equalsShallow.js.map +1 -0
- package/dist/types/array/equalsShallow.test.d.ts +1 -0
- package/dist/types/array/equalsShallow.test.js +113 -0
- package/dist/types/array/equalsShallow.test.js.map +1 -0
- package/dist/types/array/index.d.ts +1 -0
- package/dist/types/array/index.js +2 -0
- package/dist/types/array/index.js.map +1 -0
- package/dist/types/array-buffer-like/copy.d.ts +1 -0
- package/dist/types/array-buffer-like/copy.js +469 -0
- package/dist/types/array-buffer-like/copy.js.map +1 -0
- package/dist/types/array-buffer-like/grow.d.ts +1 -0
- package/dist/types/array-buffer-like/grow.js +53 -0
- package/dist/types/array-buffer-like/grow.js.map +1 -0
- package/dist/types/array-buffer-like/index.d.ts +4 -0
- package/dist/types/array-buffer-like/index.js +26 -0
- package/dist/types/array-buffer-like/index.js.map +1 -0
- package/dist/types/array-buffer-like/is-array-buffer.d.ts +1 -0
- package/dist/types/array-buffer-like/is-array-buffer.js +445 -0
- package/dist/types/array-buffer-like/is-array-buffer.js.map +1 -0
- package/dist/types/array-buffer-like/is-shared-array-buffer.d.ts +1 -0
- package/dist/types/array-buffer-like/is-shared-array-buffer.js +445 -0
- package/dist/types/array-buffer-like/is-shared-array-buffer.js.map +1 -0
- package/dist/types/data-view-32/create-data-view-32.d.ts +2 -0
- package/dist/types/data-view-32/create-data-view-32.js +8 -0
- package/dist/types/data-view-32/create-data-view-32.js.map +1 -0
- package/dist/types/data-view-32/data-view-32.d.ts +5 -0
- package/dist/types/data-view-32/data-view-32.js +23 -0
- package/dist/types/data-view-32/data-view-32.js.map +1 -0
- package/dist/types/data-view-32/index.d.ts +2 -0
- package/dist/types/data-view-32/index.js +24 -0
- package/dist/types/data-view-32/index.js.map +1 -0
- package/dist/types/object/index.d.ts +2 -0
- package/dist/types/object/index.js +24 -0
- package/dist/types/object/index.js.map +1 -0
- package/dist/types/object/map-entries.d.ts +5 -0
- package/dist/types/object/map-entries.js +29 -0
- package/dist/types/object/map-entries.js.map +1 -0
- package/dist/types/object/mutable-clone.d.ts +5 -0
- package/dist/types/object/mutable-clone.js +4 -0
- package/dist/types/object/mutable-clone.js.map +1 -0
- package/dist/types/remove-readonly.d.ts +3 -0
- package/dist/types/remove-readonly.js +2 -0
- package/dist/types/remove-readonly.js.map +1 -0
- package/dist/types/table/add-row.d.ts +8 -0
- package/dist/types/table/add-row.js +40 -0
- package/dist/types/table/add-row.js.map +1 -0
- package/dist/types/table/create-table.d.ts +3 -0
- package/dist/types/table/create-table.js +33 -0
- package/dist/types/table/create-table.js.map +1 -0
- package/dist/types/table/delete-row.d.ts +9 -0
- package/dist/types/table/delete-row.js +18 -0
- package/dist/types/table/delete-row.js.map +1 -0
- package/dist/types/table/ensure-capacity.d.ts +2 -0
- package/dist/types/table/ensure-capacity.js +15 -0
- package/dist/types/table/ensure-capacity.js.map +1 -0
- package/dist/types/table/get-row-data.d.ts +3 -0
- package/dist/types/table/get-row-data.js +8 -0
- package/dist/types/table/get-row-data.js.map +1 -0
- package/dist/types/table/index.d.ts +8 -0
- package/dist/types/table/index.js +30 -0
- package/dist/types/table/index.js.map +1 -0
- package/dist/types/table/row-index.d.ts +8 -0
- package/dist/types/table/row-index.js +3 -0
- package/dist/types/table/row-index.js.map +1 -0
- package/dist/types/table/table.d.ts +13 -0
- package/dist/types/table/table.js +2 -0
- package/dist/types/table/table.js.map +1 -0
- package/dist/types/table/update-row.d.ts +8 -0
- package/dist/types/table/update-row.js +12 -0
- package/dist/types/table/update-row.js.map +1 -0
- package/dist/types/typed-array/copy-to-gpu-buffer.d.ts +2 -0
- package/dist/types/typed-array/copy-to-gpu-buffer.js +16 -0
- package/dist/types/typed-array/copy-to-gpu-buffer.js.map +1 -0
- package/dist/types/typed-array/get-byte-size.d.ts +2 -0
- package/dist/types/typed-array/get-byte-size.js +28 -0
- package/dist/types/typed-array/get-byte-size.js.map +1 -0
- package/dist/types/typed-array/index.d.ts +4 -0
- package/dist/types/typed-array/index.js +26 -0
- package/dist/types/typed-array/index.js.map +1 -0
- package/dist/types/typed-array/typed-array-constructer.d.ts +7 -0
- package/dist/types/typed-array/typed-array-constructer.js +2 -0
- package/dist/types/typed-array/typed-array-constructer.js.map +1 -0
- package/dist/types/typed-array/typed-array.d.ts +1 -0
- package/dist/types/typed-array/typed-array.js +23 -0
- package/dist/types/typed-array/typed-array.js.map +1 -0
- package/dist/types/typed-buffer/copy-to-gpu-buffer.d.ts +2 -0
- package/dist/types/typed-buffer/copy-to-gpu-buffer.js +16 -0
- package/dist/types/typed-buffer/copy-to-gpu-buffer.js.map +1 -0
- package/dist/types/typed-buffer/create-array-buffer.d.ts +4 -0
- package/dist/types/typed-buffer/create-array-buffer.js +29 -0
- package/dist/types/typed-buffer/create-array-buffer.js.map +1 -0
- package/dist/types/typed-buffer/create-number-buffer.d.ts +8 -0
- package/dist/types/typed-buffer/create-number-buffer.js +75 -0
- package/dist/types/typed-buffer/create-number-buffer.js.map +1 -0
- package/dist/types/typed-buffer/create-struct-buffer.d.ts +10 -0
- package/dist/types/typed-buffer/create-struct-buffer.js +78 -0
- package/dist/types/typed-buffer/create-struct-buffer.js.map +1 -0
- package/dist/types/typed-buffer/create-typed-buffer.d.ts +7 -0
- package/dist/types/typed-buffer/create-typed-buffer.js +17 -0
- package/dist/types/typed-buffer/create-typed-buffer.js.map +1 -0
- package/dist/types/typed-buffer/index.d.ts +6 -0
- package/dist/types/typed-buffer/index.js +28 -0
- package/dist/types/typed-buffer/index.js.map +1 -0
- package/dist/types/typed-buffer/structs/assert-struct.d.ts +8 -0
- package/dist/types/typed-buffer/structs/assert-struct.js +15 -0
- package/dist/types/typed-buffer/structs/assert-struct.js.map +1 -0
- package/dist/types/typed-buffer/structs/create-read-struct.d.ts +3 -0
- package/dist/types/typed-buffer/structs/create-read-struct.js +62 -0
- package/dist/types/typed-buffer/structs/create-read-struct.js.map +1 -0
- package/dist/types/typed-buffer/structs/create-read-struct.test.d.ts +1 -0
- package/dist/types/typed-buffer/structs/create-read-struct.test.js +189 -0
- package/dist/types/typed-buffer/structs/create-read-struct.test.js.map +1 -0
- package/dist/types/typed-buffer/structs/create-write-struct.d.ts +3 -0
- package/dist/types/typed-buffer/structs/create-write-struct.js +58 -0
- package/dist/types/typed-buffer/structs/create-write-struct.js.map +1 -0
- package/dist/types/typed-buffer/structs/get-field-offset.d.ts +2 -0
- package/dist/types/typed-buffer/structs/get-field-offset.js +14 -0
- package/dist/types/typed-buffer/structs/get-field-offset.js.map +1 -0
- package/dist/types/typed-buffer/structs/get-struct-layout.d.ts +5 -0
- package/dist/types/typed-buffer/structs/get-struct-layout.js +198 -0
- package/dist/types/typed-buffer/structs/get-struct-layout.js.map +1 -0
- package/dist/types/typed-buffer/structs/get-struct-layout.test.d.ts +1 -0
- package/dist/types/typed-buffer/structs/get-struct-layout.test.js +133 -0
- package/dist/types/typed-buffer/structs/get-struct-layout.test.js.map +1 -0
- package/dist/types/typed-buffer/structs/index.d.ts +1 -0
- package/dist/types/typed-buffer/structs/index.js +23 -0
- package/dist/types/typed-buffer/structs/index.js.map +1 -0
- package/dist/types/typed-buffer/structs/read-struct.d.ts +2 -0
- package/dist/types/typed-buffer/structs/read-struct.js +2 -0
- package/dist/types/typed-buffer/structs/read-struct.js.map +1 -0
- package/dist/types/typed-buffer/structs/struct-layout.d.ts +21 -0
- package/dist/types/typed-buffer/structs/struct-layout.js +23 -0
- package/dist/types/typed-buffer/structs/struct-layout.js.map +1 -0
- package/dist/types/typed-buffer/structs/write-struct.d.ts +2 -0
- package/dist/types/typed-buffer/structs/write-struct.js +2 -0
- package/dist/types/typed-buffer/structs/write-struct.js.map +1 -0
- package/dist/types/typed-buffer/structs/write-struct.test.d.ts +1 -0
- package/dist/types/typed-buffer/structs/write-struct.test.js +181 -0
- package/dist/types/typed-buffer/structs/write-struct.test.js.map +1 -0
- package/dist/types/typed-buffer/typed-buffer.d.ts +16 -0
- package/dist/types/typed-buffer/typed-buffer.js +2 -0
- package/dist/types/typed-buffer/typed-buffer.js.map +1 -0
- package/dist/types/typed-buffer/typed-buffer.test.d.ts +1 -0
- package/dist/types/typed-buffer/typed-buffer.test.js +223 -0
- package/dist/types/typed-buffer/typed-buffer.test.js.map +1 -0
- package/dist/types/types.d.ts +5 -2
- package/dist/types/types.js.map +1 -1
- package/dist/ui/decorators/apply-decorator.d.ts +1 -0
- package/dist/ui/decorators/apply-decorator.js +18 -0
- package/dist/ui/decorators/apply-decorator.js.map +1 -0
- package/dist/ui/decorators/apply-service-decorators.d.ts +1 -0
- package/dist/ui/decorators/apply-service-decorators.js +12 -0
- package/dist/ui/decorators/apply-service-decorators.js.map +1 -0
- package/dist/ui/decorators/require-service.d.ts +1 -0
- package/dist/ui/decorators/require-service.js +13 -0
- package/dist/ui/decorators/require-service.js.map +1 -0
- package/dist/ui/elements/index.d.ts +3 -0
- package/dist/ui/elements/index.js +4 -0
- package/dist/ui/elements/index.js.map +1 -0
- package/dist/ui/elements/service-application.d.ts +8 -0
- package/dist/ui/elements/service-application.js +27 -0
- package/dist/ui/elements/service-application.js.map +1 -0
- package/dist/ui/elements/service-context.d.ts +1 -0
- package/dist/ui/elements/service-context.js +3 -0
- package/dist/ui/elements/service-context.js.map +1 -0
- package/dist/ui/elements/service-element.d.ts +6 -0
- package/dist/ui/elements/service-element.js +22 -0
- package/dist/ui/elements/service-element.js.map +1 -0
- package/dist/ui/hooks/component/component.d.ts +9 -0
- package/dist/ui/hooks/component/component.js +2 -0
- package/dist/ui/hooks/component/component.js.map +1 -0
- package/dist/ui/hooks/component/stack.d.ts +6 -0
- package/dist/ui/hooks/component/stack.js +15 -0
- package/dist/ui/hooks/component/stack.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +7 -0
- package/dist/ui/hooks/index.js +9 -0
- package/dist/ui/hooks/index.js.map +1 -0
- package/dist/ui/hooks/use-connected.d.ts +2 -0
- package/dist/ui/hooks/use-connected.js +31 -0
- package/dist/ui/hooks/use-connected.js.map +1 -0
- package/dist/ui/hooks/use-effect.d.ts +3 -0
- package/dist/ui/hooks/use-effect.js +13 -0
- package/dist/ui/hooks/use-effect.js.map +1 -0
- package/dist/ui/hooks/use-element.d.ts +4 -0
- package/dist/ui/hooks/use-element.js +8 -0
- package/dist/ui/hooks/use-element.js.map +1 -0
- package/dist/ui/hooks/use-memo.d.ts +1 -0
- package/dist/ui/hooks/use-memo.js +12 -0
- package/dist/ui/hooks/use-memo.js.map +1 -0
- package/dist/ui/hooks/use-observable-values.d.ts +5 -0
- package/dist/ui/hooks/use-observable-values.js +8 -0
- package/dist/ui/hooks/use-observable-values.js.map +1 -0
- package/dist/ui/hooks/use-observable.d.ts +2 -0
- package/dist/ui/hooks/use-observable.js +12 -0
- package/dist/ui/hooks/use-observable.js.map +1 -0
- package/dist/ui/hooks/use-ref.d.ts +3 -0
- package/dist/ui/hooks/use-ref.js +6 -0
- package/dist/ui/hooks/use-ref.js.map +1 -0
- package/dist/ui/hooks/use-resize-observer.d.ts +10 -0
- package/dist/ui/hooks/use-resize-observer.js +20 -0
- package/dist/ui/hooks/use-resize-observer.js.map +1 -0
- package/dist/ui/hooks/use-state.d.ts +2 -0
- package/dist/ui/hooks/use-state.js +14 -0
- package/dist/ui/hooks/use-state.js.map +1 -0
- package/dist/ui/hooks/use-window-event.d.ts +1 -0
- package/dist/ui/hooks/use-window-event.js +10 -0
- package/dist/ui/hooks/use-window-event.js.map +1 -0
- package/dist/ui/hooks/with-hooks.d.ts +2 -0
- package/dist/ui/hooks/with-hooks.js +15 -0
- package/dist/ui/hooks/with-hooks.js.map +1 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +8 -1
- package/dist/core/functions/array-equals.d.ts +0 -1
- package/dist/core/functions/array-equals.js.map +0 -1
- package/dist/core/functions/with-validation.d.ts +0 -5
- package/dist/core/functions/with-validation.js +0 -38
- package/dist/core/functions/with-validation.js.map +0 -1
- package/dist/core/functions/with-validation.test.js +0 -96
- package/dist/core/functions/with-validation.test.js.map +0 -1
- package/dist/core/schema/dynamic/dynamic-schema.d.ts +0 -27
- package/dist/core/schema/dynamic/dynamic-schema.js +0 -2
- package/dist/core/schema/dynamic/dynamic-schema.js.map +0 -1
- package/dist/core/schema/dynamic/enumerate-patches.d.ts +0 -9
- package/dist/core/schema/dynamic/enumerate-patches.js +0 -50
- package/dist/core/schema/dynamic/enumerate-patches.js.map +0 -1
- package/dist/core/schema/dynamic/enumerate-patches.test.d.ts +0 -134
- package/dist/core/schema/dynamic/enumerate-patches.test.js +0 -209
- package/dist/core/schema/dynamic/enumerate-patches.test.js.map +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.d.ts +0 -5
- package/dist/core/schema/dynamic/get-dynamic-schema.js +0 -26
- package/dist/core/schema/dynamic/get-dynamic-schema.js.map +0 -1
- package/dist/core/schema/dynamic/get-dynamic-schema.test.js +0 -94
- package/dist/core/schema/dynamic/get-dynamic-schema.test.js.map +0 -1
- package/dist/core/schema/dynamic/index.d.ts +0 -1
- package/dist/core/schema/dynamic/index.js +0 -2
- package/dist/core/schema/dynamic/index.js.map +0 -1
- package/dist/core/schema/dynamic/schema-path-value-path.d.ts +0 -5
- package/dist/core/schema/dynamic/schema-path-value-path.js +0 -12
- package/dist/core/schema/dynamic/schema-path-value-path.js.map +0 -1
- package/dist/core/schema/dynamic-schema.d.ts +0 -27
- package/dist/core/schema/dynamic-schema.js +0 -2
- package/dist/core/schema/dynamic-schema.js.map +0 -1
- package/dist/core/schema/index.d.ts +0 -4
- package/dist/core/schema/index.js.map +0 -1
- package/dist/core/schema/schema.d.ts +0 -122
- package/dist/core/schema/schema.js.map +0 -1
- package/dist/core/schema/schemas.d.ts +0 -45
- package/dist/core/schema/schemas.js +0 -39
- package/dist/core/schema/schemas.js.map +0 -1
- package/dist/core/schema/ui-schema.d.ts +0 -25
- package/dist/core/schema/ui-schema.js +0 -2
- package/dist/core/schema/ui-schema.js.map +0 -1
- package/dist/core/schema/validation/is-valid.d.ts +0 -2
- package/dist/core/schema/validation/is-valid.js +0 -14
- package/dist/core/schema/validation/is-valid.js.map +0 -1
- package/dist/core/schema/validation/is-valid.test.js.map +0 -1
- package/dist/core/schema/validation/validate.d.ts +0 -2
- package/dist/core/schema/validation/validate.js.map +0 -1
- package/dist/core/schema/validation/validate.test.js +0 -106
- package/dist/core/schema/validation/validate.test.js.map +0 -1
- package/dist/core/schema/validation/with-validation.d.ts +0 -5
- package/dist/core/schema/validation/with-validation.js +0 -16
- package/dist/core/schema/validation/with-validation.js.map +0 -1
- package/dist/core/schema/validation/with-validation.test.js +0 -96
- package/dist/core/schema/validation/with-validation.test.js.map +0 -1
- package/dist/core/schema.d.ts +0 -86
- package/dist/core/schema.js.map +0 -1
- package/dist/core/schemas.d.ts +0 -45
- package/dist/core/schemas.js +0 -39
- package/dist/core/schemas.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/schemas.d.ts +0 -45
- package/dist/schemas/schemas.js +0 -39
- package/dist/schemas/schemas.js.map +0 -1
- /package/dist/{core/functions/with-validation.test.d.ts → _/equals.test.d.ts} +0 -0
- /package/dist/{core/schema/dynamic/get-dynamic-schema.test.d.ts → _/normalize.test.d.ts} +0 -0
- /package/dist/{core/schema/validation/is-valid.test.d.ts → _/schema.test.d.ts} +0 -0
- /package/dist/{core/schema/validation/validate.test.d.ts → blob-store/blob-store.test.d.ts} +0 -0
- /package/dist/core/{schema/validation/with-validation.test.d.ts → equals.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-element.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,UAAU;IACtB,OAAO,eAAe,CAAC,MAAM,EAAkB,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMemo<T>(calculateValue: () => T, dependencies?: unknown[]): T;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect } from "./use-effect.js";
|
|
2
|
+
import { useState } from "./use-state.js";
|
|
3
|
+
export function useMemo(calculateValue, dependencies = []) {
|
|
4
|
+
const [state, setState] = useState(undefined);
|
|
5
|
+
let currentValue = state;
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
currentValue = calculateValue();
|
|
8
|
+
setState(currentValue);
|
|
9
|
+
}, dependencies);
|
|
10
|
+
return currentValue;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=use-memo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-memo.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-memo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,UAAU,OAAO,CAAI,cAAuB,EAAE,eAA0B,EAAE;IAC5E,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,SAAS,CAAC,CAAC;IAC7D,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,SAAS,CAAC,GAAG,EAAE;QACX,YAAY,GAAG,cAAc,EAAE,CAAC;QAChC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC3B,CAAC,EAAE,YAAY,CAAC,CAAC;IAEjB,OAAO,YAAa,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Observe } from "data/observe";
|
|
2
|
+
import { Data } from "data/data.js";
|
|
3
|
+
export declare function useObservableValues<T extends Record<string, Observe<Data>>>(factory: () => T, deps?: unknown[]): {
|
|
4
|
+
[K in keyof T]: T[K] extends Observe<infer U> ? U : never;
|
|
5
|
+
} | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { fromProperties } from "data/observe";
|
|
2
|
+
import { useMemo } from "./use-memo.js";
|
|
3
|
+
import { useObservable } from "./use-observable.js";
|
|
4
|
+
export function useObservableValues(factory, deps = []) {
|
|
5
|
+
const observable = useMemo(() => fromProperties(factory()), deps);
|
|
6
|
+
return useObservable(observable);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=use-observable-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-observable-values.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-observable-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAW,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,UAAU,mBAAmB,CAAyC,OAAgB,EAAE,OAAkB,EAAE;IAC9G,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAClE,OAAO,aAAa,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useState } from "./use-state.js";
|
|
2
|
+
import { useEffect } from "./use-effect.js";
|
|
3
|
+
export function useObservable(observable) {
|
|
4
|
+
let [value, setValue] = useState(undefined);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
return observable(newValue => {
|
|
7
|
+
setValue(value = newValue);
|
|
8
|
+
});
|
|
9
|
+
}, [observable]);
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=use-observable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-observable.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-observable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,UAAU,aAAa,CAAI,UAAsB;IACnD,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,SAAS,CAAC,CAAC;IAC3D,SAAS,CAAC,GAAG,EAAE;QACX,OAAO,UAAU,CAAC,QAAQ,CAAC,EAAE;YACzB,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACjB,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ref.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,UAAU,MAAM,CAAI,KAAQ;IAC9B,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ResizeInfo {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
entry: ResizeObserverEntry;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Hook to observe element resizes. Calls callback with width, height, and the original entry
|
|
8
|
+
* when the element's size changes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useResizeObserver(onResize: (info: ResizeInfo) => void): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect } from "./use-effect.js";
|
|
2
|
+
import { useElement } from "./use-element.js";
|
|
3
|
+
/**
|
|
4
|
+
* Hook to observe element resizes. Calls callback with width, height, and the original entry
|
|
5
|
+
* when the element's size changes.
|
|
6
|
+
*/
|
|
7
|
+
export function useResizeObserver(onResize) {
|
|
8
|
+
const element = useElement();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const observer = new ResizeObserver(entries => {
|
|
11
|
+
for (const entry of entries) {
|
|
12
|
+
const { width, height } = entry.contentRect;
|
|
13
|
+
onResize({ width, height, entry });
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
observer.observe(element);
|
|
17
|
+
return () => observer.disconnect();
|
|
18
|
+
}, [element, onResize]);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=use-resize-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-resize-observer.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-resize-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ9C;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAoC;IAClE,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE;YAC1C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC1B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC;gBAC5C,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;YACvC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACvC,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component_stack } from "./component/stack";
|
|
2
|
+
export function useState(initial) {
|
|
3
|
+
const component = Component_stack.active();
|
|
4
|
+
const hookIndex = component.hookIndex++;
|
|
5
|
+
const value = component.hooks[hookIndex] ??= (typeof initial === "function" ? initial() : initial);
|
|
6
|
+
return [
|
|
7
|
+
value,
|
|
8
|
+
(newValue) => {
|
|
9
|
+
component.hooks[hookIndex] = newValue;
|
|
10
|
+
component.requestUpdate();
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=use-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-state.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,MAAM,UAAU,QAAQ,CAAI,OAAgB;IACxC,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;IAC3C,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACnG,OAAO;QACH,KAAK;QACL,CAAC,QAAW,EAAE,EAAE;YACZ,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;YACtC,SAAS,CAAC,aAAa,EAAE,CAAC;QAC9B,CAAC;KACJ,CAAC;AAEN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useWindowEvent<K extends keyof WindowEventMap>(event: K, callbackFactory: () => (e: WindowEventMap[K]) => void, deps?: any[]): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useEffect } from "./use-effect.js";
|
|
2
|
+
import { useMemo } from "./use-memo.js";
|
|
3
|
+
export function useWindowEvent(event, callbackFactory, deps = []) {
|
|
4
|
+
const callback = useMemo(callbackFactory, deps);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
window.addEventListener(event, callback);
|
|
7
|
+
return () => window.removeEventListener(event, callback);
|
|
8
|
+
}, [callback]);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=use-window-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-window-event.js","sourceRoot":"","sources":["../../../src/ui/hooks/use-window-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,cAAc,CAC1B,KAAQ,EACR,eAAqD,EACrD,OAAc,EAAE;IAEhB,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IAChD,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACzC,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { Component } from "./component/component.js";
|
|
2
|
+
export declare function withHooks<This extends Component, Args extends any[], Return>(target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(this: This, ...args: Args) => Return>): TypedPropertyDescriptor<(this: This, ...args: Args) => Return>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component_stack } from "./component/stack.js";
|
|
2
|
+
export function withHooks(target, propertyKey, descriptor) {
|
|
3
|
+
const originalMethod = descriptor.value;
|
|
4
|
+
descriptor.value = function (...args) {
|
|
5
|
+
Component_stack.push(this);
|
|
6
|
+
try {
|
|
7
|
+
return originalMethod.apply(this, args);
|
|
8
|
+
}
|
|
9
|
+
finally {
|
|
10
|
+
Component_stack.pop();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return descriptor;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=with-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-hooks.js","sourceRoot":"","sources":["../../../src/ui/hooks/with-hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,UAAU,SAAS,CACrB,MAAc,EACd,WAAmB,EACnB,UAA0E;IAE1E,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;IACzC,UAAU,CAAC,KAAK,GAAG,UAAqB,GAAG,IAAU;QACjD,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC;YACD,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC;gBACO,CAAC;YACL,eAAe,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;IACL,CAAC,CAAA;IACD,OAAO,UAAU,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./hooks/index";
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/data",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Adobe data oriented programming library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": true,
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"*": [
|
|
16
16
|
"./dist/index.d.ts"
|
|
17
17
|
],
|
|
18
|
+
"functions": [
|
|
19
|
+
"./dist/functions/index.d.ts"
|
|
20
|
+
],
|
|
18
21
|
"observe": [
|
|
19
22
|
"./dist/observe/index.d.ts"
|
|
20
23
|
],
|
|
@@ -52,6 +55,10 @@
|
|
|
52
55
|
"import": "./dist/index.js",
|
|
53
56
|
"types": "./dist/index.d.ts"
|
|
54
57
|
},
|
|
58
|
+
"./functions": {
|
|
59
|
+
"import": "./dist/functions/index.js",
|
|
60
|
+
"types": "./dist/functions/index.d.ts"
|
|
61
|
+
},
|
|
55
62
|
"./cache": {
|
|
56
63
|
"import": "./dist/cache/index.js",
|
|
57
64
|
"types": "./dist/cache/index.d.ts"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function arrayEquals(a: unknown[], b: unknown[]): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array-equals.js","sourceRoot":"","sources":["../../../src/core/functions/array-equals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,MAAM,UAAU,WAAW,CAAC,CAAY,EAAE,CAAY;IACpD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACxB,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Schema, FromSchema } from '../../index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a function which can wrap another function and validate the input against a JSON Schema.
|
|
4
|
-
*/
|
|
5
|
-
export declare function withValidation<T extends Schema>(schema: T): <F extends (arg: FromSchema<T>) => any>(fn: F) => F;
|
|
@@ -1,38 +0,0 @@
|
|
|
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 { Validator } from '@cfworker/json-schema';
|
|
23
|
-
/**
|
|
24
|
-
* Creates a function which can wrap another function and validate the input against a JSON Schema.
|
|
25
|
-
*/
|
|
26
|
-
export function withValidation(schema) {
|
|
27
|
-
const validator = new Validator(schema);
|
|
28
|
-
return function (fn) {
|
|
29
|
-
return function (arg) {
|
|
30
|
-
const validation = validator.validate(arg);
|
|
31
|
-
if (!validation.valid) {
|
|
32
|
-
throw new Error(`Validation failed: ${JSON.stringify(validation.errors)}`);
|
|
33
|
-
}
|
|
34
|
-
return fn.call(this, arg);
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=with-validation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-validation.js","sourceRoot":"","sources":["../../../src/core/functions/with-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,SAAS,EAAwB,MAAM,uBAAuB,CAAC;AAGxE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAmB,MAAS;IACtD,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,MAAoB,CAAC,CAAC;IAEtD,OAAO,UAAiD,EAAK;QACzD,OAAO,UAAqB,GAAkB;YAC1C,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAE3C,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CACX,sBAAsB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAC5D,CAAC;YACN,CAAC;YAED,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9B,CAAM,CAAC;IACX,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
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, it, expect } from 'vitest';
|
|
23
|
-
import { withValidation } from './with-validation.js';
|
|
24
|
-
// Define a test schema
|
|
25
|
-
const userSchema = {
|
|
26
|
-
type: 'object',
|
|
27
|
-
properties: {
|
|
28
|
-
name: { type: 'string' },
|
|
29
|
-
age: { type: 'number' },
|
|
30
|
-
foo: { type: 'string' },
|
|
31
|
-
email: { type: 'string', format: 'email' }
|
|
32
|
-
},
|
|
33
|
-
required: ['name', 'age', 'email']
|
|
34
|
-
};
|
|
35
|
-
describe('withValidation', () => {
|
|
36
|
-
it('should pass validation for valid input', () => {
|
|
37
|
-
const createUser = withValidation(userSchema)((user) => user);
|
|
38
|
-
const validUser = {
|
|
39
|
-
name: 'John Doe',
|
|
40
|
-
age: 30,
|
|
41
|
-
email: 'john@example.com'
|
|
42
|
-
};
|
|
43
|
-
expect(() => createUser(validUser)).not.toThrow();
|
|
44
|
-
expect(createUser(validUser)).toEqual(validUser);
|
|
45
|
-
});
|
|
46
|
-
it('should throw error for invalid input', () => {
|
|
47
|
-
const createUser = withValidation(userSchema)((user) => user);
|
|
48
|
-
const invalidUser = {
|
|
49
|
-
name: 'John Doe',
|
|
50
|
-
age: '30', // Should be a number
|
|
51
|
-
email: 'not-an-email'
|
|
52
|
-
};
|
|
53
|
-
expect(() => createUser(invalidUser)).toThrow(/Validation failed/);
|
|
54
|
-
});
|
|
55
|
-
it('should throw error for missing required fields', () => {
|
|
56
|
-
const createUser = withValidation(userSchema)((user) => user);
|
|
57
|
-
const incompleteUser = {
|
|
58
|
-
name: 'John Doe',
|
|
59
|
-
// Missing age and email
|
|
60
|
-
};
|
|
61
|
-
expect(() => createUser(incompleteUser)).toThrow(/Validation failed/);
|
|
62
|
-
});
|
|
63
|
-
it('should preserve function return type', () => {
|
|
64
|
-
const processUser = withValidation(userSchema)((user) => ({
|
|
65
|
-
...user,
|
|
66
|
-
processed: true
|
|
67
|
-
}));
|
|
68
|
-
const result = processUser({
|
|
69
|
-
name: 'John Doe',
|
|
70
|
-
age: 30,
|
|
71
|
-
email: 'john@example.com'
|
|
72
|
-
});
|
|
73
|
-
expect(result).toEqual({
|
|
74
|
-
name: 'John Doe',
|
|
75
|
-
age: 30,
|
|
76
|
-
email: 'john@example.com',
|
|
77
|
-
processed: true
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
it("should pass 'this' context to the wrapped function", () => {
|
|
81
|
-
const context = { value: 42 };
|
|
82
|
-
const fn = function (user) {
|
|
83
|
-
return this.value;
|
|
84
|
-
};
|
|
85
|
-
const wrapped = withValidation(userSchema)(fn);
|
|
86
|
-
const validUser = {
|
|
87
|
-
name: 'Jane Doe',
|
|
88
|
-
age: 25,
|
|
89
|
-
email: 'jane@example.com'
|
|
90
|
-
};
|
|
91
|
-
// Bind context and call
|
|
92
|
-
const result = wrapped.call(context, validUser);
|
|
93
|
-
expect(result).toBe(42);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=with-validation.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-validation.test.js","sourceRoot":"","sources":["../../../src/core/functions/with-validation.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,uBAAuB;AACvB,MAAM,UAAU,GAAG;IACf,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;KAC7C;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEX,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAC9C,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,IAAmC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;QAE7F,MAAM,SAAS,GAAG;YACd,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,EAAE;YACP,KAAK,EAAE,kBAAkB;SAC5B,CAAC;QAEF,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QAClD,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,IAAmC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;QAE7F,MAAM,WAAW,GAAG;YAChB,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,IAAI,EAAE,qBAAqB;YAChC,KAAK,EAAE,cAAc;SACxB,CAAC;QAEF,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,WAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACtD,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,IAAmC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;QAE7F,MAAM,cAAc,GAAG;YACnB,IAAI,EAAE,UAAU;YAChB,wBAAwB;SAC3B,CAAC;QAEF,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,cAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,CAC1C,CAAC,IAAmC,EAAE,EAAE,CAAC,CAAC;YACtC,GAAG,IAAI;YACP,SAAS,EAAE,IAAI;SAClB,CAAC,CACL,CAAC;QAEF,MAAM,MAAM,GAAG,WAAW,CAAC;YACvB,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,EAAE;YACP,KAAK,EAAE,kBAAkB;SAC5B,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,EAAE;YACP,KAAK,EAAE,kBAAkB;YACzB,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC1D,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QAC9B,MAAM,EAAE,GAAG,UAAgC,IAAmC;YAC1E,OAAO,IAAI,CAAC,KAAK,CAAC;QACtB,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG;YACd,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,EAAE;YACP,KAAK,EAAE,kBAAkB;SAC5B,CAAC;QACF,wBAAwB;QACxB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Data } from "../../../index.js";
|
|
2
|
-
import { Schema } from "../schema.js";
|
|
3
|
-
type JSONPath = string;
|
|
4
|
-
type JSONMergePatch = Data;
|
|
5
|
-
/**
|
|
6
|
-
* Conditional patch applied to the path when the enclosing schema branch is active
|
|
7
|
-
* and `match` is not present or validates against the root.
|
|
8
|
-
*/
|
|
9
|
-
export interface Conditional {
|
|
10
|
-
readonly match?: Schema;
|
|
11
|
-
readonly path: JSONPath;
|
|
12
|
-
readonly value: JSONMergePatch;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A Dynamic Schema extends a base schema with conditional behaviour
|
|
16
|
-
* based upon the current state of the data the schema describes.
|
|
17
|
-
*/
|
|
18
|
-
export type DynamicSchema<B extends Schema> = B & {
|
|
19
|
-
readonly conditionals?: readonly Conditional[];
|
|
20
|
-
readonly items?: DynamicSchema<B>;
|
|
21
|
-
readonly properties?: {
|
|
22
|
-
readonly [key: string]: DynamicSchema<B>;
|
|
23
|
-
};
|
|
24
|
-
readonly additionalProperties?: boolean | DynamicSchema<B>;
|
|
25
|
-
readonly oneOf?: readonly DynamicSchema<B>[];
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-schema.js","sourceRoot":"","sources":["../../../../src/core/schema/dynamic/dynamic-schema.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Schema } from "../schema.js";
|
|
2
|
-
import { PathComponent } from "jsonpath";
|
|
3
|
-
export type EnumeratePatch = {
|
|
4
|
-
/** The path to the target node. */
|
|
5
|
-
path: PathComponent[];
|
|
6
|
-
/** The fragment that will be patched into the target. */
|
|
7
|
-
fragment: unknown;
|
|
8
|
-
};
|
|
9
|
-
export declare function enumeratePatches(currentSchema: Schema, currentValue: unknown, rootValue?: unknown, rootSchema?: Schema, currentPath?: PathComponent[], localPath?: PathComponent[]): Generator<EnumeratePatch>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import jp from "jsonpath";
|
|
2
|
-
import { isValid } from "../validation/is-valid.js";
|
|
3
|
-
export function* enumeratePatches(currentSchema, currentValue, rootValue = currentValue, rootSchema = currentSchema, currentPath = ["$"], localPath = ["$"]) {
|
|
4
|
-
if (currentValue === undefined || currentValue === null) {
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
// local conditionals
|
|
8
|
-
for (const c of currentSchema.conditionals ?? []) {
|
|
9
|
-
// get the value of the current path
|
|
10
|
-
const localValue = jp.value(rootValue, jp.stringify(localPath));
|
|
11
|
-
// if (currentSchema.conditionals) {
|
|
12
|
-
// console.log("enumeratePatches", JSON.stringify(c, null, 2));
|
|
13
|
-
// // console.log("currentPath", currentPath);
|
|
14
|
-
// // console.log("localPath", localPath);
|
|
15
|
-
// console.log("localValue", localValue);
|
|
16
|
-
// }
|
|
17
|
-
if (!c.match || isValid(c.match, localValue)) {
|
|
18
|
-
// jsonpath.query returns *values*, not references to
|
|
19
|
-
// the parent object. We use jp.paths to get the JSONPaths
|
|
20
|
-
// of selected nodes, then query again to fetch each node.
|
|
21
|
-
for (const p of jp.paths(rootSchema, c.path)) {
|
|
22
|
-
yield { path: p, fragment: c.value };
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
// recurse
|
|
27
|
-
// items
|
|
28
|
-
if (currentSchema.items && Array.isArray(currentValue)) {
|
|
29
|
-
for (const [i, childSchema] of Object.entries(currentSchema.items)) {
|
|
30
|
-
for (const val of currentValue) {
|
|
31
|
-
yield* enumeratePatches(childSchema, val, rootValue, rootSchema, [...currentPath, "items", i], [...localPath, i]);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// properties
|
|
36
|
-
if (currentSchema.properties && typeof currentValue === "object") {
|
|
37
|
-
for (const [k, childSchema] of Object.entries(currentSchema.properties)) {
|
|
38
|
-
yield* enumeratePatches(childSchema, currentValue[k], rootValue, rootSchema, [...currentPath, "properties", k], [...localPath, k]);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// oneOf
|
|
42
|
-
if (currentSchema.oneOf?.length) {
|
|
43
|
-
for (const branch of currentSchema.oneOf) {
|
|
44
|
-
if (isValid(branch, currentValue)) {
|
|
45
|
-
yield* enumeratePatches(branch, currentValue, rootValue, rootSchema, [...currentPath, "oneOf"], [...localPath]);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=enumerate-patches.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enumerate-patches.js","sourceRoot":"","sources":["../../../../src/core/schema/dynamic/enumerate-patches.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AASpD,MAAM,SAAS,CAAC,CAAC,gBAAgB,CAC7B,aAAqB,EACrB,YAAqB,EACrB,YAAqB,YAAY,EACjC,aAAqB,aAAa,EAClC,cAA+B,CAAC,GAAG,CAAC,EACpC,YAA6B,CAAC,GAAG,CAAC;IAElC,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QACtD,OAAO;IACX,CAAC;IACD,qBAAqB;IACrB,KAAK,MAAM,CAAC,IAAI,aAAa,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC;QAC/C,oCAAoC;QACpC,MAAM,UAAU,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QAChE,oCAAoC;QACpC,mEAAmE;QACnE,kDAAkD;QAClD,8CAA8C;QAC9C,6CAA6C;QAC7C,IAAI;QACJ,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;YAC3C,qDAAqD;YACrD,2DAA2D;YAC3D,0DAA0D;YAC1D,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3C,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;YACzC,CAAC;QACL,CAAC;IACL,CAAC;IAED,UAAU;IAEV,QAAQ;IACR,IAAI,aAAa,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACrD,KAAK,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YACjE,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;gBAC7B,KAAK,CAAC,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,GAAG,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YACtH,CAAC;QACL,CAAC;IACL,CAAC;IAED,aAAa;IACb,IAAI,aAAa,CAAC,UAAU,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC/D,KAAK,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;YACtE,KAAK,CAAC,CAAC,gBAAgB,CAAC,WAAW,EAAG,YAAoB,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,GAAG,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;QAChJ,CAAC;IACL,CAAC;IAED,SAAS;IACT,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QAC9B,KAAK,MAAM,MAAM,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;YACvC,IAAI,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC;gBAChC,KAAK,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,GAAG,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;YACpH,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
export declare const PersonSchema: {
|
|
2
|
-
readonly type: "object";
|
|
3
|
-
readonly properties: {
|
|
4
|
-
readonly name: {
|
|
5
|
-
readonly type: "string";
|
|
6
|
-
readonly ui: {
|
|
7
|
-
readonly name: "Name";
|
|
8
|
-
readonly placeholder: "John Doe";
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
readonly age: {
|
|
12
|
-
readonly type: "number";
|
|
13
|
-
readonly default: 30;
|
|
14
|
-
readonly minimum: 0;
|
|
15
|
-
readonly maximum: 100;
|
|
16
|
-
readonly ui: {
|
|
17
|
-
readonly name: "Age";
|
|
18
|
-
};
|
|
19
|
-
readonly conditionals: readonly [{
|
|
20
|
-
readonly path: "$.properties.email.ui";
|
|
21
|
-
readonly value: {
|
|
22
|
-
readonly visible: false;
|
|
23
|
-
};
|
|
24
|
-
readonly match: {
|
|
25
|
-
readonly exclusiveMaximum: 18;
|
|
26
|
-
};
|
|
27
|
-
}];
|
|
28
|
-
};
|
|
29
|
-
readonly email: {
|
|
30
|
-
readonly type: "string";
|
|
31
|
-
readonly ui: {
|
|
32
|
-
readonly name: "Email";
|
|
33
|
-
readonly placeholder: "john.doe@example.com";
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
readonly additionalProperties: false;
|
|
38
|
-
};
|
|
39
|
-
export declare const PersonSchemaWithOneOf: {
|
|
40
|
-
readonly type: "object";
|
|
41
|
-
readonly properties: {
|
|
42
|
-
readonly name: {
|
|
43
|
-
readonly type: "string";
|
|
44
|
-
readonly ui: {
|
|
45
|
-
readonly name: "Name";
|
|
46
|
-
readonly placeholder: "John Doe";
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
readonly species: {
|
|
50
|
-
readonly type: "string";
|
|
51
|
-
readonly oneOf: readonly [{
|
|
52
|
-
readonly const: "human";
|
|
53
|
-
readonly conditionals: readonly [{
|
|
54
|
-
readonly path: "$.properties.email.ui";
|
|
55
|
-
readonly value: {
|
|
56
|
-
readonly visible: true;
|
|
57
|
-
};
|
|
58
|
-
}];
|
|
59
|
-
}, {
|
|
60
|
-
readonly const: "robot";
|
|
61
|
-
readonly conditionals: readonly [{
|
|
62
|
-
readonly path: "$.properties.email.ui";
|
|
63
|
-
readonly value: {
|
|
64
|
-
readonly enabled: false;
|
|
65
|
-
};
|
|
66
|
-
}];
|
|
67
|
-
}];
|
|
68
|
-
};
|
|
69
|
-
readonly email: {
|
|
70
|
-
readonly type: "string";
|
|
71
|
-
readonly ui: {
|
|
72
|
-
readonly name: "Email";
|
|
73
|
-
readonly placeholder: "john.doe@example.com";
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
readonly additionalProperties: false;
|
|
78
|
-
};
|
|
79
|
-
export declare const PersonSchemaRootConditions: {
|
|
80
|
-
readonly type: "object";
|
|
81
|
-
readonly properties: {
|
|
82
|
-
readonly name: {
|
|
83
|
-
readonly type: "string";
|
|
84
|
-
readonly ui: {
|
|
85
|
-
readonly name: "Name";
|
|
86
|
-
readonly placeholder: "John Doe";
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
readonly species: {
|
|
90
|
-
readonly type: "string";
|
|
91
|
-
readonly oneOf: readonly [{
|
|
92
|
-
readonly const: "human";
|
|
93
|
-
}, {
|
|
94
|
-
readonly const: "robot";
|
|
95
|
-
}];
|
|
96
|
-
};
|
|
97
|
-
readonly email: {
|
|
98
|
-
readonly type: "string";
|
|
99
|
-
readonly ui: {
|
|
100
|
-
readonly name: "Email";
|
|
101
|
-
readonly placeholder: "john.doe@example.com";
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
readonly conditionals: readonly [{
|
|
106
|
-
readonly path: "$.properties.email.ui";
|
|
107
|
-
readonly value: {
|
|
108
|
-
readonly visible: false;
|
|
109
|
-
};
|
|
110
|
-
readonly match: {
|
|
111
|
-
readonly properties: {
|
|
112
|
-
readonly name: {
|
|
113
|
-
readonly maxLength: 2;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
}, {
|
|
118
|
-
readonly path: "$.properties.email.ui";
|
|
119
|
-
readonly value: {
|
|
120
|
-
readonly visible: true;
|
|
121
|
-
};
|
|
122
|
-
readonly match: {
|
|
123
|
-
readonly properties: {
|
|
124
|
-
readonly name: {
|
|
125
|
-
readonly minLength: 3;
|
|
126
|
-
};
|
|
127
|
-
readonly species: {
|
|
128
|
-
readonly const: "human";
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
}];
|
|
133
|
-
readonly additionalProperties: false;
|
|
134
|
-
};
|