@adobe/data 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/assembly/index.wasm.map +1 -1
- package/assembly-test/assembly.test.js +1 -21
- package/assembly-test/assembly.test.js.map +1 -1
- package/blob/blob-handle.js +1 -21
- package/blob/blob-handle.js.map +1 -1
- package/blob/blob-meta.js.map +1 -1
- package/blob/index.js +1 -21
- package/blob/index.js.map +1 -1
- package/cache/async-cache.js +1 -21
- package/cache/async-cache.js.map +1 -1
- package/cache/blob-store.js +1 -21
- package/cache/blob-store.js.map +1 -1
- package/cache/blob-store.test.js +1 -21
- package/cache/blob-store.test.js.map +1 -1
- package/cache/data-cache.js.map +1 -1
- package/cache/data-cache.test.js +1 -21
- package/cache/data-cache.test.js.map +1 -1
- package/cache/expiring-data-cache.js +1 -21
- package/cache/expiring-data-cache.js.map +1 -1
- package/cache/expiring-data-cache.test.js +1 -21
- package/cache/expiring-data-cache.test.js.map +1 -1
- package/cache/fallback-async-cache.js.map +1 -1
- package/cache/functions/async-data-function.js +1 -21
- package/cache/functions/async-data-function.js.map +1 -1
- package/cache/functions/functions.test.js +1 -21
- package/cache/functions/functions.test.js.map +1 -1
- package/cache/functions/get-cached.js +1 -21
- package/cache/functions/get-cached.js.map +1 -1
- package/cache/functions/get-cached.test.js +1 -21
- package/cache/functions/get-cached.test.js.map +1 -1
- package/cache/functions/hashing/array-buffer-to-hex.js +1 -21
- package/cache/functions/hashing/array-buffer-to-hex.js.map +1 -1
- package/cache/functions/hashing/blob-to-hash.js +1 -21
- package/cache/functions/hashing/blob-to-hash.js.map +1 -1
- package/cache/functions/hashing/buffer-to-hash.js +1 -21
- package/cache/functions/hashing/buffer-to-hash.js.map +1 -1
- package/cache/functions/hashing/hashing.test.js +1 -21
- package/cache/functions/hashing/hashing.test.js.map +1 -1
- package/cache/functions/hashing/index.js +1 -21
- package/cache/functions/hashing/index.js.map +1 -1
- package/cache/functions/hashing/json-to-hash.js +1 -21
- package/cache/functions/hashing/json-to-hash.js.map +1 -1
- package/cache/functions/hashing/string-to-hash.js +1 -21
- package/cache/functions/hashing/string-to-hash.js.map +1 -1
- package/cache/functions/index.js +1 -21
- package/cache/functions/index.js.map +1 -1
- package/cache/functions/memoize.js +1 -21
- package/cache/functions/memoize.js.map +1 -1
- package/cache/functions/prevent-parallel-execution.js.map +1 -1
- package/cache/get-persistent-cache.js.map +1 -1
- package/cache/index.js +1 -21
- package/cache/index.js.map +1 -1
- package/cache/managed-array.js.map +1 -1
- package/cache/managed-async-cache.browser.test.js +1 -21
- package/cache/managed-async-cache.browser.test.js.map +1 -1
- package/cache/managed-async-cache.js.map +1 -1
- package/cache/memory-allocator.js +1 -21
- package/cache/memory-allocator.js.map +1 -1
- package/cache/memory-async-cache.js.map +1 -1
- package/data.js +1 -21
- package/data.js.map +1 -1
- package/ecs/archetype/archetype.js.map +1 -1
- package/ecs/archetype/create-archetype.js +1 -21
- package/ecs/archetype/create-archetype.js.map +1 -1
- package/ecs/archetype/create-archetype.test.js +1 -21
- package/ecs/archetype/create-archetype.test.js.map +1 -1
- package/ecs/archetype/delete-row.js +1 -21
- package/ecs/archetype/delete-row.js.map +1 -1
- package/ecs/archetype/delete-row.test.js +1 -21
- package/ecs/archetype/delete-row.test.js.map +1 -1
- package/ecs/archetype/index.js +1 -21
- package/ecs/archetype/index.js.map +1 -1
- package/ecs/database/calculate-system-order.js +1 -21
- package/ecs/database/calculate-system-order.js.map +1 -1
- package/ecs/database/calculate-system-order.test.js +1 -21
- package/ecs/database/calculate-system-order.test.js.map +1 -1
- package/ecs/database/combine-plugins-test.d.ts +39 -0
- package/ecs/database/combine-plugins-test.js +3 -0
- package/ecs/database/combine-plugins-test.js.map +1 -0
- package/ecs/database/combine-plugins.d.ts +11 -8
- package/ecs/database/combine-plugins.js +3 -23
- package/ecs/database/combine-plugins.js.map +1 -1
- package/ecs/database/create-plugin-cryos-pattern.test.d.ts +3 -0
- package/ecs/database/create-plugin-cryos-pattern.test.js +83 -0
- package/ecs/database/create-plugin-cryos-pattern.test.js.map +1 -0
- package/ecs/database/create-plugin-graphics.test.d.ts +93 -0
- package/ecs/database/create-plugin-graphics.test.js +135 -0
- package/ecs/database/create-plugin-graphics.test.js.map +1 -0
- package/ecs/database/create-plugin-type.type-test.js +563 -0
- package/ecs/database/create-plugin-type.type-test.js.map +1 -0
- package/ecs/database/create-plugin-type.type.test.js +563 -0
- package/ecs/database/create-plugin-type.type.test.js.map +1 -0
- package/ecs/database/create-plugin.d.ts +34 -2
- package/ecs/database/create-plugin.js +54 -23
- package/ecs/database/create-plugin.js.map +1 -1
- package/ecs/database/create-plugin.test.js +64 -39
- package/ecs/database/create-plugin.test.js.map +1 -1
- package/ecs/database/create-plugin.type-test.js +27 -31
- package/ecs/database/create-plugin.type-test.js.map +1 -1
- package/ecs/database/database-schema/create-database-schema-test.js +1 -21
- package/ecs/database/database-schema/create-database-schema-test.js.map +1 -1
- package/ecs/database/database-schema/create-database-schema.js +1 -21
- package/ecs/database/database-schema/create-database-schema.js.map +1 -1
- package/ecs/database/database-schema/database-schema.js +1 -21
- package/ecs/database/database-schema/database-schema.js.map +1 -1
- package/ecs/database/database-schema/index.js +1 -21
- package/ecs/database/database-schema/index.js.map +1 -1
- package/ecs/database/database.d.ts +11 -6
- package/ecs/database/database.js +4 -21
- package/ecs/database/database.js.map +1 -1
- package/ecs/database/database.test.js +6 -27
- package/ecs/database/database.test.js.map +1 -1
- package/ecs/database/experimental-action-types.js +275 -0
- package/ecs/database/experimental-action-types.js.map +1 -0
- package/ecs/database/from-plugin.type-test.js +180 -0
- package/ecs/database/from-plugin.type-test.js.map +1 -0
- package/ecs/database/index.js +1 -21
- package/ecs/database/index.js.map +1 -1
- package/ecs/database/observe-dependent-value.js +1 -21
- package/ecs/database/observe-dependent-value.js.map +1 -1
- package/ecs/database/observe-dependent-value.test.js +1 -21
- package/ecs/database/observe-dependent-value.test.js.map +1 -1
- package/ecs/database/observe-select-entities.js +1 -21
- package/ecs/database/observe-select-entities.js.map +1 -1
- package/ecs/database/observe-select-entities.performance.test.js +1 -21
- package/ecs/database/observe-select-entities.performance.test.js.map +1 -1
- package/ecs/database/observe-select-entities.test.js +1 -21
- package/ecs/database/observe-select-entities.test.js.map +1 -1
- package/ecs/database/observed/create-observed-database.js +1 -17
- package/ecs/database/observed/create-observed-database.js.map +1 -1
- package/ecs/database/observed/create-observed-database.test.js +1 -0
- package/ecs/database/observed/create-observed-database.test.js.map +1 -1
- package/ecs/database/observed/observed-database.js +1 -17
- package/ecs/database/observed/observed-database.js.map +1 -1
- package/ecs/database/plugin-types.js +5 -0
- package/ecs/database/plugin-types.js.map +1 -0
- package/ecs/database/public/create-database-from-schema.test.js +1 -21
- package/ecs/database/public/create-database-from-schema.test.js.map +1 -1
- package/ecs/database/public/create-database-scheduler.test.js +8 -23
- package/ecs/database/public/create-database-scheduler.test.js.map +1 -1
- package/ecs/database/public/create-database.d.ts +4 -5
- package/ecs/database/public/create-database.js +39 -183
- package/ecs/database/public/create-database.js.map +1 -1
- package/ecs/database/public/create-database.test.js +34 -21
- package/ecs/database/public/create-database.test.js.map +1 -1
- package/ecs/database/public/create-database.type-test.js +160 -0
- package/ecs/database/public/create-database.type-test.js.map +1 -0
- package/ecs/database/public/index.js +1 -20
- package/ecs/database/public/index.js.map +1 -1
- package/ecs/database/reconciling/create-reconciling-database.js +1 -20
- package/ecs/database/reconciling/create-reconciling-database.js.map +1 -1
- package/ecs/database/reconciling/create-reconciling-database.test.js +1 -0
- package/ecs/database/reconciling/create-reconciling-database.test.js.map +1 -1
- package/ecs/database/reconciling/reconciling-database.js +1 -20
- package/ecs/database/reconciling/reconciling-database.js.map +1 -1
- package/ecs/database/reconciling/reconciling-entry.js +1 -20
- package/ecs/database/reconciling/reconciling-entry.js.map +1 -1
- package/ecs/database/transactional-store/apply-operations.js.map +1 -1
- package/ecs/database/transactional-store/coalesce-actions.js +1 -21
- package/ecs/database/transactional-store/coalesce-actions.js.map +1 -1
- package/ecs/database/transactional-store/coalesce-actions.test.js +1 -21
- package/ecs/database/transactional-store/coalesce-actions.test.js.map +1 -1
- package/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/ecs/database/transactional-store/create-transactional-store.test.js +1 -21
- package/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
- package/ecs/database/transactional-store/index.js +1 -21
- package/ecs/database/transactional-store/index.js.map +1 -1
- package/ecs/database/transactional-store/patch-entity-values.js.map +1 -1
- package/ecs/database/transactional-store/transaction-options.js +1 -21
- package/ecs/database/transactional-store/transaction-options.js.map +1 -1
- package/ecs/database/transactional-store/transactional-store.js +1 -21
- package/ecs/database/transactional-store/transactional-store.js.map +1 -1
- package/ecs/database/type-inference-example.js +1 -0
- package/ecs/database/type-inference-example.js.map +1 -1
- package/ecs/database/type-investigation.test.js +54 -0
- package/ecs/database/type-investigation.test.js.map +1 -0
- package/ecs/database/undoable.js +1 -21
- package/ecs/database/undoable.js.map +1 -1
- package/ecs/entity-location-table/create-entity-location-table.js +1 -21
- package/ecs/entity-location-table/create-entity-location-table.js.map +1 -1
- package/ecs/entity-location-table/create-entity-location-table.test.js +1 -21
- package/ecs/entity-location-table/create-entity-location-table.test.js.map +1 -1
- package/ecs/entity-location-table/entity-location.js.map +1 -1
- package/ecs/entity-location-table/index.js +1 -21
- package/ecs/entity-location-table/index.js.map +1 -1
- package/ecs/entity.js.map +1 -1
- package/ecs/index.js +1 -21
- package/ecs/index.js.map +1 -1
- package/ecs/persistence-service/create-storage-persistence-service.js +1 -21
- package/ecs/persistence-service/create-storage-persistence-service.js.map +1 -1
- package/ecs/persistence-service/index.js +1 -21
- package/ecs/persistence-service/index.js.map +1 -1
- package/ecs/plugins/index.js +1 -21
- package/ecs/plugins/index.js.map +1 -1
- package/ecs/plugins/scheduler/index.js +1 -21
- package/ecs/plugins/scheduler/index.js.map +1 -1
- package/ecs/plugins/scheduler/scheduler.d.ts +1 -2
- package/ecs/plugins/scheduler/scheduler.js +1 -21
- package/ecs/plugins/scheduler/scheduler.js.map +1 -1
- package/ecs/resource-schemas.js +1 -21
- package/ecs/resource-schemas.js.map +1 -1
- package/ecs/store/action-functions.js +1 -21
- package/ecs/store/action-functions.js.map +1 -1
- package/ecs/store/archetype-components.js +1 -21
- package/ecs/store/archetype-components.js.map +1 -1
- package/ecs/store/components.js +1 -21
- package/ecs/store/components.js.map +1 -1
- package/ecs/store/core/core.js +1 -21
- package/ecs/store/core/core.js.map +1 -1
- package/ecs/store/core/create-core.js +1 -21
- package/ecs/store/core/create-core.js.map +1 -1
- package/ecs/store/core/create-core.test.js +22 -21
- package/ecs/store/core/create-core.test.js.map +1 -1
- package/ecs/store/core/index.js +1 -21
- package/ecs/store/core/index.js.map +1 -1
- package/ecs/store/core/select-entities.js +1 -21
- package/ecs/store/core/select-entities.js.map +1 -1
- package/ecs/store/core/select-entities.test.js +1 -21
- package/ecs/store/core/select-entities.test.js.map +1 -1
- package/ecs/store/create-store-schema-test.js +1 -21
- package/ecs/store/create-store-schema-test.js.map +1 -1
- package/ecs/store/entity-select-options.js +1 -21
- package/ecs/store/entity-select-options.js.map +1 -1
- package/ecs/store/index.js +1 -21
- package/ecs/store/index.js.map +1 -1
- package/ecs/store/public/create-store.js +1 -21
- package/ecs/store/public/create-store.js.map +1 -1
- package/ecs/store/public/create-store.test.js +1 -21
- package/ecs/store/public/create-store.test.js.map +1 -1
- package/ecs/store/resource-components.js +1 -21
- package/ecs/store/resource-components.js.map +1 -1
- package/ecs/store/store.js.map +1 -1
- package/ecs/store/store.test.js +1 -21
- package/ecs/store/store.test.js.map +1 -1
- package/ecs/undo-redo-service/create-undo-redo-service.js +1 -21
- package/ecs/undo-redo-service/create-undo-redo-service.js.map +1 -1
- package/ecs/undo-redo-service/create-undo-redo-service.test.js +1 -21
- package/ecs/undo-redo-service/create-undo-redo-service.test.js.map +1 -1
- package/ecs/undo-redo-service/index.js +1 -21
- package/ecs/undo-redo-service/index.js.map +1 -1
- package/ecs/undo-redo-service/undo-redo-service.js +1 -21
- package/ecs/undo-redo-service/undo-redo-service.js.map +1 -1
- package/equals-shallow.js +1 -21
- package/equals-shallow.js.map +1 -1
- package/equals-shallow.test.js +1 -21
- package/equals-shallow.test.js.map +1 -1
- package/equals.js +1 -21
- package/equals.js.map +1 -1
- package/equals.test.js +1 -21
- package/equals.test.js.map +1 -1
- package/functions/apply-args.js +1 -21
- package/functions/apply-args.js.map +1 -1
- package/functions/blit.js +1 -21
- package/functions/blit.js.map +1 -1
- package/functions/copy-view-bytes.js +1 -21
- package/functions/copy-view-bytes.js.map +1 -1
- package/functions/index.js +1 -21
- package/functions/index.js.map +1 -1
- package/functions/merge-patch.js.map +1 -1
- package/functions/merge-patch.test.js +1 -21
- package/functions/merge-patch.test.js.map +1 -1
- package/functions/serialization/codec.js +1 -21
- package/functions/serialization/codec.js.map +1 -1
- package/functions/serialization/index.js +1 -21
- package/functions/serialization/index.js.map +1 -1
- package/functions/serialization/register-blob-codecs.js.map +1 -1
- package/functions/serialization/register-typed-array-codecs.js.map +1 -1
- package/functions/serialization/serialization.test.js +1 -21
- package/functions/serialization/serialization.test.js.map +1 -1
- package/functions/serialization/serialize-to-blobs.js +1 -21
- package/functions/serialization/serialize-to-blobs.js.map +1 -1
- package/functions/serialization/serialize-to-blobs.test.js +1 -21
- package/functions/serialization/serialize-to-blobs.test.js.map +1 -1
- package/functions/serialization/serialize-to-json.js +1 -21
- package/functions/serialization/serialize-to-json.js.map +1 -1
- package/functions/serialization/serialize-to-json.test.js +1 -21
- package/functions/serialization/serialize-to-json.test.js.map +1 -1
- package/functions/serialization/serialize-to-storage.js +1 -21
- package/functions/serialization/serialize-to-storage.js.map +1 -1
- package/functions/serialization/serialize-to-storage.test.js +1 -21
- package/functions/serialization/serialize-to-storage.test.js.map +1 -1
- package/functions/serialization/serialize.js +1 -21
- package/functions/serialization/serialize.js.map +1 -1
- package/index.js +1 -21
- package/index.js.map +1 -1
- package/internal/array/index.js +1 -21
- package/internal/array/index.js.map +1 -1
- package/internal/array/topological-sort.js +1 -21
- package/internal/array/topological-sort.js.map +1 -1
- package/internal/array/topological-sort.test.js +1 -21
- package/internal/array/topological-sort.test.js.map +1 -1
- package/internal/array-buffer-like/copy.js +1 -21
- package/internal/array-buffer-like/copy.js.map +1 -1
- package/internal/array-buffer-like/index.js +1 -21
- package/internal/array-buffer-like/index.js.map +1 -1
- package/internal/array-buffer-like/is-array-buffer.js +1 -21
- package/internal/array-buffer-like/is-array-buffer.js.map +1 -1
- package/internal/array-buffer-like/is-shared-array-buffer.js +1 -21
- package/internal/array-buffer-like/is-shared-array-buffer.js.map +1 -1
- package/internal/array-buffer-like/resize.js +1 -21
- package/internal/array-buffer-like/resize.js.map +1 -1
- package/internal/async-generator/is-async-generator.js +1 -21
- package/internal/async-generator/is-async-generator.js.map +1 -1
- package/internal/data-view-32/create-data-view-32.js.map +1 -1
- package/internal/data-view-32/index.js +1 -21
- package/internal/data-view-32/index.js.map +1 -1
- package/internal/function/debounce.js +1 -21
- package/internal/function/debounce.js.map +1 -1
- package/internal/function/debounce.test.js +1 -21
- package/internal/function/debounce.test.js.map +1 -1
- package/internal/function/memoize-factory.js +1 -21
- package/internal/function/memoize-factory.js.map +1 -1
- package/internal/object/index.js +1 -21
- package/internal/object/index.js.map +1 -1
- package/internal/object/map-entries.js +1 -21
- package/internal/object/map-entries.js.map +1 -1
- package/internal/promise/is-promise.js +1 -21
- package/internal/promise/is-promise.js.map +1 -1
- package/internal/shared-array-buffer/create-shared-array-buffer.js +1 -21
- package/internal/shared-array-buffer/create-shared-array-buffer.js.map +1 -1
- package/internal/typed-array/get-byte-size.js.map +1 -1
- package/internal/typed-array/index.js +1 -21
- package/internal/typed-array/index.js.map +1 -1
- package/is-data.js +1 -21
- package/is-data.js.map +1 -1
- package/lit/decorators/apply-decorator.js +1 -21
- package/lit/decorators/apply-decorator.js.map +1 -1
- package/lit/decorators/apply-service-decorators.js +1 -21
- package/lit/decorators/apply-service-decorators.js.map +1 -1
- package/lit/decorators/index.js +1 -21
- package/lit/decorators/index.js.map +1 -1
- package/lit/decorators/require-service.js +1 -21
- package/lit/decorators/require-service.js.map +1 -1
- package/lit/elements/application-element.js +1 -21
- package/lit/elements/application-element.js.map +1 -1
- package/lit/elements/application-host.js +1 -21
- package/lit/elements/application-host.js.map +1 -1
- package/lit/elements/database-element.d.ts +10 -0
- package/lit/elements/database-element.js +40 -0
- package/lit/elements/database-element.js.map +1 -0
- package/lit/elements/index.d.ts +1 -0
- package/lit/elements/index.js +2 -21
- package/lit/elements/index.js.map +1 -1
- package/lit/functions/index.js +1 -21
- package/lit/functions/index.js.map +1 -1
- package/lit/functions/iterate-self-and-ancestors.js +1 -21
- package/lit/functions/iterate-self-and-ancestors.js.map +1 -1
- package/lit/hooks/attach-decorator.js +1 -21
- package/lit/hooks/attach-decorator.js.map +1 -1
- package/lit/hooks/component/component.js +1 -21
- package/lit/hooks/component/component.js.map +1 -1
- package/lit/hooks/component/stack.js +1 -21
- package/lit/hooks/component/stack.js.map +1 -1
- package/lit/hooks/index.js +1 -21
- package/lit/hooks/index.js.map +1 -1
- package/lit/hooks/use-connected.js +1 -21
- package/lit/hooks/use-connected.js.map +1 -1
- package/lit/hooks/use-debounce.js +1 -21
- package/lit/hooks/use-debounce.js.map +1 -1
- package/lit/hooks/use-drag-observe.js +1 -21
- package/lit/hooks/use-drag-observe.js.map +1 -1
- package/lit/hooks/use-drag-transaction.js +1 -21
- package/lit/hooks/use-drag-transaction.js.map +1 -1
- package/lit/hooks/use-draggable.js +1 -21
- package/lit/hooks/use-draggable.js.map +1 -1
- package/lit/hooks/use-effect.js +1 -21
- package/lit/hooks/use-effect.js.map +1 -1
- package/lit/hooks/use-element.js +1 -21
- package/lit/hooks/use-element.js.map +1 -1
- package/lit/hooks/use-memo.js +1 -21
- package/lit/hooks/use-memo.js.map +1 -1
- package/lit/hooks/use-observable-values.js +1 -21
- package/lit/hooks/use-observable-values.js.map +1 -1
- package/lit/hooks/use-observable.js +1 -21
- package/lit/hooks/use-observable.js.map +1 -1
- package/lit/hooks/use-ref.js +1 -21
- package/lit/hooks/use-ref.js.map +1 -1
- package/lit/hooks/use-resize-observer.js +1 -21
- package/lit/hooks/use-resize-observer.js.map +1 -1
- package/lit/hooks/use-state.js +1 -21
- package/lit/hooks/use-state.js.map +1 -1
- package/lit/hooks/use-updated.js +1 -21
- package/lit/hooks/use-updated.js.map +1 -1
- package/lit/hooks/use-window-event.js +1 -21
- package/lit/hooks/use-window-event.js.map +1 -1
- package/lit/hooks/with-hooks.js +1 -21
- package/lit/hooks/with-hooks.js.map +1 -1
- package/lit/index.js +1 -21
- package/lit/index.js.map +1 -1
- package/math/aabb/center.js.map +1 -1
- package/math/aabb/face/aabb-face.test.js +1 -21
- package/math/aabb/face/aabb-face.test.js.map +1 -1
- package/math/aabb/face/functions.js +1 -21
- package/math/aabb/face/functions.js.map +1 -1
- package/math/aabb/face/index.js +1 -21
- package/math/aabb/face/index.js.map +1 -1
- package/math/aabb/face/public.js +1 -21
- package/math/aabb/face/public.js.map +1 -1
- package/math/aabb/face/schema.js +1 -21
- package/math/aabb/face/schema.js.map +1 -1
- package/math/aabb/index.js +1 -21
- package/math/aabb/index.js.map +1 -1
- package/math/aabb/layout.js +1 -21
- package/math/aabb/layout.js.map +1 -1
- package/math/aabb/line-intersection.js.map +1 -1
- package/math/aabb/line-intersection.test.js +1 -21
- package/math/aabb/line-intersection.test.js.map +1 -1
- package/math/aabb/public.js +1 -21
- package/math/aabb/public.js.map +1 -1
- package/math/aabb/schema.js +1 -21
- package/math/aabb/schema.js.map +1 -1
- package/math/aabb/unit.js.map +1 -1
- package/math/constants.js +1 -21
- package/math/constants.js.map +1 -1
- package/math/f32/index.js +1 -21
- package/math/f32/index.js.map +1 -1
- package/math/f32/public.js +1 -21
- package/math/f32/public.js.map +1 -1
- package/math/f32/schema.js +1 -21
- package/math/f32/schema.js.map +1 -1
- package/math/f64/index.js.map +1 -1
- package/math/f64/public.js +1 -21
- package/math/f64/public.js.map +1 -1
- package/math/f64/schema.js.map +1 -1
- package/math/i32/index.js +1 -21
- package/math/i32/index.js.map +1 -1
- package/math/i32/public.js +1 -21
- package/math/i32/public.js.map +1 -1
- package/math/i32/schema.js +1 -21
- package/math/i32/schema.js.map +1 -1
- package/math/index.js +1 -21
- package/math/index.js.map +1 -1
- package/math/line2/functions.js +1 -21
- package/math/line2/functions.js.map +1 -1
- package/math/line2/index.js +1 -21
- package/math/line2/index.js.map +1 -1
- package/math/line2/intersects.test.js +1 -21
- package/math/line2/intersects.test.js.map +1 -1
- package/math/line2/layout.js +1 -21
- package/math/line2/layout.js.map +1 -1
- package/math/line2/public.js +1 -21
- package/math/line2/public.js.map +1 -1
- package/math/line2/schema.js +1 -21
- package/math/line2/schema.js.map +1 -1
- package/math/line3/closest-point-on-line.test.js +1 -21
- package/math/line3/closest-point-on-line.test.js.map +1 -1
- package/math/line3/functions.js +1 -21
- package/math/line3/functions.js.map +1 -1
- package/math/line3/index.js +1 -21
- package/math/line3/index.js.map +1 -1
- package/math/line3/interpolate.test.js +1 -21
- package/math/line3/interpolate.test.js.map +1 -1
- package/math/line3/layout.js +1 -21
- package/math/line3/layout.js.map +1 -1
- package/math/line3/public.js +1 -21
- package/math/line3/public.js.map +1 -1
- package/math/line3/schema.js +1 -21
- package/math/line3/schema.js.map +1 -1
- package/math/line3/sub-line.test.js +1 -21
- package/math/line3/sub-line.test.js.map +1 -1
- package/math/mat4x4/functions.js +1 -21
- package/math/mat4x4/functions.js.map +1 -1
- package/math/mat4x4/index.js +1 -21
- package/math/mat4x4/index.js.map +1 -1
- package/math/mat4x4/layout.js +1 -21
- package/math/mat4x4/layout.js.map +1 -1
- package/math/mat4x4/public.js +1 -21
- package/math/mat4x4/public.js.map +1 -1
- package/math/mat4x4/schema.js +1 -21
- package/math/mat4x4/schema.js.map +1 -1
- package/math/plane/functions.js +1 -21
- package/math/plane/functions.js.map +1 -1
- package/math/plane/index.js +1 -21
- package/math/plane/index.js.map +1 -1
- package/math/plane/layout.js +1 -21
- package/math/plane/layout.js.map +1 -1
- package/math/plane/plane.test.js +1 -21
- package/math/plane/plane.test.js.map +1 -1
- package/math/plane/public.js +1 -21
- package/math/plane/public.js.map +1 -1
- package/math/plane/schema.js +1 -21
- package/math/plane/schema.js.map +1 -1
- package/math/quat/constants/functions.js +1 -21
- package/math/quat/constants/functions.js.map +1 -1
- package/math/quat/functions.js +1 -21
- package/math/quat/functions.js.map +1 -1
- package/math/quat/index.js +1 -21
- package/math/quat/index.js.map +1 -1
- package/math/quat/layout.js +1 -21
- package/math/quat/layout.js.map +1 -1
- package/math/quat/public.js +1 -21
- package/math/quat/public.js.map +1 -1
- package/math/quat/schema.js +1 -21
- package/math/quat/schema.js.map +1 -1
- package/math/u32/index.js +1 -21
- package/math/u32/index.js.map +1 -1
- package/math/u32/public.js +1 -21
- package/math/u32/public.js.map +1 -1
- package/math/u32/schema.js +1 -21
- package/math/u32/schema.js.map +1 -1
- package/math/vec2/functions.js +1 -21
- package/math/vec2/functions.js.map +1 -1
- package/math/vec2/index.js +1 -21
- package/math/vec2/index.js.map +1 -1
- package/math/vec2/layout.js +1 -21
- package/math/vec2/layout.js.map +1 -1
- package/math/vec2/public.js +1 -21
- package/math/vec2/public.js.map +1 -1
- package/math/vec2/schema.js +1 -21
- package/math/vec2/schema.js.map +1 -1
- package/math/vec3/functions.js +1 -21
- package/math/vec3/functions.js.map +1 -1
- package/math/vec3/index.js +1 -21
- package/math/vec3/index.js.map +1 -1
- package/math/vec3/layout.js +1 -21
- package/math/vec3/layout.js.map +1 -1
- package/math/vec3/public.js +1 -21
- package/math/vec3/public.js.map +1 -1
- package/math/vec3/schema.js +1 -21
- package/math/vec3/schema.js.map +1 -1
- package/math/vec4/functions.js +1 -21
- package/math/vec4/functions.js.map +1 -1
- package/math/vec4/index.js +1 -21
- package/math/vec4/index.js.map +1 -1
- package/math/vec4/layout.js +1 -21
- package/math/vec4/layout.js.map +1 -1
- package/math/vec4/public.js +1 -21
- package/math/vec4/public.js.map +1 -1
- package/math/vec4/schema.js +1 -21
- package/math/vec4/schema.js.map +1 -1
- package/mutable-clone.js +1 -21
- package/mutable-clone.js.map +1 -1
- package/mutable.js +1 -21
- package/mutable.js.map +1 -1
- package/normalize.js +1 -21
- package/normalize.js.map +1 -1
- package/normalize.test.js +1 -21
- package/normalize.test.js.map +1 -1
- package/observe/create-event.js.map +1 -1
- package/observe/create-persisted-state.js.map +1 -1
- package/observe/create-persisted-state.test.js +1 -21
- package/observe/create-persisted-state.test.js.map +1 -1
- package/observe/create-query-state.js +1 -21
- package/observe/create-query-state.js.map +1 -1
- package/observe/create-state.js.map +1 -1
- package/observe/from-array.js +1 -21
- package/observe/from-array.js.map +1 -1
- package/observe/from-constant.js.map +1 -1
- package/observe/from-element-id.js +1 -21
- package/observe/from-element-id.js.map +1 -1
- package/observe/from-element-properties-and-events.js.map +1 -1
- package/observe/from-element-property.js +1 -21
- package/observe/from-element-property.js.map +1 -1
- package/observe/from-promise-with-error.js.map +1 -1
- package/observe/from-promise.js.map +1 -1
- package/observe/from-properties.js.map +1 -1
- package/observe/index.js +1 -21
- package/observe/index.js.map +1 -1
- package/observe/observe.test.js +1 -21
- package/observe/observe.test.js.map +1 -1
- package/observe/public.js +1 -21
- package/observe/public.js.map +1 -1
- package/observe/to-async-generator.js +1 -21
- package/observe/to-async-generator.js.map +1 -1
- package/observe/to-async-generator.test.js +1 -21
- package/observe/to-async-generator.test.js.map +1 -1
- package/observe/to-promise.js.map +1 -1
- package/observe/to-properties.js.map +1 -1
- package/observe/with-async-map.js.map +1 -1
- package/observe/with-batch.js.map +1 -1
- package/observe/with-batch.test.js +1 -21
- package/observe/with-batch.test.js.map +1 -1
- package/observe/with-cache.js.map +1 -1
- package/observe/with-copy.js.map +1 -1
- package/observe/with-deduplicate-data.js.map +1 -1
- package/observe/with-deduplicate.js.map +1 -1
- package/observe/with-default.js.map +1 -1
- package/observe/with-filter.js.map +1 -1
- package/observe/with-filter.test.js +1 -21
- package/observe/with-filter.test.js.map +1 -1
- package/observe/with-lazy.js.map +1 -1
- package/observe/with-lazy.test.js +1 -21
- package/observe/with-lazy.test.js.map +1 -1
- package/observe/with-map-data.js +1 -21
- package/observe/with-map-data.js.map +1 -1
- package/observe/with-map.js.map +1 -1
- package/observe/with-optional.js.map +1 -1
- package/observe/with-unwrap.js.map +1 -1
- package/old-ecs/action-ecs/action-ecs.js +1 -21
- package/old-ecs/action-ecs/action-ecs.js.map +1 -1
- package/old-ecs/action-ecs/action-ecs.test.js +1 -21
- package/old-ecs/action-ecs/action-ecs.test.js.map +1 -1
- package/old-ecs/action-ecs/action-types.js.map +1 -1
- package/old-ecs/action-ecs/index.js +1 -21
- package/old-ecs/action-ecs/index.js.map +1 -1
- package/old-ecs/action-ecs/sequential-action.js +1 -21
- package/old-ecs/action-ecs/sequential-action.js.map +1 -1
- package/old-ecs/core-ecs/core-ecs-serialization.test.js +1 -21
- package/old-ecs/core-ecs/core-ecs-serialization.test.js.map +1 -1
- package/old-ecs/core-ecs/core-ecs-types.js +1 -21
- package/old-ecs/core-ecs/core-ecs-types.js.map +1 -1
- package/old-ecs/core-ecs/core-ecs.js +1 -21
- package/old-ecs/core-ecs/core-ecs.js.map +1 -1
- package/old-ecs/core-ecs/core-ecs.test.js +1 -21
- package/old-ecs/core-ecs/core-ecs.test.js.map +1 -1
- package/old-ecs/ecs/ecs-types.js +1 -21
- package/old-ecs/ecs/ecs-types.js.map +1 -1
- package/old-ecs/ecs/ecs-where-functions.js +1 -21
- package/old-ecs/ecs/ecs-where-functions.js.map +1 -1
- package/old-ecs/ecs/ecs.js.map +1 -1
- package/old-ecs/ecs/ecs.test.js +1 -21
- package/old-ecs/ecs/ecs.test.js.map +1 -1
- package/old-ecs/ecs/index.js +1 -21
- package/old-ecs/ecs/index.js.map +1 -1
- package/old-ecs/entity.js.map +1 -1
- package/old-ecs/index.js +1 -21
- package/old-ecs/index.js.map +1 -1
- package/old-ecs/transaction-ecs/index.js +1 -21
- package/old-ecs/transaction-ecs/index.js.map +1 -1
- package/old-ecs/transaction-ecs/transaction-ecs.js.map +1 -1
- package/old-ecs/transaction-ecs/transaction-ecs.test.js +1 -21
- package/old-ecs/transaction-ecs/transaction-ecs.test.js.map +1 -1
- package/old-ecs/transaction-ecs/transactions.js +1 -21
- package/old-ecs/transaction-ecs/transactions.js.map +1 -1
- package/package.json +3 -3
- package/perftest/ecs-perf.js +1 -21
- package/perftest/ecs-perf.js.map +1 -1
- package/perftest/helper-functions.js +1 -21
- package/perftest/helper-functions.js.map +1 -1
- package/perftest/horizon-perf.js +1 -21
- package/perftest/horizon-perf.js.map +1 -1
- package/perftest/index.js +1 -21
- package/perftest/index.js.map +1 -1
- package/perftest/perf-test.js.map +1 -1
- package/perftest/vanilla-perf.js +1 -21
- package/perftest/vanilla-perf.js.map +1 -1
- package/samples/index.js +1 -21
- package/samples/index.js.map +1 -1
- package/samples/todo/elements/todo-list/todo-list-presentation.js.map +1 -1
- package/samples/todo/elements/todo-list/todo-list.css.js +1 -21
- package/samples/todo/elements/todo-list/todo-list.css.js.map +1 -1
- package/samples/todo/elements/todo-list/todo-list.js +1 -21
- package/samples/todo/elements/todo-list/todo-list.js.map +1 -1
- package/samples/todo/elements/todo-row/index.js +1 -21
- package/samples/todo/elements/todo-row/index.js.map +1 -1
- package/samples/todo/elements/todo-row/todo-row-presentation.js +1 -21
- package/samples/todo/elements/todo-row/todo-row-presentation.js.map +1 -1
- package/samples/todo/elements/todo-row/todo-row.css.js +1 -21
- package/samples/todo/elements/todo-row/todo-row.css.js.map +1 -1
- package/samples/todo/elements/todo-row/todo-row.js +1 -21
- package/samples/todo/elements/todo-row/todo-row.js.map +1 -1
- package/samples/todo/elements/todo-toolbar/index.js +1 -21
- package/samples/todo/elements/todo-toolbar/index.js.map +1 -1
- package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js +1 -21
- package/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js.map +1 -1
- package/samples/todo/elements/todo-toolbar/todo-toolbar.css.js +1 -21
- package/samples/todo/elements/todo-toolbar/todo-toolbar.css.js.map +1 -1
- package/samples/todo/elements/todo-toolbar/todo-toolbar.js +1 -21
- package/samples/todo/elements/todo-toolbar/todo-toolbar.js.map +1 -1
- package/samples/todo/elements/todo-undo-redo/index.js +1 -21
- package/samples/todo/elements/todo-undo-redo/index.js.map +1 -1
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js +1 -21
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js.map +1 -1
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js +1 -21
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js.map +1 -1
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.js +1 -21
- package/samples/todo/elements/todo-undo-redo/todo-undo-redo.js.map +1 -1
- package/samples/todo/services/dependent-state-service/create-dependent-state-service.js +1 -21
- package/samples/todo/services/dependent-state-service/create-dependent-state-service.js.map +1 -1
- package/samples/todo/services/dependent-state-service/dependent-state/all-todos.js.map +1 -1
- package/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js.map +1 -1
- package/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js.map +1 -1
- package/samples/todo/services/dependent-state-service/dependent-state/index.js +1 -21
- package/samples/todo/services/dependent-state-service/dependent-state/index.js.map +1 -1
- package/samples/todo/services/main-service/create-main-service.js.map +1 -1
- package/samples/todo/services/state-service/create-todo-database.d.ts +1 -1
- package/samples/todo/services/state-service/create-todo-database.js +1 -21
- package/samples/todo/services/state-service/create-todo-database.js.map +1 -1
- package/samples/todo/services/state-service/create-todo-store.d.ts +1 -1
- package/samples/todo/services/state-service/create-todo-store.js +1 -21
- package/samples/todo/services/state-service/create-todo-store.js.map +1 -1
- package/samples/todo/services/state-service/transactions/create-bulk-todos.js +1 -21
- package/samples/todo/services/state-service/transactions/create-bulk-todos.js.map +1 -1
- package/samples/todo/services/state-service/transactions/create-todo.js.map +1 -1
- package/samples/todo/services/state-service/transactions/create-todo.test.js +1 -21
- package/samples/todo/services/state-service/transactions/create-todo.test.js.map +1 -1
- package/samples/todo/services/state-service/transactions/delete-all-todos.js.map +1 -1
- package/samples/todo/services/state-service/transactions/delete-todo.js +1 -21
- package/samples/todo/services/state-service/transactions/delete-todo.js.map +1 -1
- package/samples/todo/services/state-service/transactions/delete-todo.test.js +1 -21
- package/samples/todo/services/state-service/transactions/delete-todo.test.js.map +1 -1
- package/samples/todo/services/state-service/transactions/drag-todo.js +1 -21
- package/samples/todo/services/state-service/transactions/drag-todo.js.map +1 -1
- package/samples/todo/services/state-service/transactions/index.js +1 -21
- package/samples/todo/services/state-service/transactions/index.js.map +1 -1
- package/samples/todo/services/state-service/transactions/reorder-todos.js.map +1 -1
- package/samples/todo/services/state-service/transactions/toggle-complete.js.map +1 -1
- package/samples/todo/services/state-service/transactions/toggle-complete.test.js +1 -21
- package/samples/todo/services/state-service/transactions/toggle-complete.test.js.map +1 -1
- package/samples/todo/todo-element.js.map +1 -1
- package/samples/todo/todo-host.js +1 -21
- package/samples/todo/todo-host.js.map +1 -1
- package/samples/todo/todo-main-element.js +1 -21
- package/samples/todo/todo-main-element.js.map +1 -1
- package/samples/todo/todo-sample.js +1 -21
- package/samples/todo/todo-sample.js.map +1 -1
- package/schema/boolean/index.js +1 -21
- package/schema/boolean/index.js.map +1 -1
- package/schema/boolean/public.js +1 -21
- package/schema/boolean/public.js.map +1 -1
- package/schema/boolean/schema.js.map +1 -1
- package/schema/dynamic/deep-merge.js.map +1 -1
- package/schema/dynamic/deep-merge.test.js +1 -21
- package/schema/dynamic/deep-merge.test.js.map +1 -1
- package/schema/dynamic/enumerate-patches.js.map +1 -1
- package/schema/dynamic/enumerate-patches.test.js +1 -21
- package/schema/dynamic/enumerate-patches.test.js.map +1 -1
- package/schema/dynamic/get-dynamic-schema.js +1 -21
- package/schema/dynamic/get-dynamic-schema.js.map +1 -1
- package/schema/dynamic/get-dynamic-schema.test.js +1 -21
- package/schema/dynamic/get-dynamic-schema.test.js.map +1 -1
- package/schema/dynamic/index.js +1 -21
- package/schema/dynamic/index.js.map +1 -1
- package/schema/index.js +1 -21
- package/schema/index.js.map +1 -1
- package/schema/nullable.js.map +1 -1
- package/schema/public.js +1 -21
- package/schema/public.js.map +1 -1
- package/schema/schema.js +1 -21
- package/schema/schema.js.map +1 -1
- package/schema/time/index.js +1 -21
- package/schema/time/index.js.map +1 -1
- package/schema/time/public.js +1 -21
- package/schema/time/public.js.map +1 -1
- package/schema/time/schema.js +1 -21
- package/schema/time/schema.js.map +1 -1
- package/schema/to-type.js +1 -21
- package/schema/to-type.js.map +1 -1
- package/schema/to-vertex-buffer-layout.js +1 -21
- package/schema/to-vertex-buffer-layout.js.map +1 -1
- package/schema/to-vertex-buffer-layout.test.js +1 -21
- package/schema/to-vertex-buffer-layout.test.js.map +1 -1
- package/schema/true/index.js +1 -21
- package/schema/true/index.js.map +1 -1
- package/schema/true/public.js +1 -21
- package/schema/true/public.js.map +1 -1
- package/schema/true/schema.js.map +1 -1
- package/schema/tuple.js +1 -21
- package/schema/tuple.js.map +1 -1
- package/schema/validation/index.js +1 -21
- package/schema/validation/index.js.map +1 -1
- package/schema/validation/is-valid.js.map +1 -1
- package/schema/validation/is-valid.test.js +1 -21
- package/schema/validation/is-valid.test.js.map +1 -1
- package/schema/validation/validate.js +1 -21
- package/schema/validation/validate.js.map +1 -1
- package/schema/validation/validate.test.js +1 -21
- package/schema/validation/validate.test.js.map +1 -1
- package/schema/validation/with-validation.js.map +1 -1
- package/schema/validation/with-validation.test.js +1 -21
- package/schema/validation/with-validation.test.js.map +1 -1
- package/schema.test.js.map +1 -1
- package/service/add-observable-actions.js +1 -21
- package/service/add-observable-actions.js.map +1 -1
- package/service/disposable.js +1 -21
- package/service/disposable.js.map +1 -1
- package/service/index.js +1 -21
- package/service/index.js.map +1 -1
- package/service/is-service.js +1 -21
- package/service/is-service.js.map +1 -1
- package/service/progressive-result.js +1 -21
- package/service/progressive-result.js.map +1 -1
- package/service/service.js +1 -21
- package/service/service.js.map +1 -1
- package/table/add-row.js +1 -21
- package/table/add-row.js.map +1 -1
- package/table/copy-column-to-gpu-buffer.js +1 -21
- package/table/copy-column-to-gpu-buffer.js.map +1 -1
- package/table/create-table.js +1 -21
- package/table/create-table.js.map +1 -1
- package/table/create-table.test.js +1 -21
- package/table/create-table.test.js.map +1 -1
- package/table/delete-row.js.map +1 -1
- package/table/ensure-capacity.js.map +1 -1
- package/table/get-row-data.js.map +1 -1
- package/table/index.js +1 -21
- package/table/index.js.map +1 -1
- package/table/row-index.js.map +1 -1
- package/table/select-rows.js.map +1 -1
- package/table/select-rows.test.js +1 -21
- package/table/select-rows.test.js.map +1 -1
- package/table/table-compact.test.js +1 -21
- package/table/table-compact.test.js.map +1 -1
- package/table/table.js.map +1 -1
- package/table/update-row.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/typed-buffer/copy-to-gpu-buffer.js +1 -21
- package/typed-buffer/copy-to-gpu-buffer.js.map +1 -1
- package/typed-buffer/create-array-buffer.js +10 -0
- package/typed-buffer/create-array-buffer.js.map +1 -1
- package/typed-buffer/create-array-buffer.test.js +51 -21
- package/typed-buffer/create-array-buffer.test.js.map +1 -1
- package/typed-buffer/create-const-buffer.copy.test.js +1 -21
- package/typed-buffer/create-const-buffer.copy.test.js.map +1 -1
- package/typed-buffer/create-const-buffer.js +3 -0
- package/typed-buffer/create-const-buffer.js.map +1 -1
- package/typed-buffer/create-const-buffer.test.js +25 -21
- package/typed-buffer/create-const-buffer.test.js.map +1 -1
- package/typed-buffer/create-number-buffer.js +5 -21
- package/typed-buffer/create-number-buffer.js.map +1 -1
- package/typed-buffer/create-number-buffer.test.js +39 -21
- package/typed-buffer/create-number-buffer.test.js.map +1 -1
- package/typed-buffer/create-struct-buffer.copy.test.js +1 -21
- package/typed-buffer/create-struct-buffer.copy.test.js.map +1 -1
- package/typed-buffer/create-struct-buffer.js +12 -21
- package/typed-buffer/create-struct-buffer.js.map +1 -1
- package/typed-buffer/create-struct-buffer.test.js +61 -21
- package/typed-buffer/create-struct-buffer.test.js.map +1 -1
- package/typed-buffer/create-typed-buffer.js.map +1 -1
- package/typed-buffer/create-typed-buffer.test.js +1 -21
- package/typed-buffer/create-typed-buffer.test.js.map +1 -1
- package/typed-buffer/index.js +1 -21
- package/typed-buffer/index.js.map +1 -1
- package/typed-buffer/is-typed-buffer.js +1 -21
- package/typed-buffer/is-typed-buffer.js.map +1 -1
- package/typed-buffer/is-typed-buffer.test.js +1 -21
- package/typed-buffer/is-typed-buffer.test.js.map +1 -1
- package/typed-buffer/register-typed-buffer-codecs.js +1 -21
- package/typed-buffer/register-typed-buffer-codecs.js.map +1 -1
- package/typed-buffer/structs/assert-struct.js.map +1 -1
- package/typed-buffer/structs/create-read-struct.js +1 -21
- package/typed-buffer/structs/create-read-struct.js.map +1 -1
- package/typed-buffer/structs/create-read-struct.test.js +1 -21
- package/typed-buffer/structs/create-read-struct.test.js.map +1 -1
- package/typed-buffer/structs/create-write-struct.js +1 -21
- package/typed-buffer/structs/create-write-struct.js.map +1 -1
- package/typed-buffer/structs/get-field-offset.js.map +1 -1
- package/typed-buffer/structs/get-struct-layout.js +1 -21
- package/typed-buffer/structs/get-struct-layout.js.map +1 -1
- package/typed-buffer/structs/get-struct-layout.test.js +1 -21
- package/typed-buffer/structs/get-struct-layout.test.js.map +1 -1
- package/typed-buffer/structs/index.js +1 -21
- package/typed-buffer/structs/index.js.map +1 -1
- package/typed-buffer/structs/write-struct.test.js +1 -21
- package/typed-buffer/structs/write-struct.test.js.map +1 -1
- package/typed-buffer/typed-buffer-equals.js +1 -21
- package/typed-buffer/typed-buffer-equals.js.map +1 -1
- package/typed-buffer/typed-buffer-equals.test.js +1 -21
- package/typed-buffer/typed-buffer-equals.test.js.map +1 -1
- package/typed-buffer/typed-buffer.d.ts +2 -0
- package/typed-buffer/typed-buffer.js.map +1 -1
- package/typed-buffer/typed-buffer.test.js +1 -21
- package/typed-buffer/typed-buffer.test.js.map +1 -1
- package/types/index.js +1 -21
- package/types/index.js.map +1 -1
- package/types/replace.js.map +1 -1
- package/types/typed-array.js +1 -21
- package/types/typed-array.js.map +1 -1
- package/types/types.js +1 -21
- package/types/types.js.map +1 -1
- package/assembly/package.json +0 -1
- package/blob/package.json +0 -1
- package/cache/package.json +0 -1
- package/debug-type-test.js +0 -12
- package/debug-type-test.js.map +0 -1
- package/ecs/database/archetype-type-safety-test.d.ts +0 -21
- package/ecs/database/archetype-type-safety-test.js +0 -36
- package/ecs/database/archetype-type-safety-test.js.map +0 -1
- package/ecs/database/create-database-schema-test.js +0 -150
- package/ecs/database/create-database-schema-test.js.map +0 -1
- package/ecs/database/create-plugin-v2.d.ts +0 -79
- package/ecs/database/create-plugin-v2.js +0 -68
- package/ecs/database/create-plugin-v2.js.map +0 -1
- package/ecs/database/create-plugin-v2.test.js +0 -362
- package/ecs/database/create-plugin-v2.test.js.map +0 -1
- package/ecs/database/create-plugin.OLD.d.ts +0 -138
- package/ecs/database/create-plugin.OLD.js +0 -59
- package/ecs/database/create-plugin.OLD.js.map +0 -1
- package/ecs/database/database-with-systems.test.js +0 -292
- package/ecs/database/database-with-systems.test.js.map +0 -1
- package/ecs/database/database.plugin.create.test.OLD.js +0 -601
- package/ecs/database/database.plugin.create.test.OLD.js.map +0 -1
- package/ecs/database/database.plugin.create.test.js +0 -321
- package/ecs/database/database.plugin.create.test.js.map +0 -1
- package/ecs/database/database.plugin.test.js +0 -90
- package/ecs/database/database.plugin.test.js.map +0 -1
- package/ecs/database/database.test copy.d.ts +0 -1
- package/ecs/database/database.test copy.js +0 -199
- package/ecs/database/database.test copy.js.map +0 -1
- package/ecs/database/multi-param-inference-poc.test.d.ts +0 -1
- package/ecs/database/multi-param-inference-poc.test.js +0 -96
- package/ecs/database/multi-param-inference-poc.test.js.map +0 -1
- package/ecs/database/old-plugin-create-with-dependencies-array.d.ts +0 -61
- package/ecs/database/old-plugin-create-with-dependencies-array.js +0 -76
- package/ecs/database/old-plugin-create-with-dependencies-array.js.map +0 -1
- package/ecs/database/overload-inference-poc.test.d.ts +0 -1
- package/ecs/database/overload-inference-poc.test.js +0 -109
- package/ecs/database/overload-inference-poc.test.js.map +0 -1
- package/ecs/database/schedule-type-check-demo.d.ts +0 -10
- package/ecs/database/schedule-type-check-demo.js +0 -71
- package/ecs/database/schedule-type-check-demo.js.map +0 -1
- package/ecs/database/test-archetype-validation.d.ts +0 -9
- package/ecs/database/test-archetype-validation.js +0 -14
- package/ecs/database/test-archetype-validation.js.map +0 -1
- package/ecs/database/test-exactkeys.d.ts +0 -1
- package/ecs/database/test-exactkeys.js +0 -17
- package/ecs/database/test-exactkeys.js.map +0 -1
- package/ecs/database/transactional-store/coalesce-transactions.test.js +0 -433
- package/ecs/database/transactional-store/coalesce-transactions.test.js.map +0 -1
- package/ecs/database/type-inference-demo.d.ts +0 -75
- package/ecs/database/type-inference-demo.js +0 -73
- package/ecs/database/type-inference-demo.js.map +0 -1
- package/ecs/database/type-inference-poc.test.d.ts +0 -1
- package/ecs/database/type-inference-poc.test.js +0 -73
- package/ecs/database/type-inference-poc.test.js.map +0 -1
- package/ecs/package.json +0 -1
- package/ecs/plugins/scheduler/create-scheduler-plugin.d.ts +0 -8
- package/ecs/plugins/scheduler/create-scheduler-plugin.js +0 -54
- package/ecs/plugins/scheduler/create-scheduler-plugin.js.map +0 -1
- package/ecs/plugins/scheduler/create-scheduler-plugin.test.d.ts +0 -1
- package/ecs/plugins/scheduler/create-scheduler-plugin.test.js +0 -198
- package/ecs/plugins/scheduler/create-scheduler-plugin.test.js.map +0 -1
- package/ecs/plugins/scheduler/type-inference-test.d.ts +0 -1
- package/ecs/plugins/scheduler/type-inference-test.js +0 -2
- package/ecs/plugins/scheduler/type-inference-test.js.map +0 -1
- package/ecs/store/entity-functions.d.ts +0 -7
- package/ecs/store/entity-functions.js +0 -2
- package/ecs/store/entity-functions.js.map +0 -1
- package/ecs/store/functions.d.ts +0 -2
- package/ecs/store/functions.js +0 -2
- package/ecs/store/functions.js.map +0 -1
- package/ecs/system/system-declaration.d.ts +0 -7
- package/ecs/system/system-declaration.js +0 -23
- package/ecs/system/system-declaration.js.map +0 -1
- package/ecs/system/system-declarations.d.ts +0 -4
- package/ecs/system/system-declarations.js +0 -23
- package/ecs/system/system-declarations.js.map +0 -1
- package/ecs/system/system-factory/public/create copy.d.ts +0 -12
- package/ecs/system/system-factory/public/create copy.js +0 -8
- package/ecs/system/system-factory/public/create copy.js.map +0 -1
- package/ecs/system/system-factory/public/create.d.ts +0 -12
- package/ecs/system/system-factory/public/create.js +0 -8
- package/ecs/system/system-factory/public/create.js.map +0 -1
- package/ecs/system/system-factory/public/create.test.d.ts +0 -1
- package/ecs/system/system-factory/public/create.test.js +0 -42
- package/ecs/system/system-factory/public/create.test.js.map +0 -1
- package/ecs/system/system-factory/public/index.d.ts +0 -1
- package/ecs/system/system-factory/public/index.js +0 -2
- package/ecs/system/system-factory/public/index.js.map +0 -1
- package/ecs/system/system-factory/system-factory.d.ts +0 -17
- package/ecs/system/system-factory/system-factory.js +0 -23
- package/ecs/system/system-factory/system-factory.js.map +0 -1
- package/ecs/system/system-factory.d.ts +0 -9
- package/ecs/system/system-factory.js +0 -23
- package/ecs/system/system-factory.js.map +0 -1
- package/ecs/system/system-interface.d.ts +0 -5
- package/ecs/system/system-interface.js +0 -2
- package/ecs/system/system-interface.js.map +0 -1
- package/ecs/system/system.d.ts +0 -4
- package/ecs/system/system.js +0 -23
- package/ecs/system/system.js.map +0 -1
- package/ecs/system/systems-type.d.ts +0 -2
- package/ecs/system/systems-type.js +0 -2
- package/ecs/system/systems-type.js.map +0 -1
- package/ecs/system/systems.d.ts +0 -2
- package/ecs/system/systems.js +0 -23
- package/ecs/system/systems.js.map +0 -1
- package/ecs/system/world-schema/public/create.d.ts +0 -12
- package/ecs/system/world-schema/public/create.js +0 -8
- package/ecs/system/world-schema/public/create.js.map +0 -1
- package/ecs/system/world-schema/public/create.test.d.ts +0 -1
- package/ecs/system/world-schema/public/create.test.js +0 -42
- package/ecs/system/world-schema/public/create.test.js.map +0 -1
- package/ecs/system/world-schema/public/index.d.ts +0 -1
- package/ecs/system/world-schema/public/index.js +0 -2
- package/ecs/system/world-schema/public/index.js.map +0 -1
- package/ecs/system/world-schema/system-factory.d.ts +0 -17
- package/ecs/system/world-schema/system-factory.js +0 -23
- package/ecs/system/world-schema/system-factory.js.map +0 -1
- package/ecs/world/calculate-system-order.d.ts +0 -18
- package/ecs/world/calculate-system-order.js +0 -113
- package/ecs/world/calculate-system-order.js.map +0 -1
- package/ecs/world/calculate-system-order.test.d.ts +0 -1
- package/ecs/world/calculate-system-order.test.js +0 -168
- package/ecs/world/calculate-system-order.test.js.map +0 -1
- package/ecs/world/create-world-schema-test.d.ts +0 -1
- package/ecs/world/create-world-schema-test.js +0 -294
- package/ecs/world/create-world-schema-test.js.map +0 -1
- package/ecs/world/create-world-type-test.d.ts +0 -1
- package/ecs/world/create-world-type-test.js +0 -129
- package/ecs/world/create-world-type-test.js.map +0 -1
- package/ecs/world/create-world.d.ts +0 -19
- package/ecs/world/create-world.js +0 -80
- package/ecs/world/create-world.js.map +0 -1
- package/ecs/world/create-world.test.d.ts +0 -1
- package/ecs/world/create-world.test.js +0 -292
- package/ecs/world/create-world.test.js.map +0 -1
- package/ecs/world/public/world-schema/public/create.d.ts +0 -12
- package/ecs/world/public/world-schema/public/create.js +0 -8
- package/ecs/world/public/world-schema/public/create.js.map +0 -1
- package/ecs/world/public/world-schema/public/create.test.d.ts +0 -1
- package/ecs/world/public/world-schema/public/create.test.js +0 -42
- package/ecs/world/public/world-schema/public/create.test.js.map +0 -1
- package/ecs/world/public/world-schema/public/index.d.ts +0 -1
- package/ecs/world/public/world-schema/public/index.js +0 -2
- package/ecs/world/public/world-schema/public/index.js.map +0 -1
- package/ecs/world/public/world-schema/world-schema.d.ts +0 -17
- package/ecs/world/public/world-schema/world-schema.js +0 -23
- package/ecs/world/public/world-schema/world-schema.js.map +0 -1
- package/ecs/world/system-declaration.d.ts +0 -1
- package/ecs/world/system-declaration.js +0 -23
- package/ecs/world/system-declaration.js.map +0 -1
- package/ecs/world/system-schedule-typing-test.d.ts +0 -1
- package/ecs/world/system-schedule-typing-test.js +0 -83
- package/ecs/world/system-schedule-typing-test.js.map +0 -1
- package/ecs/world/world-schema/public/create.d.ts +0 -12
- package/ecs/world/world-schema/public/create.js +0 -10
- package/ecs/world/world-schema/public/create.js.map +0 -1
- package/ecs/world/world-schema/public/create.test.d.ts +0 -1
- package/ecs/world/world-schema/public/create.test.js +0 -41
- package/ecs/world/world-schema/public/create.test.js.map +0 -1
- package/ecs/world/world-schema/public/index.d.ts +0 -1
- package/ecs/world/world-schema/public/index.js +0 -2
- package/ecs/world/world-schema/public/index.js.map +0 -1
- package/ecs/world/world-schema/system-factory.d.ts +0 -17
- package/ecs/world/world-schema/system-factory.js +0 -23
- package/ecs/world/world-schema/system-factory.js.map +0 -1
- package/ecs/world/world-schema/world-schema.d.ts +0 -19
- package/ecs/world/world-schema/world-schema.js +0 -23
- package/ecs/world/world-schema/world-schema.js.map +0 -1
- package/ecs/world/world.d.ts +0 -86
- package/ecs/world/world.js +0 -81
- package/ecs/world/world.js.map +0 -1
- package/ecs/world/world.test.d.ts +0 -1
- package/ecs/world/world.test.js +0 -176
- package/ecs/world/world.test.js.map +0 -1
- package/functions/package.json +0 -1
- package/lit/package.json +0 -1
- package/math/package.json +0 -1
- package/observe/package.json +0 -1
- package/old-ecs/package.json +0 -1
- package/perftest/package.json +0 -1
- package/samples/package.json +0 -1
- package/schema/package.json +0 -1
- package/service/package.json +0 -1
- package/table/package.json +0 -1
- package/typed-buffer/package.json +0 -1
- package/types/package.json +0 -1
- /package/{debug-type-test.d.ts → ecs/database/create-plugin-type.type-test.d.ts} +0 -0
- /package/ecs/database/{create-database-schema-test.d.ts → create-plugin-type.type.test.d.ts} +0 -0
- /package/ecs/database/{create-plugin-v2.test.d.ts → experimental-action-types.d.ts} +0 -0
- /package/ecs/database/{database-with-systems.test.d.ts → from-plugin.type-test.d.ts} +0 -0
- /package/ecs/database/{database.plugin.create.test.OLD.d.ts → plugin-types.d.ts} +0 -0
- /package/ecs/database/{database.plugin.create.test.d.ts → public/create-database.type-test.d.ts} +0 -0
- /package/ecs/database/{database.plugin.test.d.ts → type-investigation.test.d.ts} +0 -0
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
export const copyToGPUBuffer = (typedBuffer, device, gpuBuffer, byteLength, offset) => {
|
|
23
3
|
const array = typedBuffer.getTypedArray();
|
|
24
4
|
byteLength ??= array.byteLength;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-to-gpu-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/copy-to-gpu-buffer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"copy-to-gpu-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/copy-to-gpu-buffer.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAIvD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,WAA2B,EAC3B,MAAiB,EACjB,SAAoB,EACpB,UAAmB,EACnB,MAAe,EACN,EAAE;IACX,MAAM,KAAK,GAAG,WAAW,CAAC,aAAa,EAAE,CAAC;IAC1C,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC;IAChC,MAAM,KAAK,CAAC,CAAC;IACb,IAAI,SAAS,CAAC,IAAI,GAAG,UAAU,EAAE,CAAC;QAC9B,SAAS,CAAC,OAAO,EAAE,CAAC;QACpB,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;YAC5B,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,gBAAgB,EAAE,KAAK;SAC1B,CAAC,CAAC;IACP,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;IACzE,OAAO,SAAS,CAAC;AACrB,CAAC,CAAA"}
|
|
@@ -27,6 +27,16 @@ class ArrayTypedBuffer extends TypedBuffer {
|
|
|
27
27
|
set(index, value) {
|
|
28
28
|
this.array[index] = value;
|
|
29
29
|
}
|
|
30
|
+
isDefault(index) {
|
|
31
|
+
// Array buffers require schema.default to be specified (can be undefined as a value)
|
|
32
|
+
if (!('default' in this.schema)) {
|
|
33
|
+
throw new Error("Array buffer requires schema.default to check for default values");
|
|
34
|
+
}
|
|
35
|
+
const defaultValue = this.schema.default;
|
|
36
|
+
// Use Object.is for comparison (handles NaN, +0/-0 correctly)
|
|
37
|
+
// If default is undefined, check if value is undefined
|
|
38
|
+
return this.array[index] === defaultValue;
|
|
39
|
+
}
|
|
30
40
|
copyWithin(target, start, end) {
|
|
31
41
|
this.array.copyWithin(target, start, end);
|
|
32
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-array-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-array-buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-array-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-array-buffer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AAGjE,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC,MAAM,gBAAoB,SAAQ,WAAc;IAM5C,YAAY,MAAc,EAAE,sBAAoC;QAC5D,KAAK,CAAC,MAAM,CAAC,CAAC;QANF,SAAI,GAAoB,eAAe,CAAC;QACxC,iCAA4B,GAAW,CAAC,CAAC;QAMrD,IAAI,OAAO,sBAAsB,KAAK,QAAQ,EAAE,CAAC;YAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAI,sBAAsB,CAAC,CAAC;QACtD,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,KAAK,GAAG,sBAAsB,CAAC;QACxC,CAAC;IACL,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,IAAI,QAAQ,CAAC,KAAa;QACtB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,aAAa;QACT,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACjD,CAAC;IAED,GAAG,CAAC,KAAa;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IA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24 +1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { describe, it, expect } from "vitest";
|
|
23
3
|
import { createArrayBuffer } from "./create-array-buffer.js";
|
|
24
4
|
describe("createArrayBuffer.copy", () => {
|
|
@@ -48,4 +28,54 @@ describe("createArrayBuffer.copy", () => {
|
|
|
48
28
|
expect(copy.get(1)).toBe(arr2); // same reference
|
|
49
29
|
});
|
|
50
30
|
});
|
|
31
|
+
describe("createArrayBuffer.isDefault", () => {
|
|
32
|
+
it("should require schema.default for array buffers", () => {
|
|
33
|
+
const buf = createArrayBuffer({ type: "string" }, 3);
|
|
34
|
+
expect(() => {
|
|
35
|
+
buf.isDefault(0);
|
|
36
|
+
}).toThrow("Array buffer requires schema.default to check for default values");
|
|
37
|
+
});
|
|
38
|
+
it("should return true when value matches schema.default", () => {
|
|
39
|
+
const schema = { type: "string", default: "empty" };
|
|
40
|
+
const buf = createArrayBuffer(schema, 3);
|
|
41
|
+
// Uninitialized values are undefined, not the default
|
|
42
|
+
expect(buf.isDefault(0)).toBe(false);
|
|
43
|
+
buf.set(0, "empty");
|
|
44
|
+
buf.set(1, "not-empty");
|
|
45
|
+
buf.set(2, "empty");
|
|
46
|
+
expect(buf.isDefault(0)).toBe(true);
|
|
47
|
+
expect(buf.isDefault(1)).toBe(false);
|
|
48
|
+
expect(buf.isDefault(2)).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
it("should work with number defaults", () => {
|
|
51
|
+
const schema = { type: "number", default: 42 };
|
|
52
|
+
const buf = createArrayBuffer(schema, 3);
|
|
53
|
+
buf.set(0, 42);
|
|
54
|
+
buf.set(1, 0);
|
|
55
|
+
buf.set(2, 42);
|
|
56
|
+
expect(buf.isDefault(0)).toBe(true);
|
|
57
|
+
expect(buf.isDefault(1)).toBe(false);
|
|
58
|
+
expect(buf.isDefault(2)).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
it("should work with object defaults using Object.is", () => {
|
|
61
|
+
const defaultObj = { x: 1, y: 2 };
|
|
62
|
+
const schema = { type: "object", default: defaultObj };
|
|
63
|
+
const buf = createArrayBuffer(schema, 3);
|
|
64
|
+
buf.set(0, defaultObj);
|
|
65
|
+
buf.set(1, { x: 1, y: 2 }); // same value, different reference
|
|
66
|
+
buf.set(2, { x: 2, y: 3 }); // different value
|
|
67
|
+
expect(buf.isDefault(0)).toBe(true); // same reference
|
|
68
|
+
expect(buf.isDefault(1)).toBe(false); // different reference (Object.is)
|
|
69
|
+
expect(buf.isDefault(2)).toBe(false); // different value
|
|
70
|
+
});
|
|
71
|
+
it("should handle undefined as default", () => {
|
|
72
|
+
const schema = { type: "string", default: undefined };
|
|
73
|
+
const buf = createArrayBuffer(schema, 2);
|
|
74
|
+
// Uninitialized array elements are undefined
|
|
75
|
+
expect(buf.isDefault(0)).toBe(true);
|
|
76
|
+
expect(buf.isDefault(1)).toBe(true);
|
|
77
|
+
buf.set(0, "value");
|
|
78
|
+
expect(buf.isDefault(0)).toBe(false);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
51
81
|
//# sourceMappingURL=create-array-buffer.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-array-buffer.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-array-buffer.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-array-buffer.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-array-buffer.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC1D,MAAM,GAAG,GAAG,iBAAiB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;QACrD,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACpB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACpB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAEnB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,GAAG,CA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E9C,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB;QACtD,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,kCAAkC;QACxE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAA4B,CAAC;QAChF,MAAM,GAAG,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAEzC,6CAA6C;QAC7C,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACpB,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { describe, it, expect } from "vitest";
|
|
23
3
|
import { createConstBuffer } from "./create-const-buffer.js";
|
|
24
4
|
describe("createConstBuffer.copy", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-const-buffer.copy.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-const-buffer.copy.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-const-buffer.copy.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-const-buffer.copy.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC1E,MAAM,GAAG,GAAG,iBAAiB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QAExB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEhC,6CAA6C;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -19,6 +19,9 @@ class ConstTypedBuffer extends TypedBuffer {
|
|
|
19
19
|
set(_index, _value) {
|
|
20
20
|
// No-op: const buffer ignores set calls
|
|
21
21
|
}
|
|
22
|
+
isDefault(_index) {
|
|
23
|
+
return this.constValue === this.schema.default;
|
|
24
|
+
}
|
|
22
25
|
copyWithin(_target, _start, _end) {
|
|
23
26
|
// No-op: const buffer copyWithin is a no-op
|
|
24
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-const-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-const-buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-const-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-const-buffer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AAGjE,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC,MAAM,gBAAoB,SAAQ,WAAc;IAM5C,YAAY,MAAc,EAAE,eAAuB;QAC/C,KAAK,CAAC,MAAM,CAAC,CAAC;QAHF,SAAI,GAAoB,eAAe,CAAC;QAIpD,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,IAAI,4BAA4B;QAC5B,OAAO,CAAC,CAAC;IACb,CAAC;IAED,aAAa;QACT,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACnE,CAAC;IAED,GAAG,CAAC,MAAc;QACd,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,GAAG,CAAC,MAAc,EAAE,MAAS;QACzB,wCAAwC;IAC5C,CAAC;IAED,SAAS,CAAC,MAAc;QACpB,OAAO,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IACnD,CAAC;IAED,UAAU,CAAC,OAAe,EAAE,MAAc,EAAE,IAAY;QACpD,4CAA4C;IAChD,CAAC;IAED,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,QAAQ;QAChC,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjE,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC7B,MAAc,EACd,eAAuB,EACT,EAAE;IAChB,OAAO,IAAI,gBAAgB,CAAI,MAAM,EAAE,eAAe,CAAC,CAAC;AAC5D,CAAC,CAAC"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { describe, it, expect } from 'vitest';
|
|
23
3
|
import { createConstBuffer } from './create-const-buffer.js';
|
|
24
4
|
describe('createConstBuffer', () => {
|
|
@@ -97,4 +77,28 @@ describe('createConstBuffer', () => {
|
|
|
97
77
|
expect(booleanBuffer.get(0)).toBe(true);
|
|
98
78
|
});
|
|
99
79
|
});
|
|
80
|
+
describe('createConstBuffer.isDefault', () => {
|
|
81
|
+
it('should return true when const value matches schema.default', () => {
|
|
82
|
+
const buffer = createConstBuffer({ const: 42, default: 42 }, 3);
|
|
83
|
+
expect(buffer.isDefault(0)).toBe(true);
|
|
84
|
+
expect(buffer.isDefault(1)).toBe(true);
|
|
85
|
+
expect(buffer.isDefault(2)).toBe(true);
|
|
86
|
+
});
|
|
87
|
+
it('should return false when const value does not match schema.default', () => {
|
|
88
|
+
const buffer = createConstBuffer({ const: 42, default: 0 }, 2);
|
|
89
|
+
expect(buffer.isDefault(0)).toBe(false);
|
|
90
|
+
expect(buffer.isDefault(1)).toBe(false);
|
|
91
|
+
});
|
|
92
|
+
it('should work with object const values', () => {
|
|
93
|
+
const constValue = { x: 1, y: 2 };
|
|
94
|
+
const buffer = createConstBuffer({ const: constValue, default: constValue }, 2);
|
|
95
|
+
expect(buffer.isDefault(0)).toBe(true);
|
|
96
|
+
expect(buffer.isDefault(1)).toBe(true);
|
|
97
|
+
});
|
|
98
|
+
it('should handle undefined default', () => {
|
|
99
|
+
const buffer = createConstBuffer({ const: undefined, default: undefined }, 2);
|
|
100
|
+
expect(buffer.isDefault(0)).toBe(true);
|
|
101
|
+
expect(buffer.isDefault(1)).toBe(true);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
100
104
|
//# sourceMappingURL=create-const-buffer.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-const-buffer.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-const-buffer.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-const-buffer.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-const-buffer.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC5D,MAAM,UAAU,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC,C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AC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { resize } from "../internal/array-buffer-like/resize.js";
|
|
23
3
|
import { I32 } from "../math/i32/index.js";
|
|
24
4
|
import { U32 } from "../math/u32/index.js";
|
|
@@ -73,6 +53,10 @@ class NumberTypedBuffer extends TypedBuffer {
|
|
|
73
53
|
set(index, value) {
|
|
74
54
|
this.array[index] = value;
|
|
75
55
|
}
|
|
56
|
+
isDefault(index) {
|
|
57
|
+
// For TypedArray-backed buffers, default is always 0
|
|
58
|
+
return this.array[index] === 0;
|
|
59
|
+
}
|
|
76
60
|
copyWithin(target, start, end) {
|
|
77
61
|
this.array.copyWithin(target, start, end);
|
|
78
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-number-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-number-buffer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-number-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-number-buffer.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAG3C,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAExG,MAAM,wBAAwB,GAAG,CAAC,MAAc,EAAyB,EAAE;IACvE,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACxD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC/D,IAAI,MAAM,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBAC/E,OAAO,WAAW,CAAC;gBACvB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1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { describe, it, expect } from "vitest";
|
|
23
3
|
import { createNumberBuffer } from "./create-number-buffer.js";
|
|
24
4
|
import { F32 } from "../math/f32/index.js";
|
|
@@ -45,4 +25,42 @@ describe("createNumberBuffer.copy", () => {
|
|
|
45
25
|
expect(copy.get(0)).toBe(1);
|
|
46
26
|
});
|
|
47
27
|
});
|
|
28
|
+
describe("createNumberBuffer.isDefault", () => {
|
|
29
|
+
it("should return true for zero values (default for TypedArrays)", () => {
|
|
30
|
+
const buf = createNumberBuffer(F32.schema, 4);
|
|
31
|
+
// New buffer should be initialized to zeros
|
|
32
|
+
expect(buf.isDefault(0)).toBe(true);
|
|
33
|
+
expect(buf.isDefault(1)).toBe(true);
|
|
34
|
+
expect(buf.isDefault(2)).toBe(true);
|
|
35
|
+
expect(buf.isDefault(3)).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
it("should return false for non-zero values", () => {
|
|
38
|
+
const buf = createNumberBuffer(F32.schema, 4);
|
|
39
|
+
buf.set(0, 1);
|
|
40
|
+
buf.set(1, 0.5);
|
|
41
|
+
buf.set(2, -1);
|
|
42
|
+
buf.set(3, 0); // explicitly set to 0
|
|
43
|
+
expect(buf.isDefault(0)).toBe(false);
|
|
44
|
+
expect(buf.isDefault(1)).toBe(false);
|
|
45
|
+
expect(buf.isDefault(2)).toBe(false);
|
|
46
|
+
expect(buf.isDefault(3)).toBe(true); // still 0
|
|
47
|
+
});
|
|
48
|
+
it("should work with schema.default override", () => {
|
|
49
|
+
const schema = { ...F32.schema, default: 42 };
|
|
50
|
+
const buf = createNumberBuffer(schema, 3);
|
|
51
|
+
// Even with schema.default, TypedArray default is still 0
|
|
52
|
+
expect(buf.isDefault(0)).toBe(true);
|
|
53
|
+
buf.set(0, 42);
|
|
54
|
+
// Now it matches schema.default, but TypedArray check is still 0
|
|
55
|
+
expect(buf.isDefault(0)).toBe(false);
|
|
56
|
+
buf.set(0, 0);
|
|
57
|
+
expect(buf.isDefault(0)).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
it("should handle negative zero correctly", () => {
|
|
60
|
+
const buf = createNumberBuffer(F32.schema, 2);
|
|
61
|
+
buf.set(0, -0);
|
|
62
|
+
// -0 === 0 in JavaScript, so should be true
|
|
63
|
+
expect(buf.isDefault(0)).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
48
66
|
//# sourceMappingURL=create-number-buffer.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-number-buffer.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-number-buffer.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-number-buffer.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-number-buffer.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAE3C,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACtE,MAAM,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC9C,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEd,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QAExB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,GAAG,CA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,CAAC,CAAC;QAErC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACd,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC7C,MAAM,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC9C,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACf,4CAA4C;QAC5C,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { describe, it, expect } from "vitest";
|
|
23
3
|
import { createStructBuffer } from "./create-struct-buffer.js";
|
|
24
4
|
describe("createStructBuffer.copy", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-struct-buffer.copy.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-struct-buffer.copy.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-struct-buffer.copy.test.js","sourceRoot":"","sources":["../../src/typed-buffer/create-struct-buffer.copy.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACnE,MAAM,MAAM,GAAW;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;gBACnC,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;gBACnC,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;aACtC;YACD,MAAM,EAAE,QAAQ;SACnB,CAAC;QAEF,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC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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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { resize } from "../internal/array-buffer-like/resize.js";
|
|
23
3
|
import { createDataView32 } from "../internal/data-view-32/create-data-view-32.js";
|
|
24
4
|
import { createReadStruct } from "./structs/create-read-struct.js";
|
|
@@ -69,6 +49,17 @@ class StructTypedBuffer extends TypedBuffer {
|
|
|
69
49
|
set(index, value) {
|
|
70
50
|
this.write(this.dataView, index, value);
|
|
71
51
|
}
|
|
52
|
+
isDefault(index) {
|
|
53
|
+
// For TypedArray-backed structs, check if all Float32 values in the struct region are 0
|
|
54
|
+
const start = index * this.sizeInQuads;
|
|
55
|
+
const end = start + this.sizeInQuads;
|
|
56
|
+
for (let i = start; i < end; i++) {
|
|
57
|
+
if (this.typedArray[i] !== 0) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
72
63
|
copyWithin(target, start, end) {
|
|
73
64
|
this.dataView[this.arrayType].copyWithin(target * this.sizeInQuads, start * this.sizeInQuads, end * this.sizeInQuads);
|
|
74
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-struct-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-struct-buffer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-struct-buffer.js","sourceRoot":"","sources":["../../src/typed-buffer/create-struct-buffer.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAExG,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAEzC,MAAM,iBAAgF,SAAQ,WAA6B;IAcvH,YAAY,MAAS,EAAE,4BAAkD;QACrE,KAAK,CAAC,MAAM,CAAC,CAAC;QAdF,SAAI,GAAoB,gBAAgB,CAAC;QAgBrD,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC3B,IAAI,CA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AAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,IAAI;QACA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACrD,MAAM,cAAc,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;QACnD,iEAAiE;QACjE,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC5D,OAAO,IAAI,iBAAiB,CAAe,IAAI,CAAC,MAAW,EAAE,cAAc,CAAC,CAAC;IACjF,CAAC;CACJ;AAUD,MAAM,UAAU,kBAAkB,CAC9B,MAAS,EACT,4BAAkD;IAElD,OAAO,IAAI,iBAAiB,CAAe,MAAM,EAAE,4BAA4B,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
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.*/
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
22
2
|
import { describe, it, expect } from "vitest";
|
|
23
3
|
import { createStructBuffer } from "./create-struct-buffer.js";
|
|
24
4
|
import { F32 } from "../math/f32/index.js";
|
|
@@ -225,5 +205,65 @@ describe("createStructBuffer", () => {
|
|
|
225
205
|
expect(memorySavings).toBeCloseTo(0.125, 2); // 12.5% savings
|
|
226
206
|
});
|
|
227
207
|
});
|
|
208
|
+
describe("isDefault", () => {
|
|
209
|
+
it("should return true for zero-initialized structs", () => {
|
|
210
|
+
const schema = {
|
|
211
|
+
type: "object",
|
|
212
|
+
properties: {
|
|
213
|
+
position: Vec3Schema,
|
|
214
|
+
color: Vec4Schema
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const buffer = createStructBuffer(schema, 2);
|
|
218
|
+
// New buffer should be initialized to zeros
|
|
219
|
+
expect(buffer.isDefault(0)).toBe(true);
|
|
220
|
+
expect(buffer.isDefault(1)).toBe(true);
|
|
221
|
+
});
|
|
222
|
+
it("should return false for non-zero structs", () => {
|
|
223
|
+
const schema = {
|
|
224
|
+
type: "object",
|
|
225
|
+
properties: {
|
|
226
|
+
position: Vec3Schema,
|
|
227
|
+
scale: F32.schema
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const buffer = createStructBuffer(schema, 2);
|
|
231
|
+
buffer.set(0, { position: [1, 2, 3], scale: 1.5 });
|
|
232
|
+
expect(buffer.isDefault(0)).toBe(false);
|
|
233
|
+
expect(buffer.isDefault(1)).toBe(true); // still zero
|
|
234
|
+
});
|
|
235
|
+
it("should check all struct fields are zero", () => {
|
|
236
|
+
const schema = {
|
|
237
|
+
type: "object",
|
|
238
|
+
properties: {
|
|
239
|
+
a: F32.schema,
|
|
240
|
+
b: F32.schema
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
const buffer = createStructBuffer(schema, 3);
|
|
244
|
+
buffer.set(0, { a: 0, b: 0 });
|
|
245
|
+
buffer.set(1, { a: 1, b: 0 });
|
|
246
|
+
buffer.set(2, { a: 0, b: 1 });
|
|
247
|
+
expect(buffer.isDefault(0)).toBe(true); // both zero
|
|
248
|
+
expect(buffer.isDefault(1)).toBe(false); // a is non-zero
|
|
249
|
+
expect(buffer.isDefault(2)).toBe(false); // b is non-zero
|
|
250
|
+
});
|
|
251
|
+
it("should work with packed layout", () => {
|
|
252
|
+
const schema = {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {
|
|
255
|
+
position: Vec3Schema,
|
|
256
|
+
scale: F32.schema
|
|
257
|
+
},
|
|
258
|
+
layout: "packed"
|
|
259
|
+
};
|
|
260
|
+
const buffer = createStructBuffer(schema, 2);
|
|
261
|
+
expect(buffer.isDefault(0)).toBe(true);
|
|
262
|
+
buffer.set(0, { position: [0, 0, 0], scale: 0 });
|
|
263
|
+
expect(buffer.isDefault(0)).toBe(true);
|
|
264
|
+
buffer.set(0, { position: [1, 0, 0], scale: 0 });
|
|
265
|
+
expect(buffer.isDefault(0)).toBe(false);
|
|
266
|
+
});
|
|
267
|
+
});
|
|
228
268
|
});
|
|
229
269
|
//# sourceMappingURL=create-struct-buffer.test.js.map
|