@adobe/data 0.4.4 → 0.4.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.
Files changed (352) hide show
  1. package/dist/ecs/database/database-schema/create-database-from-schema.d.ts +12 -0
  2. package/dist/ecs/database/database-schema/create-database-from-schema.js +8 -0
  3. package/dist/ecs/database/database-schema/create-database-from-schema.js.map +1 -0
  4. package/dist/ecs/database/database-schema/create-database-schema-test.js +2 -2
  5. package/dist/ecs/database/database-schema/create-database-schema-test.js.map +1 -1
  6. package/dist/ecs/database/database-schema/create-database-schema.d.ts +3 -6
  7. package/dist/ecs/database/database-schema/create-database-schema.js +2 -2
  8. package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -1
  9. package/dist/{core/schema/validation/is-valid.test.js → ecs/database/database-schema/create-store-schema-test.js} +14 -18
  10. package/dist/ecs/database/database-schema/create-store-schema-test.js.map +1 -0
  11. package/dist/ecs/database/database-schema/create-store-schema.d.ts +9 -0
  12. package/dist/{core/functions/is-async-generator.js → ecs/database/database-schema/create-store-schema.js} +4 -3
  13. package/dist/ecs/database/database-schema/create-store-schema.js.map +1 -0
  14. package/dist/ecs/database/database-schema/database-schema.d.ts +2 -5
  15. package/dist/ecs/database/database-schema/index.d.ts +2 -2
  16. package/dist/ecs/database/database-schema/index.js +2 -2
  17. package/dist/ecs/database/database-schema/index.js.map +1 -1
  18. package/dist/ecs/database/database-schema/store-schema.d.ts +12 -0
  19. package/dist/ecs/{ecs/ecs-types.js → database/database-schema/store-schema.js} +1 -1
  20. package/dist/ecs/database/database-schema/store-schema.js.map +1 -0
  21. package/dist/ecs/database/database.d.ts +4 -4
  22. package/dist/ecs/database/index.d.ts +0 -1
  23. package/dist/ecs/database/index.js +0 -1
  24. package/dist/ecs/database/index.js.map +1 -1
  25. package/dist/{cache/functions/omit.js → ecs/database/store-schema/create-store-schema-test.js} +15 -8
  26. package/dist/ecs/database/store-schema/create-store-schema-test.js.map +1 -0
  27. package/dist/ecs/database/store-schema/create-store-schema.d.ts +9 -0
  28. package/dist/{core/index.js → ecs/database/store-schema/create-store-schema.js} +5 -4
  29. package/dist/ecs/database/store-schema/create-store-schema.js.map +1 -0
  30. package/dist/ecs/database/store-schema/index.d.ts +2 -0
  31. package/dist/ecs/{action-ecs → database/store-schema}/index.js +2 -1
  32. package/dist/ecs/database/store-schema/index.js.map +1 -0
  33. package/dist/ecs/database/store-schema/store-schema.d.ts +12 -0
  34. package/dist/ecs/database/{transactional-store/undoable.js → store-schema/store-schema.js} +1 -1
  35. package/dist/ecs/database/store-schema/store-schema.js.map +1 -0
  36. package/dist/ecs/database/transactional-store/apply-operations.d.ts +2 -2
  37. package/dist/ecs/database/transactional-store/apply-operations.js.map +1 -1
  38. package/dist/ecs/database/transactional-store/create-test-transaction.d.ts +0 -1
  39. package/dist/ecs/database/transactional-store/create-test-transaction.js.map +1 -1
  40. package/dist/ecs/database/transactional-store/create-transactional-store.js +5 -6
  41. package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
  42. package/dist/ecs/database/transactional-store/index.d.ts +0 -1
  43. package/dist/ecs/database/transactional-store/index.js +0 -1
  44. package/dist/ecs/database/transactional-store/index.js.map +1 -1
  45. package/dist/ecs/database/transactional-store/transactional-store.d.ts +1 -6
  46. package/dist/ecs/store/create-store.js.map +1 -1
  47. package/dist/ecs/store/index.d.ts +1 -0
  48. package/dist/ecs/store/index.js +1 -0
  49. package/dist/ecs/store/index.js.map +1 -1
  50. package/dist/{cache/functions/bind-functions.js → ecs/store/store-schema/create-store-schema-test.js} +15 -12
  51. package/dist/ecs/store/store-schema/create-store-schema-test.js.map +1 -0
  52. package/dist/ecs/store/store-schema/create-store-schema.d.ts +9 -0
  53. package/dist/{core/functions/index.js → ecs/store/store-schema/create-store-schema.js} +5 -4
  54. package/dist/ecs/store/store-schema/create-store-schema.js.map +1 -0
  55. package/dist/ecs/store/store-schema/index.d.ts +2 -0
  56. package/dist/ecs/{transaction-ecs → store/store-schema}/index.js +2 -2
  57. package/dist/ecs/store/store-schema/index.js.map +1 -0
  58. package/dist/ecs/store/store-schema/store-schema.d.ts +12 -0
  59. package/dist/{cache/functions/types.js → ecs/store/store-schema/store-schema.js} +1 -1
  60. package/dist/ecs/store/store-schema/store-schema.js.map +1 -0
  61. package/dist/ecs/store/store.d.ts +6 -0
  62. package/dist/ecs/undo-redo/create-undo-redo-actions.js +0 -21
  63. package/dist/ecs/undo-redo/create-undo-redo-actions.js.map +1 -1
  64. package/dist/ecs/undo-redo/create-undo-redo-actions.test.js.map +1 -1
  65. package/dist/functions/serialization/deserialize.d.ts +4 -1
  66. package/dist/functions/serialization/deserialize.js +14 -1
  67. package/dist/functions/serialization/deserialize.js.map +1 -1
  68. package/dist/functions/serialization/serialization.d.ts +23 -0
  69. package/dist/functions/serialization/serialization.js +58 -0
  70. package/dist/functions/serialization/serialization.js.map +1 -0
  71. package/dist/functions/serialization.d.ts +23 -0
  72. package/dist/functions/serialization.js +58 -0
  73. package/dist/functions/serialization.js.map +1 -0
  74. package/dist/{core/functions/with-validation.js → functions/serialization.test.js} +22 -16
  75. package/dist/functions/serialization.test.js.map +1 -0
  76. package/dist/functions/serialize.d.ts +17 -0
  77. package/dist/functions/serialize.js +66 -0
  78. package/dist/functions/serialize.js.map +1 -0
  79. package/dist/observe/to-async-generator.js +14 -11
  80. package/dist/observe/to-async-generator.js.map +1 -1
  81. package/dist/tsconfig.tsbuildinfo +1 -1
  82. package/dist/typed-buffer/structs/get-struct-layout.js +7 -10
  83. package/dist/typed-buffer/structs/get-struct-layout.js.map +1 -1
  84. package/dist/typed-buffer/structs/get-struct-layout.test.js +148 -11
  85. package/dist/typed-buffer/structs/get-struct-layout.test.js.map +1 -1
  86. package/package.json +1 -1
  87. package/dist/README.md +0 -310
  88. package/dist/cache/functions/bind-functions.d.ts +0 -6
  89. package/dist/cache/functions/bind-functions.js.map +0 -1
  90. package/dist/cache/functions/hashing/arrayBufferToHex.d.ts +0 -1
  91. package/dist/cache/functions/hashing/arrayBufferToHex.js +0 -27
  92. package/dist/cache/functions/hashing/arrayBufferToHex.js.map +0 -1
  93. package/dist/cache/functions/omit.d.ts +0 -1
  94. package/dist/cache/functions/omit.js.map +0 -1
  95. package/dist/cache/functions/types.d.ts +0 -1
  96. package/dist/cache/functions/types.js.map +0 -1
  97. package/dist/core/data.d.ts +0 -22
  98. package/dist/core/data.js +0 -52
  99. package/dist/core/data.js.map +0 -1
  100. package/dist/core/data.test.js +0 -48
  101. package/dist/core/data.test.js.map +0 -1
  102. package/dist/core/functions/array-equals.d.ts +0 -1
  103. package/dist/core/functions/array-equals.js +0 -34
  104. package/dist/core/functions/array-equals.js.map +0 -1
  105. package/dist/core/functions/deep-merge.d.ts +0 -32
  106. package/dist/core/functions/deep-merge.js +0 -54
  107. package/dist/core/functions/deep-merge.js.map +0 -1
  108. package/dist/core/functions/deep-merge.test.js +0 -94
  109. package/dist/core/functions/deep-merge.test.js.map +0 -1
  110. package/dist/core/functions/index.d.ts +0 -3
  111. package/dist/core/functions/index.js.map +0 -1
  112. package/dist/core/functions/is-async-generator.d.ts +0 -1
  113. package/dist/core/functions/is-async-generator.js.map +0 -1
  114. package/dist/core/functions/is-promise.d.ts +0 -1
  115. package/dist/core/functions/is-promise.js +0 -26
  116. package/dist/core/functions/is-promise.js.map +0 -1
  117. package/dist/core/functions/with-validation.d.ts +0 -5
  118. package/dist/core/functions/with-validation.js.map +0 -1
  119. package/dist/core/functions/with-validation.test.js +0 -96
  120. package/dist/core/functions/with-validation.test.js.map +0 -1
  121. package/dist/core/index.d.ts +0 -3
  122. package/dist/core/index.js.map +0 -1
  123. package/dist/core/schema/dynamic/dynamic-schema.d.ts +0 -27
  124. package/dist/core/schema/dynamic/dynamic-schema.js +0 -2
  125. package/dist/core/schema/dynamic/dynamic-schema.js.map +0 -1
  126. package/dist/core/schema/dynamic/enumerate-patches.d.ts +0 -9
  127. package/dist/core/schema/dynamic/enumerate-patches.js +0 -50
  128. package/dist/core/schema/dynamic/enumerate-patches.js.map +0 -1
  129. package/dist/core/schema/dynamic/enumerate-patches.test.d.ts +0 -134
  130. package/dist/core/schema/dynamic/enumerate-patches.test.js +0 -209
  131. package/dist/core/schema/dynamic/enumerate-patches.test.js.map +0 -1
  132. package/dist/core/schema/dynamic/get-dynamic-schema.d.ts +0 -5
  133. package/dist/core/schema/dynamic/get-dynamic-schema.js +0 -26
  134. package/dist/core/schema/dynamic/get-dynamic-schema.js.map +0 -1
  135. package/dist/core/schema/dynamic/get-dynamic-schema.test.d.ts +0 -1
  136. package/dist/core/schema/dynamic/get-dynamic-schema.test.js +0 -94
  137. package/dist/core/schema/dynamic/get-dynamic-schema.test.js.map +0 -1
  138. package/dist/core/schema/dynamic/index.d.ts +0 -1
  139. package/dist/core/schema/dynamic/index.js +0 -2
  140. package/dist/core/schema/dynamic/index.js.map +0 -1
  141. package/dist/core/schema/dynamic/schema-path-value-path.d.ts +0 -5
  142. package/dist/core/schema/dynamic/schema-path-value-path.js +0 -12
  143. package/dist/core/schema/dynamic/schema-path-value-path.js.map +0 -1
  144. package/dist/core/schema/dynamic-schema.d.ts +0 -27
  145. package/dist/core/schema/dynamic-schema.js +0 -2
  146. package/dist/core/schema/dynamic-schema.js.map +0 -1
  147. package/dist/core/schema/index.d.ts +0 -4
  148. package/dist/core/schema/index.js +0 -26
  149. package/dist/core/schema/index.js.map +0 -1
  150. package/dist/core/schema/schema.d.ts +0 -122
  151. package/dist/core/schema/schema.js +0 -34
  152. package/dist/core/schema/schema.js.map +0 -1
  153. package/dist/core/schema/schemas.d.ts +0 -45
  154. package/dist/core/schema/schemas.js +0 -39
  155. package/dist/core/schema/schemas.js.map +0 -1
  156. package/dist/core/schema/ui-schema.d.ts +0 -25
  157. package/dist/core/schema/ui-schema.js +0 -2
  158. package/dist/core/schema/ui-schema.js.map +0 -1
  159. package/dist/core/schema/validation/is-valid.d.ts +0 -2
  160. package/dist/core/schema/validation/is-valid.js +0 -14
  161. package/dist/core/schema/validation/is-valid.js.map +0 -1
  162. package/dist/core/schema/validation/is-valid.test.d.ts +0 -1
  163. package/dist/core/schema/validation/is-valid.test.js.map +0 -1
  164. package/dist/core/schema/validation/validate.d.ts +0 -2
  165. package/dist/core/schema/validation/validate.js +0 -38
  166. package/dist/core/schema/validation/validate.js.map +0 -1
  167. package/dist/core/schema/validation/validate.test.d.ts +0 -1
  168. package/dist/core/schema/validation/validate.test.js +0 -106
  169. package/dist/core/schema/validation/validate.test.js.map +0 -1
  170. package/dist/core/schema/validation/with-validation.d.ts +0 -5
  171. package/dist/core/schema/validation/with-validation.js +0 -16
  172. package/dist/core/schema/validation/with-validation.js.map +0 -1
  173. package/dist/core/schema/validation/with-validation.test.d.ts +0 -1
  174. package/dist/core/schema/validation/with-validation.test.js +0 -96
  175. package/dist/core/schema/validation/with-validation.test.js.map +0 -1
  176. package/dist/core/schema.d.ts +0 -86
  177. package/dist/core/schema.js +0 -33
  178. package/dist/core/schema.js.map +0 -1
  179. package/dist/core/schema.test.js +0 -16
  180. package/dist/core/schema.test.js.map +0 -1
  181. package/dist/core/schemas.d.ts +0 -45
  182. package/dist/core/schemas.js +0 -39
  183. package/dist/core/schemas.js.map +0 -1
  184. package/dist/ecs/action-ecs/action-ecs.d.ts +0 -19
  185. package/dist/ecs/action-ecs/action-ecs.js +0 -203
  186. package/dist/ecs/action-ecs/action-ecs.js.map +0 -1
  187. package/dist/ecs/action-ecs/action-ecs.test.d.ts +0 -1
  188. package/dist/ecs/action-ecs/action-ecs.test.js +0 -362
  189. package/dist/ecs/action-ecs/action-ecs.test.js.map +0 -1
  190. package/dist/ecs/action-ecs/action-types.d.ts +0 -106
  191. package/dist/ecs/action-ecs/action-types.js +0 -19
  192. package/dist/ecs/action-ecs/action-types.js.map +0 -1
  193. package/dist/ecs/action-ecs/index.d.ts +0 -2
  194. package/dist/ecs/action-ecs/index.js.map +0 -1
  195. package/dist/ecs/core-ecs/core-ecs-serialization.test.d.ts +0 -1
  196. package/dist/ecs/core-ecs/core-ecs-serialization.test.js +0 -230
  197. package/dist/ecs/core-ecs/core-ecs-serialization.test.js.map +0 -1
  198. package/dist/ecs/core-ecs/core-ecs-types.d.ts +0 -141
  199. package/dist/ecs/core-ecs/core-ecs-types.js +0 -23
  200. package/dist/ecs/core-ecs/core-ecs-types.js.map +0 -1
  201. package/dist/ecs/core-ecs/core-ecs.d.ts +0 -7
  202. package/dist/ecs/core-ecs/core-ecs.js +0 -492
  203. package/dist/ecs/core-ecs/core-ecs.js.map +0 -1
  204. package/dist/ecs/core-ecs/core-ecs.test.d.ts +0 -1
  205. package/dist/ecs/core-ecs/core-ecs.test.js +0 -425
  206. package/dist/ecs/core-ecs/core-ecs.test.js.map +0 -1
  207. package/dist/ecs/core-ecs/index.d.ts +0 -1
  208. package/dist/ecs/core-ecs/index.js +0 -2
  209. package/dist/ecs/core-ecs/index.js.map +0 -1
  210. package/dist/ecs/database/register-database-codec.d.ts +0 -1
  211. package/dist/ecs/database/register-database-codec.js +0 -35
  212. package/dist/ecs/database/register-database-codec.js.map +0 -1
  213. package/dist/ecs/database/register-database-codecs.d.ts +0 -1
  214. package/dist/ecs/database/register-database-codecs.js +0 -35
  215. package/dist/ecs/database/register-database-codecs.js.map +0 -1
  216. package/dist/ecs/database/register-store-codec.d.ts +0 -1
  217. package/dist/ecs/database/register-store-codec.js +0 -35
  218. package/dist/ecs/database/register-store-codec.js.map +0 -1
  219. package/dist/ecs/database/register-typed-buffer-codecs.d.ts +0 -1
  220. package/dist/ecs/database/register-typed-buffer-codecs.js +0 -80
  221. package/dist/ecs/database/register-typed-buffer-codecs.js.map +0 -1
  222. package/dist/ecs/database/transactional-store/apply-write-operations.d.ts +0 -7
  223. package/dist/ecs/database/transactional-store/apply-write-operations.js +0 -20
  224. package/dist/ecs/database/transactional-store/apply-write-operations.js.map +0 -1
  225. package/dist/ecs/database/transactional-store/applyWriteOperations.d.ts +0 -7
  226. package/dist/ecs/database/transactional-store/applyWriteOperations.js +0 -20
  227. package/dist/ecs/database/transactional-store/applyWriteOperations.js.map +0 -1
  228. package/dist/ecs/database/transactional-store/patch.d.ts +0 -3
  229. package/dist/ecs/database/transactional-store/patch.js +0 -7
  230. package/dist/ecs/database/transactional-store/patch.js.map +0 -1
  231. package/dist/ecs/database/transactional-store/undoable.d.ts +0 -13
  232. package/dist/ecs/database/transactional-store/undoable.js.map +0 -1
  233. package/dist/ecs/database/transactional-store/with-undoable.d.ts +0 -10
  234. package/dist/ecs/database/transactional-store/with-undoable.js +0 -13
  235. package/dist/ecs/database/transactional-store/with-undoable.js.map +0 -1
  236. package/dist/ecs/database/with-undoable.d.ts +0 -10
  237. package/dist/ecs/database/with-undoable.js +0 -13
  238. package/dist/ecs/database/with-undoable.js.map +0 -1
  239. package/dist/ecs/ecs/ecs-types.d.ts +0 -132
  240. package/dist/ecs/ecs/ecs-types.js.map +0 -1
  241. package/dist/ecs/ecs/ecs-where-functions.d.ts +0 -6
  242. package/dist/ecs/ecs/ecs-where-functions.js +0 -91
  243. package/dist/ecs/ecs/ecs-where-functions.js.map +0 -1
  244. package/dist/ecs/ecs/ecs.d.ts +0 -13
  245. package/dist/ecs/ecs/ecs.js +0 -177
  246. package/dist/ecs/ecs/ecs.js.map +0 -1
  247. package/dist/ecs/ecs/ecs.test.d.ts +0 -1
  248. package/dist/ecs/ecs/ecs.test.js +0 -399
  249. package/dist/ecs/ecs/ecs.test.js.map +0 -1
  250. package/dist/ecs/ecs/index.d.ts +0 -3
  251. package/dist/ecs/ecs/index.js +0 -3
  252. package/dist/ecs/ecs/index.js.map +0 -1
  253. package/dist/ecs/entity-location-table/register-database-codec.d.ts +0 -1
  254. package/dist/ecs/entity-location-table/register-database-codec.js +0 -35
  255. package/dist/ecs/entity-location-table/register-database-codec.js.map +0 -1
  256. package/dist/ecs/entity-location-table/register-entity-location-table-codec.d.ts +0 -1
  257. package/dist/ecs/entity-location-table/register-entity-location-table-codec.js +0 -42
  258. package/dist/ecs/entity-location-table/register-entity-location-table-codec.js.map +0 -1
  259. package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.d.ts +0 -1
  260. package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js +0 -70
  261. package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js.map +0 -1
  262. package/dist/ecs/persistence-service/create-persistence-service.d.ts +0 -6
  263. package/dist/ecs/persistence-service/create-persistence-service.js +0 -24
  264. package/dist/ecs/persistence-service/create-persistence-service.js.map +0 -1
  265. package/dist/ecs/persistence-service/create-session-persistence-service.d.ts +0 -8
  266. package/dist/ecs/persistence-service/create-session-persistence-service.js +0 -49
  267. package/dist/ecs/persistence-service/create-session-persistence-service.js.map +0 -1
  268. package/dist/ecs/persistence-service/persistence-service copy.d.ts +0 -5
  269. package/dist/ecs/persistence-service/persistence-service copy.js +0 -2
  270. package/dist/ecs/persistence-service/persistence-service copy.js.map +0 -1
  271. package/dist/ecs/persistence-service/to-blob-refs.d.ts +0 -2
  272. package/dist/ecs/persistence-service/to-blob-refs.js +0 -3
  273. package/dist/ecs/persistence-service/to-blob-refs.js.map +0 -1
  274. package/dist/ecs/persistence-service/undo-redo-service.d.ts +0 -11
  275. package/dist/ecs/persistence-service/undo-redo-service.js +0 -23
  276. package/dist/ecs/persistence-service/undo-redo-service.js.map +0 -1
  277. package/dist/ecs/store/core/register-core-codec.d.ts +0 -1
  278. package/dist/ecs/store/core/register-core-codec.js +0 -45
  279. package/dist/ecs/store/core/register-core-codec.js.map +0 -1
  280. package/dist/ecs/store/core/register-core-codec.test.d.ts +0 -1
  281. package/dist/ecs/store/core/register-core-codec.test.js +0 -136
  282. package/dist/ecs/store/core/register-core-codec.test.js.map +0 -1
  283. package/dist/ecs/store/query.d.ts +0 -47
  284. package/dist/ecs/store/query.js +0 -2
  285. package/dist/ecs/store/query.js.map +0 -1
  286. package/dist/ecs/store/register-core-codec.d.ts +0 -1
  287. package/dist/ecs/store/register-core-codec.js +0 -38
  288. package/dist/ecs/store/register-core-codec.js.map +0 -1
  289. package/dist/ecs/store/register-store-codec.d.ts +0 -1
  290. package/dist/ecs/store/register-store-codec.js +0 -38
  291. package/dist/ecs/store/register-store-codec.js.map +0 -1
  292. package/dist/ecs/store/restore-store.d.ts +0 -12
  293. package/dist/ecs/store/restore-store.js +0 -91
  294. package/dist/ecs/store/restore-store.js.map +0 -1
  295. package/dist/ecs/store/select-options.d.ts +0 -1
  296. package/dist/ecs/store/select-options.js +0 -16
  297. package/dist/ecs/store/select-options.js.map +0 -1
  298. package/dist/ecs/store/select.d.ts +0 -44
  299. package/dist/ecs/store/select.js +0 -2
  300. package/dist/ecs/store/select.js.map +0 -1
  301. package/dist/ecs/transaction-ecs/index.d.ts +0 -2
  302. package/dist/ecs/transaction-ecs/index.js.map +0 -1
  303. package/dist/ecs/transaction-ecs/transaction-ecs.d.ts +0 -11
  304. package/dist/ecs/transaction-ecs/transaction-ecs.js +0 -184
  305. package/dist/ecs/transaction-ecs/transaction-ecs.js.map +0 -1
  306. package/dist/ecs/transaction-ecs/transaction-ecs.test.d.ts +0 -1
  307. package/dist/ecs/transaction-ecs/transaction-ecs.test.js +0 -599
  308. package/dist/ecs/transaction-ecs/transaction-ecs.test.js.map +0 -1
  309. package/dist/ecs/transaction-ecs/transaction-types.d.ts +0 -135
  310. package/dist/ecs/transaction-ecs/transaction-types.js +0 -2
  311. package/dist/ecs/transaction-ecs/transaction-types.js.map +0 -1
  312. package/dist/ecs/transaction-ecs/transactions.d.ts +0 -5
  313. package/dist/ecs/transaction-ecs/transactions.js +0 -158
  314. package/dist/ecs/transaction-ecs/transactions.js.map +0 -1
  315. package/dist/ecs/undo-redo/do.d.ts +0 -3
  316. package/dist/ecs/undo-redo/do.js +0 -3
  317. package/dist/ecs/undo-redo/do.js.map +0 -1
  318. package/dist/ecs/undo-redo/index.d.ts +0 -1
  319. package/dist/ecs/undo-redo/index.js +0 -23
  320. package/dist/ecs/undo-redo/index.js.map +0 -1
  321. package/dist/functions/serialization/register-typed-array-codecs copy.d.ts +0 -1
  322. package/dist/functions/serialization/register-typed-array-codecs copy.js +0 -13
  323. package/dist/functions/serialization/register-typed-array-codecs copy.js.map +0 -1
  324. package/dist/functions/serialization/serialize-to-blobs copy.d.ts +0 -8
  325. package/dist/functions/serialization/serialize-to-blobs copy.js +0 -21
  326. package/dist/functions/serialization/serialize-to-blobs copy.js.map +0 -1
  327. package/dist/observe/with-map copy.d.ts +0 -5
  328. package/dist/observe/with-map copy.js +0 -14
  329. package/dist/observe/with-map copy.js.map +0 -1
  330. package/dist/package.json +0 -129
  331. package/dist/schema/f32 copy.d.ts +0 -6
  332. package/dist/schema/f32 copy.js +0 -6
  333. package/dist/schema/f32 copy.js.map +0 -1
  334. package/dist/schemas/index.d.ts +0 -1
  335. package/dist/schemas/index.js +0 -23
  336. package/dist/schemas/index.js.map +0 -1
  337. package/dist/schemas/schemas.d.ts +0 -45
  338. package/dist/schemas/schemas.js +0 -39
  339. package/dist/schemas/schemas.js.map +0 -1
  340. package/dist/service/sequential-action.d.ts +0 -18
  341. package/dist/service/sequential-action.js +0 -45
  342. package/dist/service/sequential-action.js.map +0 -1
  343. package/dist/table/ensure-capacity copy.d.ts +0 -2
  344. package/dist/table/ensure-capacity copy.js +0 -15
  345. package/dist/table/ensure-capacity copy.js.map +0 -1
  346. package/dist/table/filter-rows.d.ts +0 -2
  347. package/dist/table/filter-rows.js +0 -15
  348. package/dist/table/filter-rows.js.map +0 -1
  349. /package/dist/{core/data.test.d.ts → ecs/database/database-schema/create-store-schema-test.d.ts} +0 -0
  350. /package/dist/{core/functions/deep-merge.test.d.ts → ecs/database/store-schema/create-store-schema-test.d.ts} +0 -0
  351. /package/dist/{core/functions/with-validation.test.d.ts → ecs/store/store-schema/create-store-schema-test.d.ts} +0 -0
  352. /package/dist/{core/schema.test.d.ts → functions/serialization.test.d.ts} +0 -0
@@ -1,80 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- import { copyViewBytes } from "../functions/copy-view-bytes.js";
23
- import { registerCodec } from "../functions/serialization/codec.js";
24
- import { createArrayBuffer } from "./create-array-buffer.js";
25
- import { createConstBuffer } from "./create-const-buffer.js";
26
- import { createNumberBuffer } from "./create-number-buffer.js";
27
- import { createStructBuffer } from "./create-struct-buffer.js";
28
- import { isTypedBuffer } from "./is-typed-buffer.js";
29
- export function registerTypedBufferCodecs() {
30
- registerCodec({
31
- name: "typed-buffer",
32
- predicate: isTypedBuffer,
33
- serialize: (data) => {
34
- const { type, schema, capacity } = data;
35
- try {
36
- switch (type) {
37
- case "const":
38
- return { json: { type, schema, capacity } };
39
- case "array":
40
- return { json: { type, schema, capacity, array: data.slice() } };
41
- case "number":
42
- case "struct":
43
- const typedArray = data.getTypedArray();
44
- return { json: { type, schema, capacity }, binary: [new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength)] };
45
- }
46
- }
47
- catch (e) {
48
- console.log("error serializing this", data, e, "data.slice", data.slice);
49
- throw e;
50
- }
51
- },
52
- deserialize: ({ json, binary }) => {
53
- const encoded = json;
54
- const { type, schema, capacity, array } = encoded;
55
- switch (type) {
56
- case "const": {
57
- return createConstBuffer(schema, capacity);
58
- }
59
- case "array": {
60
- const buffer = createArrayBuffer(schema, capacity);
61
- for (let i = 0; i < capacity; i++) {
62
- buffer.set(i, array[i]);
63
- }
64
- return buffer;
65
- }
66
- case "number": {
67
- const buffer = createNumberBuffer(schema, capacity);
68
- copyViewBytes(binary[0], buffer.getTypedArray());
69
- return buffer;
70
- }
71
- case "struct": {
72
- const buffer = createStructBuffer(schema, capacity);
73
- copyViewBytes(binary[0], buffer.getTypedArray());
74
- return buffer;
75
- }
76
- }
77
- },
78
- });
79
- }
80
- //# sourceMappingURL=register-typed-buffer-codecs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register-typed-buffer-codecs.js","sourceRoot":"","sources":["../../../src/ecs/database/register-typed-buffer-codecs.ts"],"names":[],"mappings":"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"}
@@ -1,7 +0,0 @@
1
- import { ResourceComponents } from "../../store/resource-components.js";
2
- import { Store } from "../../store/index.js";
3
- import { TransactionWriteOperation } from "./transactional-store.js";
4
- import { StringKeyof } from "../../../types/types.js";
5
- import { Components } from "../../store/components.js";
6
- import { ArchetypeComponents } from "../../store/archetype-components.js";
7
- export declare const applyWriteOperations: <C extends Components, R extends ResourceComponents, A extends ArchetypeComponents<StringKeyof<C>>>(store: Store<C, R, A>) => (operations: TransactionWriteOperation<C>[]) => void;
@@ -1,20 +0,0 @@
1
- // Helper function to apply write operations for rollback
2
- export const applyWriteOperations = (store) => (operations) => {
3
- for (const operation of operations) {
4
- switch (operation.type) {
5
- case "insert": {
6
- const componentNames = ["id", ...Object.keys(operation.values)];
7
- const archetype = store.ensureArchetype(componentNames);
8
- archetype.insert(operation.values);
9
- break;
10
- }
11
- case "update":
12
- store.update(operation.entity, operation.values);
13
- break;
14
- case "delete":
15
- store.delete(operation.entity);
16
- break;
17
- }
18
- }
19
- };
20
- //# sourceMappingURL=apply-write-operations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-write-operations.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/apply-write-operations.ts"],"names":[],"mappings":"AAOA,yDAAyD;AACzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAChC,KAAqB,EACvB,EAAE,CAAC,CACD,UAA0C,EAC5C,EAAE;IACI,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACZ,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAqB,CAAC;gBACpF,MAAM,SAAS,GAAG,KAAK,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;gBACxD,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,MAAa,CAAC,CAAC;gBAC1C,MAAM;YACV,CAAC;YACD,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBACjD,MAAM;YACV,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/B,MAAM;QACd,CAAC;IACL,CAAC;AACL,CAAC,CAAA"}
@@ -1,7 +0,0 @@
1
- import { ResourceComponents } from "../../store/resource-components.js";
2
- import { Store } from "../../store/index.js";
3
- import { TransactionWriteOperation } from "./transactional-store.js";
4
- import { StringKeyof } from "../../../types/types.js";
5
- import { Components } from "../../store/components.js";
6
- import { ArchetypeComponents } from "../../store/archetype-components.js";
7
- export declare function applyWriteOperations<C extends Components, R extends ResourceComponents, A extends ArchetypeComponents<StringKeyof<C>>>(store: Store<C, R, A>, operations: TransactionWriteOperation<C>[]): void;
@@ -1,20 +0,0 @@
1
- // Helper function to apply write operations for rollback
2
- export function applyWriteOperations(store, operations) {
3
- for (const operation of operations) {
4
- switch (operation.type) {
5
- case "insert": {
6
- const componentNames = ["id", ...Object.keys(operation.values)];
7
- const archetype = store.ensureArchetype(componentNames);
8
- archetype.insert(operation.values);
9
- break;
10
- }
11
- case "update":
12
- store.update(operation.entity, operation.values);
13
- break;
14
- case "delete":
15
- store.delete(operation.entity);
16
- break;
17
- }
18
- }
19
- }
20
- //# sourceMappingURL=applyWriteOperations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"applyWriteOperations.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/applyWriteOperations.ts"],"names":[],"mappings":"AAOA,yDAAyD;AACzD,MAAM,UAAU,oBAAoB,CAChC,KAAqB,EACrB,UAA0C;IAE1C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACZ,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAqB,CAAC;gBACpF,MAAM,SAAS,GAAG,KAAK,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;gBACxD,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,MAAa,CAAC,CAAC;gBAC1C,MAAM;YACV,CAAC;YACD,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBACjD,MAAM;YACV,KAAK,QAAQ;gBACT,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/B,MAAM;QACd,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- import { EntityUpdateValues } from "../../store/core/index.js";
2
- import { Components } from "../../store/components.js";
3
- export declare function patch<C extends Components>(a: EntityUpdateValues<C> | null | undefined, b: EntityUpdateValues<C> | null): Partial<Omit<C, "id">> | null;
@@ -1,7 +0,0 @@
1
- export function patch(a, b) {
2
- if (!a || !b) {
3
- return b;
4
- }
5
- return { ...a, ...b };
6
- }
7
- //# sourceMappingURL=patch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"patch.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/patch.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,KAAK,CAAuB,CAA2C,EAAE,CAA+B;IACpH,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,CAAC;IACb,CAAC;IACD,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAC1B,CAAC"}
@@ -1,13 +0,0 @@
1
- export type Undoable = {
2
- /**
3
- * Uniquely identifies this type of operation.
4
- * This could be used by an undo/redo manager to find localization strings to display to the user.
5
- */
6
- id: string;
7
- /**
8
- * Whether this operation can be combined with the previous operation.
9
- * This is useful for operations that are equivalent, such as adding the same component to an entity multiple times.
10
- * The value is either a boolean or else a data value that if equals() with the previous operation's coalesce value will cause the operations to be combined.
11
- */
12
- coalesce: boolean | unknown;
13
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"undoable.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/undoable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
@@ -1,10 +0,0 @@
1
- import { TransactionDeclaration } from "../database.js";
2
- import { Undoable } from "../undoable.js";
3
- /**
4
- * Convenience function to add an undoable property to a transaction declaration.
5
- * The undoable property will be used by the database to provide undoable properties for each transaction.
6
- * @param td - The transaction declaration to add the undoable property to.
7
- * @param undoable - A function that returns an undoable object.
8
- * @returns A new transaction declaration with the undoable property added.
9
- */
10
- export declare function withUndoable<I, TD extends TransactionDeclaration<I>>(td: TD, undoable: (input: I) => Undoable): TD;
@@ -1,13 +0,0 @@
1
- /**
2
- * Convenience function to add an undoable property to a transaction declaration.
3
- * The undoable property will be used by the database to provide undoable properties for each transaction.
4
- * @param td - The transaction declaration to add the undoable property to.
5
- * @param undoable - A function that returns an undoable object.
6
- * @returns A new transaction declaration with the undoable property added.
7
- */
8
- export function withUndoable(td, undoable) {
9
- return Object.assign(td, {
10
- undoable: undoable
11
- });
12
- }
13
- //# sourceMappingURL=with-undoable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"with-undoable.js","sourceRoot":"","sources":["../../../../src/ecs/database/transactional-store/with-undoable.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CACxB,EAAM,EACN,QAAgC;IAEhC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;QACrB,QAAQ,EAAE,QAAQ;KACrB,CAAC,CAAC;AACP,CAAC"}
@@ -1,10 +0,0 @@
1
- import { TransactionDeclaration } from "./database.js";
2
- import { Undoable } from "./undoable.js";
3
- /**
4
- * Convenience function to add an undoable property to a transaction declaration.
5
- * The undoable property will be used by the database to provide undoable properties for each transaction.
6
- * @param td - The transaction declaration to add the undoable property to.
7
- * @param undoable - A function that returns an undoable object.
8
- * @returns A new transaction declaration with the undoable property added.
9
- */
10
- export declare function withUndoable<I, TD extends TransactionDeclaration<I>>(td: TD, undoable: ((input: I) => Undoable) | (() => Undoable)): TD;
@@ -1,13 +0,0 @@
1
- /**
2
- * Convenience function to add an undoable property to a transaction declaration.
3
- * The undoable property will be used by the database to provide undoable properties for each transaction.
4
- * @param td - The transaction declaration to add the undoable property to.
5
- * @param undoable - A function that returns an undoable object.
6
- * @returns A new transaction declaration with the undoable property added.
7
- */
8
- export function withUndoable(td, undoable) {
9
- return Object.assign(td, {
10
- undoable: undoable
11
- });
12
- }
13
- //# sourceMappingURL=with-undoable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"with-undoable.js","sourceRoot":"","sources":["../../../src/ecs/database/with-undoable.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CACxB,EAAM,EACN,QAAqD;IAErD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;QACrB,QAAQ,EAAE,QAAQ;KACrB,CAAC,CAAC;AACP,CAAC"}
@@ -1,132 +0,0 @@
1
- import { Data, FromSchema, Schema } from "../../core/index.js";
2
- import { Simplify } from "../../types/types.js";
3
- import { CoreComponents, ECSJSON, Table } from "../core-ecs/core-ecs-types.js";
4
- import { EntityCreateValues, Entity, EntityValues, EntityUpdateValues } from "../core-ecs/core-ecs-types.js";
5
- export type ECSComponents = CoreComponents;
6
- /**
7
- * Represents a runtime handle to an ECS Archetype.
8
- * An archetype represents a set of components that are required to be present on an entity.
9
- * These instances cannot be created directly or persisted but are returned from the ECS API.
10
- */
11
- export interface Archetype<EntityType = any> {
12
- readonly components: readonly (keyof EntityType)[];
13
- }
14
- export type ECSResources = {};
15
- export type TypeFromComponents<C extends ECSComponents, T extends (keyof C)[]> = {
16
- [K in T[number]]: C[K];
17
- };
18
- export type ECSArchetypes = {};
19
- /**
20
- * Comparison operators for declarative where clauses
21
- */
22
- type ComparisonOperator = "==" | "!=" | "<" | ">" | ">=" | "<=";
23
- /**
24
- * Represents a comparison operation in a declarative where clause
25
- */
26
- type ComparisonOperation<T> = {
27
- [P in ComparisonOperator]?: T;
28
- };
29
- /**
30
- * Represents a condition that can be either a direct value, comparison operation, or nested conditions
31
- */
32
- type WhereCondition<T> = T extends object ? {
33
- [K in keyof T]?: WhereCondition<T[K]>;
34
- } | ComparisonOperation<T> : T | ComparisonOperation<T>;
35
- /**
36
- * Declarative where clause structure that allows for JSON-based filtering
37
- * Each key in the object represents a component field to filter on
38
- * The value can either be a direct value (equality check), a comparison operation, or nested conditions
39
- */
40
- export type WhereClause<T extends CoreComponents> = {
41
- [K in keyof T]?: WhereCondition<T[K]>;
42
- };
43
- type SelectOrder<T extends CoreComponents> = {
44
- [K in keyof T]?: boolean;
45
- };
46
- export type SelectOptions<C extends CoreComponents, T extends CoreComponents> = {
47
- /**
48
- * Order results by the given components ascending or descending.
49
- */
50
- order?: SelectOrder<T>;
51
- /**
52
- * Components to include in the results.
53
- */
54
- components?: (keyof T)[];
55
- /**
56
- * Do not return any rows for entities that contain these components.
57
- */
58
- without?: (keyof C)[];
59
- /**
60
- * Filter the results by the given condition using a declarative where clause.
61
- */
62
- where?: WhereClause<T>;
63
- };
64
- /**
65
- * An Entity Component System (ECS) is a data structure that stores entities and their components.
66
- * This interface is used for low level ECS instances that allow fast, direct read and write access.
67
- */
68
- export interface ECS<C extends ECSComponents = ECSComponents, // name => Component Value Type
69
- A extends ECSArchetypes = ECSArchetypes, // name => Archetype
70
- R extends ECSResources = ECSResources> extends ECSWrite<C> {
71
- components: {
72
- readonly [K in keyof C]: Schema;
73
- };
74
- archetypes: A;
75
- resources: {
76
- -readonly [K in keyof R]: R[K];
77
- };
78
- withComponents<S extends {
79
- [K: string]: Schema;
80
- }, T = {
81
- [K in keyof S]: FromSchema<S[K]>;
82
- }>(components: S): ECS<Simplify<C & T>, A, R>;
83
- withArchetypes<S extends {
84
- [K: string]: ReadonlyArray<keyof C>;
85
- }>(archetypes: S): ECS<C, Simplify<A & {
86
- -readonly [AN in keyof S]: Archetype<{
87
- [PN in S[AN][number]]: C[PN];
88
- }>;
89
- }>, R>;
90
- withResources<S extends {
91
- [K: string]: Data;
92
- }>(resources: S): ECS<C, A, Simplify<R & S>>;
93
- getComponentValue<Name extends keyof C>(id: Entity, component: Name): C[Name] | undefined;
94
- getArchetype<AC extends (keyof C)[]>(...components: AC): Archetype<TypeFromComponents<C, AC>>;
95
- getEntityArchetype(id: Entity): Archetype;
96
- /**
97
- * @returns
98
- * The entity values if this entity contains all of the archetype components.
99
- * Null if the entity exists but does not contain all of the archetype components.
100
- * Undefined if the entity does not exist.
101
- */
102
- getEntityValues<A>(id: Entity, archetype: Archetype<A>): A & Partial<EntityValues<C>> | null | undefined;
103
- /**
104
- * @returns The entity values if this entity exists otherwise undefined.
105
- */
106
- getEntityValues(id: Entity): EntityValues<C> | undefined;
107
- countEntities<T extends CoreComponents>(archetype: Archetype<T>): number;
108
- selectEntities<T extends CoreComponents, P extends Partial<T>>(archetype: Archetype<T>, options?: Omit<SelectOptions<C, T>, "components">): Entity[];
109
- getTables(): Table[];
110
- getTables<T>(archetype: Archetype<T>, options: {
111
- mode: "read" | "write";
112
- exact?: boolean;
113
- }): Table<T>[];
114
- selectEntityValues<T extends CoreComponents, P extends Partial<T>>(archetype: Archetype<T>, options: SelectOptions<C, T>): P[];
115
- selectEntityValues<T extends CoreComponents>(archetype: Archetype<T>): Simplify<T & EntityValues<C>>[];
116
- createBatch<T>(archetype: Archetype<T>, count: number): Table<T>;
117
- toJSON(): ECSJSON;
118
- }
119
- export interface ECSWrite<C extends ECSComponents> {
120
- /**
121
- * Sets the value of a component for the given entity.
122
- * @param component the component to write.
123
- * @param value the value of the component or undefined to delete the component.
124
- * @param id if not provided, uses the components own entity id as with resources.
125
- */
126
- setComponentValue<Name extends keyof C>(id: Entity, component: Name, value: C[Name] | undefined): void;
127
- createEntity(): Entity;
128
- createEntity<T>(archetype: Archetype<T>, values: EntityCreateValues<T>): Entity;
129
- updateEntity(id: Entity, values: EntityUpdateValues<C>): void;
130
- deleteEntity(id: Entity): void;
131
- }
132
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecs-types.js","sourceRoot":"","sources":["../../../src/ecs/ecs/ecs-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
@@ -1,6 +0,0 @@
1
- import { EntityValues, CoreComponents } from "../core-ecs/core-ecs-types.js";
2
- import { WhereClause } from "./ecs-types.js";
3
- /**
4
- * Converts a declarative where clause to a predicate function
5
- */
6
- export declare function whereClauseToPredicate<T extends CoreComponents>(whereClause: WhereClause<T>): (entity: EntityValues<T>) => boolean;
@@ -1,91 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- /**
23
- * Converts a declarative where clause to a predicate function
24
- */
25
- export function whereClauseToPredicate(whereClause) {
26
- // Helper function to get nested value
27
- function getNestedValue(obj, path) {
28
- return path.reduce((current, key) => current && current[key], obj);
29
- }
30
- // Helper function to check conditions recursively
31
- function checkCondition(value, condition) {
32
- // If condition is a direct value, check for equality
33
- if (typeof condition !== 'object' || condition === null) {
34
- return value === condition;
35
- }
36
- // If condition is an object but not a comparison operation, it's a nested path
37
- if (!('==' in condition || '!=' in condition || '<' in condition || '>' in condition || '<=' in condition || '>=' in condition)) {
38
- // Recursively check all nested conditions
39
- return Object.entries(condition).every(([key, subCondition]) => checkCondition(value[key], subCondition));
40
- }
41
- // Handle comparison operations
42
- for (const [op, compareValue] of Object.entries(condition)) {
43
- switch (op) {
44
- case "==":
45
- if (value !== compareValue)
46
- return false;
47
- break;
48
- case "!=":
49
- if (value === compareValue)
50
- return false;
51
- break;
52
- case "<":
53
- if (typeof value === 'number' && typeof compareValue === 'number') {
54
- if (!(value < compareValue))
55
- return false;
56
- }
57
- break;
58
- case ">":
59
- if (typeof value === 'number' && typeof compareValue === 'number') {
60
- if (!(value > compareValue))
61
- return false;
62
- }
63
- break;
64
- case "<=":
65
- if (typeof value === 'number' && typeof compareValue === 'number') {
66
- if (!(value <= compareValue))
67
- return false;
68
- }
69
- break;
70
- case ">=":
71
- if (typeof value === 'number' && typeof compareValue === 'number') {
72
- if (!(value >= compareValue))
73
- return false;
74
- }
75
- break;
76
- }
77
- }
78
- return true;
79
- }
80
- return (entity) => {
81
- for (const [key, condition] of Object.entries(whereClause)) {
82
- const fieldKey = key;
83
- const value = entity[fieldKey];
84
- if (!checkCondition(value, condition)) {
85
- return false;
86
- }
87
- }
88
- return true;
89
- };
90
- }
91
- //# sourceMappingURL=ecs-where-functions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecs-where-functions.js","sourceRoot":"","sources":["../../../src/ecs/ecs/ecs-where-functions.ts"],"names":[],"mappings":"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"}
@@ -1,13 +0,0 @@
1
- import { MemoryAllocator } from "../../cache/memory-allocator.js";
2
- import { ECSJSON } from "../core-ecs/core-ecs-types.js";
3
- import { ECS, ECSArchetypes, ECSComponents, ECSResources } from "./ecs-types.js";
4
- /**
5
- * Creates a new low level ECS.
6
- * This can be used for high performance applications but
7
- * for most cases the createActionECS is a better choice.
8
- * @param json a value previously returned from calling toJSON.
9
- */
10
- export declare function createECS<C extends ECSComponents = ECSComponents, A extends ECSArchetypes = ECSArchetypes, R extends ECSResources = ECSResources>(options?: {
11
- allocator?: MemoryAllocator;
12
- data?: ECSJSON;
13
- }): ECS<C, A, R>;