@synnaxlabs/x 0.16.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +99 -7
- package/.vscode/settings.json +5 -1
- package/dist/base-Cz4DfmJf.js +37 -0
- package/dist/base-D3FrPu8C.cjs +1 -0
- package/dist/binary.cjs +1 -0
- package/dist/binary.js +37 -0
- package/dist/bounds-1ouRnRJS.cjs +1 -0
- package/dist/bounds-BYz3mV9U.js +129 -0
- package/dist/bounds.cjs +1 -0
- package/dist/bounds.js +4 -0
- package/dist/box-CHDDKvN3.cjs +1 -0
- package/dist/box-Q7p9JFnX.js +204 -0
- package/dist/box.cjs +1 -0
- package/dist/box.js +4 -0
- package/dist/caseconv.cjs +1 -0
- package/dist/caseconv.js +4 -0
- package/dist/change-C-YELKx6.cjs +1 -0
- package/dist/change-DLl6DccR.js +12 -0
- package/dist/change.cjs +1 -0
- package/dist/change.js +4 -0
- package/dist/compare.cjs +1 -0
- package/dist/compare.js +4 -0
- package/dist/debounce.cjs +1 -0
- package/dist/debounce.js +17 -0
- package/dist/deep.cjs +1 -0
- package/dist/deep.js +119 -0
- package/dist/destructor.cjs +1 -0
- package/dist/destructor.js +1 -0
- package/dist/dimensions-9gLSFjFx.js +44 -0
- package/dist/dimensions-Fe8DhhXU.cjs +1 -0
- package/dist/dimensions.cjs +1 -0
- package/dist/dimensions.js +4 -0
- package/dist/direction-dXjlmg4_.cjs +1 -0
- package/dist/direction-wsPTe9a1.js +15 -0
- package/dist/direction.cjs +1 -0
- package/dist/direction.js +4 -0
- package/dist/external-B-DoBvh7.cjs +1 -0
- package/dist/external-DI9122wF.js +27 -0
- package/dist/identity.cjs +1 -0
- package/dist/identity.js +4 -0
- package/dist/index-Bcm6lEr8.js +73 -0
- package/dist/index-CnZb0cyW.cjs +1 -0
- package/dist/index-POWYBOZm.js +356 -0
- package/dist/index-xjptNL6Z.cjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +136 -0
- package/dist/kv.cjs +1 -0
- package/dist/kv.js +6 -0
- package/dist/location-C4YaXxjI.js +94 -0
- package/dist/location-CZOgJmu5.cjs +1 -0
- package/dist/location.cjs +1 -0
- package/dist/location.js +4 -0
- package/dist/observe.cjs +1 -0
- package/dist/observe.js +43 -0
- package/dist/path-BfHj5x9k.js +62 -0
- package/dist/path-By98WcWm.cjs +1 -0
- package/dist/position-BjhXUSEO.cjs +1 -0
- package/dist/position-PSYLZzqw.js +87 -0
- package/dist/position.cjs +1 -0
- package/dist/position.js +4 -0
- package/dist/record.cjs +1 -0
- package/dist/record.js +9 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.js +4 -0
- package/dist/scale-DCbi48di.js +205 -0
- package/dist/scale-DUBO0Q4s.cjs +1 -0
- package/dist/scale.cjs +1 -0
- package/dist/scale.js +4 -0
- package/dist/search.cjs +1 -0
- package/dist/search.js +15 -0
- package/dist/series-CSutMOtt.cjs +11 -0
- package/dist/series-DCv8f29w.js +1629 -0
- package/dist/spatial-6OGCmDve.js +11 -0
- package/dist/spatial-R5OeJgR6.cjs +1 -0
- package/dist/spatial.cjs +1 -0
- package/dist/spatial.js +20 -0
- package/dist/{binary → src/binary}/encoder.d.ts +7 -2
- package/dist/src/binary/encoder.d.ts.map +1 -0
- package/dist/src/binary/encoder.spec.d.ts.map +1 -0
- package/dist/src/binary/index.d.ts.map +1 -0
- package/dist/src/caseconv/caseconv.d.ts +4 -0
- package/dist/src/caseconv/caseconv.d.ts.map +1 -0
- package/dist/src/caseconv/index.d.ts +2 -0
- package/dist/src/caseconv/index.d.ts.map +1 -0
- package/dist/{change → src/change}/change.d.ts +10 -9
- package/dist/src/change/change.d.ts.map +1 -0
- package/dist/src/change/index.d.ts.map +1 -0
- package/dist/src/clamp/clamp.d.ts.map +1 -0
- package/dist/src/clamp/index.d.ts +2 -0
- package/dist/src/clamp/index.d.ts.map +1 -0
- package/dist/{compare → src/compare}/compare.d.ts +5 -4
- package/dist/src/compare/compare.d.ts.map +1 -0
- package/dist/src/compare/index.d.ts.map +1 -0
- package/dist/src/control/control.d.ts +107 -0
- package/dist/src/control/control.d.ts.map +1 -0
- package/dist/src/control/index.d.ts +2 -0
- package/dist/src/control/index.d.ts.map +1 -0
- package/dist/src/debounce/debounce.d.ts.map +1 -0
- package/dist/src/debounce/debounce.spec.d.ts +2 -0
- package/dist/src/debounce/debounce.spec.d.ts.map +1 -0
- package/dist/src/debounce/index.d.ts +2 -0
- package/dist/src/debounce/index.d.ts.map +1 -0
- package/dist/src/deep/copy.d.ts.map +1 -0
- package/dist/{deep → src/deep}/delete.d.ts +2 -1
- package/dist/src/deep/delete.d.ts.map +1 -0
- package/dist/{deep → src/deep}/delete.spec.d.ts.map +1 -1
- package/dist/src/deep/difference.d.ts.map +1 -0
- package/dist/src/deep/difference.spec.d.ts.map +1 -0
- package/dist/src/deep/equal.d.ts.map +1 -0
- package/dist/{deep → src/deep}/equal.spec.d.ts.map +1 -1
- package/dist/{deep → src/deep}/external.d.ts +3 -4
- package/dist/src/deep/external.d.ts.map +1 -0
- package/dist/src/deep/index.d.ts.map +1 -0
- package/dist/src/deep/merge.d.ts +12 -0
- package/dist/src/deep/merge.d.ts.map +1 -0
- package/dist/{deep → src/deep}/merge.spec.d.ts.map +1 -1
- package/dist/src/deep/partial.d.ts.map +1 -0
- package/dist/src/deep/path.d.ts +45 -0
- package/dist/src/deep/path.d.ts.map +1 -0
- package/dist/{deep → src/deep}/path.spec.d.ts.map +1 -1
- package/dist/src/destructor.d.ts.map +1 -0
- package/dist/{identity.d.ts → src/identity.d.ts} +2 -1
- package/dist/src/identity.d.ts.map +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +22 -20
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/invert.d.ts.map +1 -0
- package/dist/src/join.d.ts.map +1 -0
- package/dist/src/kv/index.d.ts.map +1 -0
- package/dist/src/kv/types.d.ts.map +1 -0
- package/dist/src/math/index.d.ts +2 -0
- package/dist/src/math/index.d.ts.map +1 -0
- package/dist/src/math/math.d.ts +11 -0
- package/dist/src/math/math.d.ts.map +1 -0
- package/dist/src/migrate/index.d.ts.map +1 -0
- package/dist/{migrate → src/migrate}/migrate.d.ts +2 -1
- package/dist/src/migrate/migrate.d.ts.map +1 -0
- package/dist/src/migrate/migrate.spec.d.ts.map +1 -0
- package/dist/{mock → src/mock}/MockGLBufferController.d.ts +2 -1
- package/dist/src/mock/MockGLBufferController.d.ts.map +1 -0
- package/dist/src/mock/index.d.ts.map +1 -0
- package/dist/src/observe/index.d.ts.map +1 -0
- package/dist/src/observe/observe.d.ts +24 -0
- package/dist/src/observe/observe.d.ts.map +1 -0
- package/dist/src/observe/obsever.spec.d.ts +2 -0
- package/dist/src/observe/obsever.spec.d.ts.map +1 -0
- package/dist/src/optional.d.ts.map +1 -0
- package/dist/{primitive.d.ts → src/primitive.d.ts} +2 -1
- package/dist/src/primitive.d.ts.map +1 -0
- package/dist/{record.d.ts → src/record.d.ts} +7 -8
- package/dist/src/record.d.ts.map +1 -0
- package/dist/{renderable.d.ts → src/renderable.d.ts} +2 -1
- package/dist/src/renderable.d.ts.map +1 -0
- package/dist/src/runtime/detect.d.ts.map +1 -0
- package/dist/src/runtime/external.d.ts.map +1 -0
- package/dist/src/runtime/index.d.ts.map +1 -0
- package/dist/src/runtime/os.d.ts +20 -0
- package/dist/src/runtime/os.d.ts.map +1 -0
- package/dist/{search.d.ts → src/search.d.ts} +5 -2
- package/dist/src/search.d.ts.map +1 -0
- package/dist/src/shallowCopy.d.ts +2 -0
- package/dist/src/shallowCopy.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/base.d.ts +30 -5
- package/dist/src/spatial/base.d.ts.map +1 -0
- package/dist/src/spatial/bounds/bounds.d.ts +148 -0
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -0
- package/dist/src/spatial/bounds/bounds.spec.d.ts.map +1 -0
- package/dist/src/spatial/bounds/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/box/box.d.ts +69 -22
- package/dist/src/spatial/box/box.d.ts.map +1 -0
- package/dist/src/spatial/box/box.spec.d.ts.map +1 -0
- package/dist/src/spatial/box/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/dimensions/dimensions.d.ts +4 -3
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -0
- package/dist/src/spatial/dimensions/dimensions.spec.d.ts.map +1 -0
- package/dist/src/spatial/dimensions/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/direction/direction.d.ts +3 -2
- package/dist/src/spatial/direction/direction.d.ts.map +1 -0
- package/dist/src/spatial/direction/direction.spec.d.ts.map +1 -0
- package/dist/src/spatial/direction/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/external.d.ts +2 -2
- package/dist/src/spatial/external.d.ts.map +1 -0
- package/dist/src/spatial/index.d.ts.map +1 -0
- package/dist/src/spatial/location/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/location/location.d.ts +4 -3
- package/dist/src/spatial/location/location.d.ts.map +1 -0
- package/dist/src/spatial/location/location.spec.d.ts.map +1 -0
- package/dist/src/spatial/position/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/position/position.d.ts +4 -4
- package/dist/src/spatial/position/position.d.ts.map +1 -0
- package/dist/src/spatial/position/position.spec.d.ts.map +1 -0
- package/dist/src/spatial/scale/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/scale/scale.d.ts +15 -62
- package/dist/src/spatial/scale/scale.d.ts.map +1 -0
- package/dist/src/spatial/scale/scale.spec.d.ts.map +1 -0
- package/dist/src/spatial/spatial.d.ts +2 -0
- package/dist/src/spatial/spatial.d.ts.map +1 -0
- package/dist/src/spatial/xy/index.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/xy/xy.d.ts +15 -24
- package/dist/src/spatial/xy/xy.d.ts.map +1 -0
- package/dist/{spatial → src/spatial}/xy/xy.spec.d.ts.map +1 -1
- package/dist/src/telem/generate.d.ts +4 -0
- package/dist/src/telem/generate.d.ts.map +1 -0
- package/dist/src/telem/gl.d.ts.map +1 -0
- package/dist/{telem → src/telem}/index.d.ts +1 -1
- package/dist/src/telem/index.d.ts.map +1 -0
- package/dist/{telem → src/telem}/series.d.ts +10 -8
- package/dist/src/telem/series.d.ts.map +1 -0
- package/dist/{telem → src/telem}/series.spec.d.ts.map +1 -1
- package/dist/{telem → src/telem}/telem.d.ts +19 -21
- package/dist/src/telem/telem.d.ts.map +1 -0
- package/dist/{telem → src/telem}/telem.spec.d.ts.map +1 -1
- package/dist/src/toArray.d.ts.map +1 -0
- package/dist/src/transform.d.ts +6 -0
- package/dist/src/transform.d.ts.map +1 -0
- package/dist/src/unique.d.ts.map +1 -0
- package/dist/src/url/index.d.ts +2 -0
- package/dist/src/url/index.d.ts.map +1 -0
- package/dist/src/url/url.d.ts.map +1 -0
- package/dist/{url → src/url}/url.spec.d.ts.map +1 -1
- package/dist/src/worker/index.d.ts +2 -0
- package/dist/src/worker/index.d.ts.map +1 -0
- package/dist/{worker → src/worker}/worker.d.ts +4 -4
- package/dist/src/worker/worker.d.ts.map +1 -0
- package/dist/src/worker/worker.spec.d.ts.map +1 -0
- package/dist/src/zodutil/index.d.ts +2 -0
- package/dist/src/zodutil/index.d.ts.map +1 -0
- package/dist/src/zodutil/zodutil.d.ts +6 -0
- package/dist/src/zodutil/zodutil.d.ts.map +1 -0
- package/dist/src/zodutil/zodutil.spec.d.ts +2 -0
- package/dist/src/zodutil/zodutil.spec.d.ts.map +1 -0
- package/dist/telem.cjs +1 -0
- package/dist/telem.js +17 -0
- package/dist/toArray.cjs +1 -0
- package/dist/toArray.js +5 -0
- package/dist/unique.cjs +1 -0
- package/dist/unique.js +4 -0
- package/dist/url.cjs +1 -0
- package/dist/url.js +54 -0
- package/dist/worker.cjs +1 -0
- package/dist/worker.js +47 -0
- package/dist/xy-B4SvvNaG.cjs +1 -0
- package/dist/xy-H8aUVW_X.js +90 -0
- package/dist/xy.cjs +1 -0
- package/dist/xy.js +4 -0
- package/dist/zodutil.cjs +1 -0
- package/dist/zodutil.js +22 -0
- package/eslint.config.js +12 -0
- package/package.json +158 -14
- package/src/binary/encoder.spec.ts +31 -6
- package/src/binary/encoder.ts +26 -15
- package/src/binary/index.ts +1 -1
- package/src/{case.ts → caseconv/caseconv.ts} +4 -9
- package/src/caseconv/index.ts +10 -0
- package/src/change/change.ts +7 -6
- package/src/change/index.ts +1 -1
- package/src/{clamp.ts → clamp/clamp.ts} +1 -1
- package/src/clamp/index.ts +10 -0
- package/src/compare/compare.ts +6 -9
- package/src/compare/index.ts +1 -1
- package/src/control/control.ts +77 -0
- package/src/control/index.ts +1 -0
- package/src/debounce/debounce.spec.ts +52 -0
- package/src/{debounce.ts → debounce/debounce.ts} +4 -4
- package/src/debounce/index.ts +10 -0
- package/src/deep/copy.ts +2 -3
- package/src/deep/delete.spec.ts +2 -2
- package/src/deep/delete.ts +3 -2
- package/src/deep/difference.spec.ts +28 -27
- package/src/deep/difference.ts +13 -11
- package/src/deep/equal.spec.ts +4 -4
- package/src/deep/equal.ts +16 -12
- package/src/deep/external.ts +4 -5
- package/src/deep/index.ts +1 -1
- package/src/deep/merge.spec.ts +120 -4
- package/src/deep/merge.ts +50 -9
- package/src/deep/partial.ts +1 -1
- package/src/deep/path.spec.ts +90 -39
- package/src/deep/path.ts +105 -46
- package/src/destructor.ts +2 -2
- package/src/identity.ts +1 -1
- package/src/index.ts +23 -21
- package/src/invert.ts +9 -0
- package/src/join.ts +1 -1
- package/src/kv/index.ts +1 -1
- package/src/kv/types.ts +1 -1
- package/src/math/index.ts +10 -0
- package/src/math/math.ts +33 -0
- package/src/migrate/index.ts +9 -0
- package/src/migrate/migrate.spec.ts +12 -2
- package/src/migrate/migrate.ts +9 -0
- package/src/mock/MockGLBufferController.ts +6 -6
- package/src/mock/index.ts +1 -1
- package/src/observe/index.ts +1 -1
- package/src/observe/observe.ts +37 -6
- package/src/observe/obsever.spec.ts +56 -0
- package/src/optional.ts +3 -4
- package/src/primitive.ts +1 -1
- package/src/record.ts +10 -6
- package/src/renderable.ts +1 -1
- package/src/runtime/detect.ts +3 -3
- package/src/runtime/external.ts +1 -1
- package/src/runtime/index.ts +1 -1
- package/src/runtime/os.ts +17 -5
- package/src/search.ts +3 -1
- package/src/shallowCopy.ts +5 -6
- package/src/spatial/base.ts +13 -5
- package/src/spatial/bounds/bounds.spec.ts +259 -180
- package/src/spatial/bounds/bounds.ts +200 -85
- package/src/spatial/bounds/index.ts +2 -2
- package/src/spatial/box/box.spec.ts +163 -2
- package/src/spatial/box/box.ts +82 -38
- package/src/spatial/box/index.ts +2 -2
- package/src/spatial/dimensions/dimensions.spec.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +4 -4
- package/src/spatial/dimensions/index.ts +2 -2
- package/src/spatial/direction/direction.spec.ts +1 -1
- package/src/spatial/direction/direction.ts +5 -5
- package/src/spatial/direction/index.ts +2 -2
- package/src/spatial/external.ts +3 -3
- package/src/spatial/index.ts +1 -1
- package/src/spatial/location/index.ts +2 -2
- package/src/spatial/location/location.spec.ts +1 -1
- package/src/spatial/location/location.ts +21 -21
- package/src/spatial/position/index.ts +1 -1
- package/src/spatial/position/position.spec.ts +1 -1
- package/src/spatial/position/position.ts +3 -20
- package/src/spatial/scale/index.ts +2 -2
- package/src/spatial/scale/scale.spec.ts +3 -3
- package/src/spatial/scale/scale.ts +3 -3
- package/src/spatial/spatial.ts +5 -5
- package/src/spatial/xy/index.ts +2 -2
- package/src/spatial/xy/xy.spec.ts +93 -44
- package/src/spatial/xy/xy.ts +17 -25
- package/src/telem/generate.ts +1 -1
- package/src/telem/gl.ts +1 -1
- package/src/telem/index.ts +2 -2
- package/src/telem/series.spec.ts +64 -5
- package/src/telem/series.ts +47 -35
- package/src/telem/telem.spec.ts +105 -2
- package/src/telem/telem.ts +63 -23
- package/src/toArray.ts +2 -2
- package/src/transform.ts +9 -2
- package/src/unique.ts +1 -1
- package/src/url/index.ts +2 -2
- package/src/url/url.spec.ts +2 -2
- package/src/url/url.ts +4 -4
- package/src/worker/index.ts +10 -0
- package/src/worker/worker.spec.ts +2 -2
- package/src/worker/worker.ts +13 -13
- package/src/zodutil/index.ts +10 -0
- package/src/zodutil/zodutil.spec.ts +103 -0
- package/src/zodutil/zodutil.ts +45 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +39 -3
- package/.eslintrc.cjs +0 -18
- package/dist/binary/encoder.d.ts.map +0 -1
- package/dist/binary/encoder.spec.d.ts.map +0 -1
- package/dist/binary/index.d.ts.map +0 -1
- package/dist/case.d.ts +0 -6
- package/dist/case.d.ts.map +0 -1
- package/dist/change/change.d.ts.map +0 -1
- package/dist/change/index.d.ts.map +0 -1
- package/dist/clamp.d.ts.map +0 -1
- package/dist/compare/compare.d.ts.map +0 -1
- package/dist/compare/index.d.ts.map +0 -1
- package/dist/debounce.d.ts.map +0 -1
- package/dist/deep/copy.d.ts.map +0 -1
- package/dist/deep/delete.d.ts.map +0 -1
- package/dist/deep/difference.d.ts.map +0 -1
- package/dist/deep/difference.spec.d.ts.map +0 -1
- package/dist/deep/equal.d.ts.map +0 -1
- package/dist/deep/external.d.ts.map +0 -1
- package/dist/deep/index.d.ts.map +0 -1
- package/dist/deep/memo.d.ts +0 -2
- package/dist/deep/memo.d.ts.map +0 -1
- package/dist/deep/merge.d.ts +0 -3
- package/dist/deep/merge.d.ts.map +0 -1
- package/dist/deep/partial.d.ts.map +0 -1
- package/dist/deep/path.d.ts +0 -37
- package/dist/deep/path.d.ts.map +0 -1
- package/dist/destructor.d.ts.map +0 -1
- package/dist/identity.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/invert.d.ts.map +0 -1
- package/dist/join.d.ts.map +0 -1
- package/dist/kv/index.d.ts.map +0 -1
- package/dist/kv/types.d.ts.map +0 -1
- package/dist/migrate/index.d.ts.map +0 -1
- package/dist/migrate/migrate.d.ts.map +0 -1
- package/dist/migrate/migrate.spec.d.ts.map +0 -1
- package/dist/mock/MockGLBufferController.d.ts.map +0 -1
- package/dist/mock/index.d.ts.map +0 -1
- package/dist/observe/index.d.ts.map +0 -1
- package/dist/observe/observe.d.ts +0 -12
- package/dist/observe/observe.d.ts.map +0 -1
- package/dist/optional.d.ts.map +0 -1
- package/dist/primitive.d.ts.map +0 -1
- package/dist/record.d.ts.map +0 -1
- package/dist/renderable.d.ts.map +0 -1
- package/dist/runtime/detect.d.ts.map +0 -1
- package/dist/runtime/external.d.ts.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/os.d.ts +0 -10
- package/dist/runtime/os.d.ts.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/shallowCopy.d.ts +0 -2
- package/dist/shallowCopy.d.ts.map +0 -1
- package/dist/spatial/base.d.ts.map +0 -1
- package/dist/spatial/bounds/bounds.d.ts +0 -71
- package/dist/spatial/bounds/bounds.d.ts.map +0 -1
- package/dist/spatial/bounds/bounds.spec.d.ts.map +0 -1
- package/dist/spatial/bounds/index.d.ts.map +0 -1
- package/dist/spatial/box/box.d.ts.map +0 -1
- package/dist/spatial/box/box.spec.d.ts.map +0 -1
- package/dist/spatial/box/index.d.ts.map +0 -1
- package/dist/spatial/dimensions/dimensions.d.ts.map +0 -1
- package/dist/spatial/dimensions/dimensions.spec.d.ts.map +0 -1
- package/dist/spatial/dimensions/index.d.ts.map +0 -1
- package/dist/spatial/direction/direction.d.ts.map +0 -1
- package/dist/spatial/direction/direction.spec.d.ts.map +0 -1
- package/dist/spatial/direction/index.d.ts.map +0 -1
- package/dist/spatial/external.d.ts.map +0 -1
- package/dist/spatial/index.d.ts.map +0 -1
- package/dist/spatial/location/index.d.ts.map +0 -1
- package/dist/spatial/location/location.d.ts.map +0 -1
- package/dist/spatial/location/location.spec.d.ts.map +0 -1
- package/dist/spatial/position/index.d.ts.map +0 -1
- package/dist/spatial/position/position.d.ts.map +0 -1
- package/dist/spatial/position/position.spec.d.ts.map +0 -1
- package/dist/spatial/scale/index.d.ts.map +0 -1
- package/dist/spatial/scale/scale.d.ts.map +0 -1
- package/dist/spatial/scale/scale.spec.d.ts.map +0 -1
- package/dist/spatial/spatial.d.ts +0 -2
- package/dist/spatial/spatial.d.ts.map +0 -1
- package/dist/spatial/xy/index.d.ts.map +0 -1
- package/dist/spatial/xy/xy.d.ts.map +0 -1
- package/dist/telem/generate.d.ts +0 -3
- package/dist/telem/generate.d.ts.map +0 -1
- package/dist/telem/gl.d.ts.map +0 -1
- package/dist/telem/index.d.ts.map +0 -1
- package/dist/telem/series.d.ts.map +0 -1
- package/dist/telem/telem.d.ts.map +0 -1
- package/dist/toArray.d.ts.map +0 -1
- package/dist/transform.d.ts +0 -2
- package/dist/transform.d.ts.map +0 -1
- package/dist/unique.d.ts.map +0 -1
- package/dist/url/index.d.ts +0 -2
- package/dist/url/index.d.ts.map +0 -1
- package/dist/url/url.d.ts.map +0 -1
- package/dist/worker/worker.d.ts.map +0 -1
- package/dist/worker/worker.spec.d.ts.map +0 -1
- package/dist/x.cjs +0 -12
- package/dist/x.cjs.map +0 -1
- package/dist/x.js +0 -5935
- package/dist/x.js.map +0 -1
- package/src/deep/memo.ts +0 -24
- /package/dist/{binary → src/binary}/encoder.spec.d.ts +0 -0
- /package/dist/{binary → src/binary}/index.d.ts +0 -0
- /package/dist/{change → src/change}/index.d.ts +0 -0
- /package/dist/{clamp.d.ts → src/clamp/clamp.d.ts} +0 -0
- /package/dist/{compare → src/compare}/index.d.ts +0 -0
- /package/dist/{debounce.d.ts → src/debounce/debounce.d.ts} +0 -0
- /package/dist/{deep → src/deep}/copy.d.ts +0 -0
- /package/dist/{deep → src/deep}/delete.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/difference.d.ts +0 -0
- /package/dist/{deep → src/deep}/difference.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/equal.d.ts +0 -0
- /package/dist/{deep → src/deep}/equal.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/index.d.ts +0 -0
- /package/dist/{deep → src/deep}/merge.spec.d.ts +0 -0
- /package/dist/{deep → src/deep}/partial.d.ts +0 -0
- /package/dist/{deep → src/deep}/path.spec.d.ts +0 -0
- /package/dist/{destructor.d.ts → src/destructor.d.ts} +0 -0
- /package/dist/{invert.d.ts → src/invert.d.ts} +0 -0
- /package/dist/{join.d.ts → src/join.d.ts} +0 -0
- /package/dist/{kv → src/kv}/index.d.ts +0 -0
- /package/dist/{kv → src/kv}/types.d.ts +0 -0
- /package/dist/{migrate → src/migrate}/index.d.ts +0 -0
- /package/dist/{migrate → src/migrate}/migrate.spec.d.ts +0 -0
- /package/dist/{mock → src/mock}/index.d.ts +0 -0
- /package/dist/{observe → src/observe}/index.d.ts +0 -0
- /package/dist/{optional.d.ts → src/optional.d.ts} +0 -0
- /package/dist/{runtime → src/runtime}/detect.d.ts +0 -0
- /package/dist/{runtime → src/runtime}/external.d.ts +0 -0
- /package/dist/{runtime → src/runtime}/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/bounds/bounds.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/bounds/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/box/box.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/box/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/dimensions/dimensions.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/dimensions/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/direction/direction.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/direction/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/location/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/location/location.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/position/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/position/position.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/scale/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/scale/scale.spec.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/xy/index.d.ts +0 -0
- /package/dist/{spatial → src/spatial}/xy/xy.spec.d.ts +0 -0
- /package/dist/{telem → src/telem}/gl.d.ts +0 -0
- /package/dist/{telem → src/telem}/series.spec.d.ts +0 -0
- /package/dist/{telem → src/telem}/telem.spec.d.ts +0 -0
- /package/dist/{toArray.d.ts → src/toArray.d.ts} +0 -0
- /package/dist/{unique.d.ts → src/unique.d.ts} +0 -0
- /package/dist/{url → src/url}/url.d.ts +0 -0
- /package/dist/{url → src/url}/url.spec.d.ts +0 -0
- /package/dist/{worker → src/worker}/worker.spec.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zodutil.spec.d.ts","sourceRoot":"","sources":["../../../src/zodutil/zodutil.spec.ts"],"names":[],"mappings":""}
|
package/dist/telem.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./series-CSutMOtt.cjs");exports.DataType=e.DataType;exports.Density=e.Density;exports.MultiSeries=e.MultiSeries;exports.Rate=e.Rate;exports.Series=e.Series;exports.Size=e.Size;exports.TimeRange=e.TimeRange;exports.TimeSpan=e.TimeSpan;exports.TimeStamp=e.TimeStamp;exports.addSamples=e.addSamples;exports.convertDataType=e.convertDataType;exports.isCrudeSeries=e.isCrudeSeries;exports.isTelemValue=e.isTelemValue;exports.typedArrayZ=e.typedArrayZ;
|
package/dist/telem.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { d as s, D as i, M as t, R as r, S, e as m, c as p, b as T, T as d, a as y, g as l, i as n, f as D, t as o } from "./series-DCv8f29w.js";
|
|
2
|
+
export {
|
|
3
|
+
s as DataType,
|
|
4
|
+
i as Density,
|
|
5
|
+
t as MultiSeries,
|
|
6
|
+
r as Rate,
|
|
7
|
+
S as Series,
|
|
8
|
+
m as Size,
|
|
9
|
+
p as TimeRange,
|
|
10
|
+
T as TimeSpan,
|
|
11
|
+
d as TimeStamp,
|
|
12
|
+
y as addSamples,
|
|
13
|
+
l as convertDataType,
|
|
14
|
+
n as isCrudeSeries,
|
|
15
|
+
D as isTelemValue,
|
|
16
|
+
o as typedArrayZ
|
|
17
|
+
};
|
package/dist/toArray.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=r=>Array.isArray(r)?r:[r],t=r=>Array.isArray(r)?r:r===null?[]:[r];exports.nullToArr=t;exports.toArray=o;
|
package/dist/toArray.js
ADDED
package/dist/unique.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=e=>[...new Set(e)];exports.unique=t;
|
package/dist/unique.js
ADDED
package/dist/url.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var u=(t,r,o)=>r in t?c(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o;var i=(t,r,o)=>(u(t,typeof r!="symbol"?r+"":r,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(...t)=>t.map(h).join(""),h=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),f=t=>t.endsWith("/")?t.slice(0,-1):t,p=(t,r="")=>t===null?"":"?"+Object.entries(t).filter(([,o])=>o==null?!1:Array.isArray(o)?o.length>0:!0).map(([o,n])=>`${r}${o}=${n}`).join("&"),s=class s{constructor({host:r,port:o,protocol:n="",pathPrefix:l=""}){i(this,"protocol");i(this,"host");i(this,"port");i(this,"path");this.protocol=n,this.host=r,this.port=o,this.path=h(l)}replace(r){return new s({host:r.host??this.host,port:r.port??this.port,protocol:r.protocol??this.protocol,pathPrefix:r.pathPrefix??this.path})}child(r){return new s({...this,pathPrefix:a(this.path,r)})}toString(){return f(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}};i(s,"UNKNOWN",new s({host:"unknown",port:0}));let e=s;exports.URL=e;exports.buildQueryString=p;
|
package/dist/url.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var a = (t, r, o) => r in t ? l(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
|
|
3
|
+
var i = (t, r, o) => (a(t, typeof r != "symbol" ? r + "" : r, o), o);
|
|
4
|
+
const p = (...t) => t.map(e).join(""), e = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), u = (t) => t.endsWith("/") ? t.slice(0, -1) : t, $ = (t, r = "") => t === null ? "" : "?" + Object.entries(t).filter(([, o]) => o == null ? !1 : Array.isArray(o) ? o.length > 0 : !0).map(([o, n]) => `${r}${o}=${n}`).join("&"), s = class s {
|
|
5
|
+
/**
|
|
6
|
+
* @param host - The hostname or IP address of the server.
|
|
7
|
+
* @param port - The port number of the server.
|
|
8
|
+
* @param protocol - The protocol to use for all requests. Defaults to "".
|
|
9
|
+
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
10
|
+
*/
|
|
11
|
+
constructor({ host: r, port: o, protocol: n = "", pathPrefix: c = "" }) {
|
|
12
|
+
i(this, "protocol");
|
|
13
|
+
i(this, "host");
|
|
14
|
+
i(this, "port");
|
|
15
|
+
i(this, "path");
|
|
16
|
+
this.protocol = n, this.host = r, this.port = o, this.path = e(c);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Replaces creates a new URL with the specified properties replaced.
|
|
20
|
+
* @param props - The properties to replace.
|
|
21
|
+
* @returns a new URL.
|
|
22
|
+
*/
|
|
23
|
+
replace(r) {
|
|
24
|
+
return new s({
|
|
25
|
+
host: r.host ?? this.host,
|
|
26
|
+
port: r.port ?? this.port,
|
|
27
|
+
protocol: r.protocol ?? this.protocol,
|
|
28
|
+
pathPrefix: r.pathPrefix ?? this.path
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new url with the given path appended to the current path.
|
|
33
|
+
* @param path - the path to append to the URL.
|
|
34
|
+
* @returns a new URL.
|
|
35
|
+
*/
|
|
36
|
+
child(r) {
|
|
37
|
+
return new s({
|
|
38
|
+
...this,
|
|
39
|
+
pathPrefix: p(this.path, r)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** @returns a string representation of the url */
|
|
43
|
+
toString() {
|
|
44
|
+
return u(
|
|
45
|
+
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
i(s, "UNKNOWN", new s({ host: "unknown", port: 0 }));
|
|
50
|
+
let h = s;
|
|
51
|
+
export {
|
|
52
|
+
h as URL,
|
|
53
|
+
$ as buildQueryString
|
|
54
|
+
};
|
package/dist/worker.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var h=(r,e,n)=>e in r?a(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var t=(r,e,n)=>(h(r,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{constructor(e){t(this,"sender");t(this,"handlers");this.sender=e,this.handlers=new Map}handle({data:e}){var s;const n=(s=this.handlers.get(e.type))==null?void 0:s.handler;n==null?console.warn(`No handler for ${e.type}`):n(e.payload)}route(e){const n=c(e,this.sender),s=new l(n);return this.handlers.set(e,s),s}}const c=(r,e)=>(n,s)=>e({type:r,payload:n},s);class l{constructor(e){t(this,"_send");t(this,"handler");this._send=e,this.handler=null}send(e,n=[]){this._send(e,n)}handle(e){this.handler=e}}const i=()=>{let r,e;const n=d=>{e.handle({data:d})},s=d=>{r.handle({data:d})};return r=new o(n),e=new o(s),[r,e]};exports.RoutedWorker=o;exports.TypedWorker=l;exports.createMockWorkers=i;
|
package/dist/worker.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var h = (s, e, n) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : s[e] = n;
|
|
3
|
+
var t = (s, e, n) => (h(s, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
class l {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
t(this, "sender");
|
|
7
|
+
t(this, "handlers");
|
|
8
|
+
this.sender = e, this.handlers = /* @__PURE__ */ new Map();
|
|
9
|
+
}
|
|
10
|
+
handle({ data: e }) {
|
|
11
|
+
var r;
|
|
12
|
+
const n = (r = this.handlers.get(e.type)) == null ? void 0 : r.handler;
|
|
13
|
+
n == null ? console.warn(`No handler for ${e.type}`) : n(e.payload);
|
|
14
|
+
}
|
|
15
|
+
route(e) {
|
|
16
|
+
const n = o(e, this.sender), r = new c(n);
|
|
17
|
+
return this.handlers.set(e, r), r;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const o = (s, e) => (n, r) => e({ type: s, payload: n }, r);
|
|
21
|
+
class c {
|
|
22
|
+
constructor(e) {
|
|
23
|
+
t(this, "_send");
|
|
24
|
+
t(this, "handler");
|
|
25
|
+
this._send = e, this.handler = null;
|
|
26
|
+
}
|
|
27
|
+
send(e, n = []) {
|
|
28
|
+
this._send(e, n);
|
|
29
|
+
}
|
|
30
|
+
handle(e) {
|
|
31
|
+
this.handler = e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const u = () => {
|
|
35
|
+
let s, e;
|
|
36
|
+
const n = (d) => {
|
|
37
|
+
e.handle({ data: d });
|
|
38
|
+
}, r = (d) => {
|
|
39
|
+
s.handle({ data: d });
|
|
40
|
+
};
|
|
41
|
+
return s = new l(n), e = new l(r), [s, e];
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
l as RoutedWorker,
|
|
45
|
+
c as TypedWorker,
|
|
46
|
+
u as createMockWorkers
|
|
47
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const x=require("zod"),c=require("./base-D3FrPu8C.cjs"),a=x.z.union([x.z.number(),c.xy,c.numberCouple,c.dimensions,c.signedDimensions,c.clientXY]),s=(t,n)=>{if(typeof t=="string"){if(n===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:n,y:0}:{x:0,y:n}}return typeof t=="number"?{x:t,y:n??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},o=Object.freeze({x:0,y:0}),f=Object.freeze({x:1,y:1}),g=Object.freeze({x:1/0,y:1/0}),p=Object.freeze({x:NaN,y:NaN}),y=(t,n,e=0)=>{const r=s(t),i=s(n);return e===0?r.x===i.x&&r.y===i.y:Math.abs(r.x-i.x)<=e&&Math.abs(r.y-i.y)<=e},O=t=>y(t,o),h=(t,n,e=n)=>{const r=s(t);return{x:r.x*n,y:r.y*e}},b=(t,n)=>{const e=s(t);return{x:e.x+n,y:e.y}},N=(t,n)=>{const e=s(t);return{x:e.x,y:e.y+n}},l=(t,n,e,...r)=>typeof n=="string"&&typeof e=="number"?n==="x"?b(t,e):N(t,e):[t,n,e??o,...r].reduce((i,m)=>{const u=s(m);return{x:i.x+u.x,y:i.y+u.y}},o),z=(t,n,e)=>{const r=s(t);return n==="x"?{x:e,y:r.y}:{x:r.x,y:e}},j=(t,n)=>{const e=s(t),r=s(n);return Math.sqrt((e.x-r.x)**2+(e.y-r.y)**2)},F=(t,n)=>{const e=s(t),r=s(n);return{x:r.x-e.x,y:r.y-e.y}},X=t=>{const n=s(t);return Number.isNaN(n.x)||Number.isNaN(n.y)},Y=t=>{const n=s(t);return Number.isFinite(n.x)&&Number.isFinite(n.y)},_=t=>{const n=s(t);return[n.x,n.y]},q=t=>{const n=s(t);return{left:n.x,top:n.y}},d=(t,n=0)=>{const e=s(t);return{x:Number(e.x.toFixed(n)),y:Number(e.y.toFixed(n))}},E=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:g,NAN:p,ONE:f,ZERO:o,clientXY:c.clientXY,construct:s,couple:_,crudeZ:a,css:q,distance:j,equals:y,isFinite:Y,isNan:X,isZero:O,scale:h,set:z,translate:l,translateX:b,translateY:N,translation:F,truncate:d,xy:c.xy},Symbol.toStringTag,{value:"Module"}));exports.ONE=f;exports.ZERO=o;exports.construct=s;exports.crudeZ=a;exports.equals=y;exports.translate=l;exports.truncate=d;exports.xy=E;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z as y } from "zod";
|
|
2
|
+
import { x as u, n as m, d, s as l, h as a } from "./base-Cz4DfmJf.js";
|
|
3
|
+
const p = y.union([
|
|
4
|
+
y.number(),
|
|
5
|
+
u,
|
|
6
|
+
m,
|
|
7
|
+
d,
|
|
8
|
+
l,
|
|
9
|
+
a
|
|
10
|
+
]), s = (t, n) => {
|
|
11
|
+
if (typeof t == "string") {
|
|
12
|
+
if (n === void 0)
|
|
13
|
+
throw new Error("The y coordinate must be given.");
|
|
14
|
+
return t === "x" ? { x: n, y: 0 } : { x: 0, y: n };
|
|
15
|
+
}
|
|
16
|
+
return typeof t == "number" ? { x: t, y: n ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
|
|
17
|
+
}, i = Object.freeze({ x: 0, y: 0 }), g = Object.freeze({ x: 1, y: 1 }), h = Object.freeze({ x: 1 / 0, y: 1 / 0 }), O = Object.freeze({ x: NaN, y: NaN }), x = (t, n, e = 0) => {
|
|
18
|
+
const r = s(t), o = s(n);
|
|
19
|
+
return e === 0 ? r.x === o.x && r.y === o.y : Math.abs(r.x - o.x) <= e && Math.abs(r.y - o.y) <= e;
|
|
20
|
+
}, j = (t) => x(t, i), z = (t, n, e = n) => {
|
|
21
|
+
const r = s(t);
|
|
22
|
+
return { x: r.x * n, y: r.y * e };
|
|
23
|
+
}, f = (t, n) => {
|
|
24
|
+
const e = s(t);
|
|
25
|
+
return { x: e.x + n, y: e.y };
|
|
26
|
+
}, b = (t, n) => {
|
|
27
|
+
const e = s(t);
|
|
28
|
+
return { x: e.x, y: e.y + n };
|
|
29
|
+
}, F = (t, n, e, ...r) => typeof n == "string" && typeof e == "number" ? n === "x" ? f(t, e) : b(t, e) : [t, n, e ?? i, ...r].reduce((o, N) => {
|
|
30
|
+
const c = s(N);
|
|
31
|
+
return { x: o.x + c.x, y: o.y + c.y };
|
|
32
|
+
}, i), _ = (t, n, e) => {
|
|
33
|
+
const r = s(t);
|
|
34
|
+
return n === "x" ? { x: e, y: r.y } : { x: r.x, y: e };
|
|
35
|
+
}, I = (t, n) => {
|
|
36
|
+
const e = s(t), r = s(n);
|
|
37
|
+
return Math.sqrt((e.x - r.x) ** 2 + (e.y - r.y) ** 2);
|
|
38
|
+
}, w = (t, n) => {
|
|
39
|
+
const e = s(t), r = s(n);
|
|
40
|
+
return { x: r.x - e.x, y: r.y - e.y };
|
|
41
|
+
}, M = (t) => {
|
|
42
|
+
const n = s(t);
|
|
43
|
+
return Number.isNaN(n.x) || Number.isNaN(n.y);
|
|
44
|
+
}, X = (t) => {
|
|
45
|
+
const n = s(t);
|
|
46
|
+
return Number.isFinite(n.x) && Number.isFinite(n.y);
|
|
47
|
+
}, Y = (t) => {
|
|
48
|
+
const n = s(t);
|
|
49
|
+
return [n.x, n.y];
|
|
50
|
+
}, Z = (t) => {
|
|
51
|
+
const n = s(t);
|
|
52
|
+
return { left: n.x, top: n.y };
|
|
53
|
+
}, A = (t, n = 0) => {
|
|
54
|
+
const e = s(t);
|
|
55
|
+
return { x: Number(e.x.toFixed(n)), y: Number(e.y.toFixed(n)) };
|
|
56
|
+
}, q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
57
|
+
__proto__: null,
|
|
58
|
+
INFINITY: h,
|
|
59
|
+
NAN: O,
|
|
60
|
+
ONE: g,
|
|
61
|
+
ZERO: i,
|
|
62
|
+
clientXY: a,
|
|
63
|
+
construct: s,
|
|
64
|
+
couple: Y,
|
|
65
|
+
crudeZ: p,
|
|
66
|
+
css: Z,
|
|
67
|
+
distance: I,
|
|
68
|
+
equals: x,
|
|
69
|
+
isFinite: X,
|
|
70
|
+
isNan: M,
|
|
71
|
+
isZero: j,
|
|
72
|
+
scale: z,
|
|
73
|
+
set: _,
|
|
74
|
+
translate: F,
|
|
75
|
+
translateX: f,
|
|
76
|
+
translateY: b,
|
|
77
|
+
translation: w,
|
|
78
|
+
truncate: A,
|
|
79
|
+
xy: u
|
|
80
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
81
|
+
export {
|
|
82
|
+
g as O,
|
|
83
|
+
i as Z,
|
|
84
|
+
A as a,
|
|
85
|
+
p as b,
|
|
86
|
+
s as c,
|
|
87
|
+
x as e,
|
|
88
|
+
F as t,
|
|
89
|
+
q as x
|
|
90
|
+
};
|
package/dist/xy.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./xy-B4SvvNaG.cjs");exports.xy=e.xy;
|
package/dist/xy.js
ADDED
package/dist/zodutil.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./path-By98WcWm.cjs"),c=e=>o.transformPath(e,(t,r,n)=>{const u=r===n.length-1,i=!isNaN(parseInt(t)),l=!isNaN(parseInt(n[r+1]));return i&&(t="element"),u||l?t:[t,"shape"]}),s=(e,t)=>{if(e==null)return null;const r=e[t];return r==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:r},a=(e,t,r)=>o.get(s(e,"shape"),c(t),r,{getter:s}),p=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:a,getFieldSchemaPath:c},Symbol.toStringTag,{value:"Module"}));exports.zodutil=p;
|
package/dist/zodutil.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as l, g as a } from "./path-BfHj5x9k.js";
|
|
2
|
+
const o = (e) => l(e, (t, r, n) => {
|
|
3
|
+
const c = r === n.length - 1, u = !isNaN(parseInt(t)), i = !isNaN(parseInt(n[r + 1]));
|
|
4
|
+
return u && (t = "element"), c || i ? t : [t, "shape"];
|
|
5
|
+
}), s = (e, t) => {
|
|
6
|
+
if (e == null)
|
|
7
|
+
return null;
|
|
8
|
+
const r = e[t];
|
|
9
|
+
return r == null && typeof e == "object" && "sourceType" in e ? e.sourceType()[t] : r;
|
|
10
|
+
}, p = (e, t, r) => a(
|
|
11
|
+
s(e, "shape"),
|
|
12
|
+
o(t),
|
|
13
|
+
r,
|
|
14
|
+
{ getter: s }
|
|
15
|
+
), m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16
|
+
__proto__: null,
|
|
17
|
+
getFieldSchema: p,
|
|
18
|
+
getFieldSchemaPath: o
|
|
19
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
20
|
+
export {
|
|
21
|
+
m as zodutil
|
|
22
|
+
};
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
10
|
+
import synnaxConfig from "eslint-config-synnaxlabs";
|
|
11
|
+
|
|
12
|
+
export default synnaxConfig
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synnaxlabs/x",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.16.0",
|
|
3
|
+
"version": "0.23.0",
|
|
5
4
|
"type": "module",
|
|
6
5
|
"description": "Common Utilities for Synnax Labs",
|
|
7
6
|
"repository": "https://github.com/synnaxlabs/synnax/tree/main/x/go",
|
|
@@ -14,25 +13,170 @@
|
|
|
14
13
|
"control systems"
|
|
15
14
|
],
|
|
16
15
|
"dependencies": {
|
|
17
|
-
"async-mutex": "^0.4.1",
|
|
18
16
|
"js-convert-case": "^4.2.0",
|
|
19
|
-
"nanoid": "^3.
|
|
20
|
-
"
|
|
21
|
-
"zod": "3.22.4"
|
|
17
|
+
"nanoid": "^3.0.0",
|
|
18
|
+
"zod": "3.23.8"
|
|
22
19
|
},
|
|
23
20
|
"devDependencies": {
|
|
24
21
|
"@types/node": "^20.12.7",
|
|
25
|
-
"@vitest/coverage-v8": "1.
|
|
26
|
-
"
|
|
27
|
-
"vite": "5.
|
|
28
|
-
"
|
|
29
|
-
"eslint-config-synnaxlabs": "0.0.1",
|
|
22
|
+
"@vitest/coverage-v8": "^1.5.0",
|
|
23
|
+
"vitest": "^1.5.0",
|
|
24
|
+
"vite": "5.2.11",
|
|
25
|
+
"typescript": "^5.4.5",
|
|
30
26
|
"@synnaxlabs/tsconfig": "0.0.2",
|
|
27
|
+
"eslint-config-synnaxlabs": "0.0.1",
|
|
31
28
|
"@synnaxlabs/vite-plugin": "0.0.1"
|
|
32
29
|
},
|
|
33
|
-
"main": "dist/
|
|
34
|
-
"module": "dist/
|
|
35
|
-
"types": "dist/index.d.ts",
|
|
30
|
+
"main": "./dist/index.cjs",
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
|
+
"types": "./dist/src/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"require": "./dist/index.cjs",
|
|
37
|
+
"types": "./dist/src/index.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./binary": {
|
|
40
|
+
"import": "./dist/binary.js",
|
|
41
|
+
"require": "./dist/binary.cjs",
|
|
42
|
+
"types": "./dist/src/binary/index.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./compare": {
|
|
45
|
+
"import": "./dist/compare.js",
|
|
46
|
+
"require": "./dist/compare.cjs",
|
|
47
|
+
"types": "./dist/src/compare/index.d.ts"
|
|
48
|
+
},
|
|
49
|
+
"./deep": {
|
|
50
|
+
"import": "./dist/deep.js",
|
|
51
|
+
"require": "./dist/deep.cjs",
|
|
52
|
+
"types": "./dist/src/deep/index.d.ts"
|
|
53
|
+
},
|
|
54
|
+
"./kv": {
|
|
55
|
+
"import": "./dist/kv.js",
|
|
56
|
+
"require": "./dist/kv.cjs",
|
|
57
|
+
"types": "./dist/src/kv/index.d.ts"
|
|
58
|
+
},
|
|
59
|
+
"./runtime": {
|
|
60
|
+
"import": "./dist/runtime.js",
|
|
61
|
+
"require": "./dist/runtime.cjs",
|
|
62
|
+
"types": "./dist/src/runtime/index.d.ts"
|
|
63
|
+
},
|
|
64
|
+
"./observe": {
|
|
65
|
+
"import": "./dist/observe.js",
|
|
66
|
+
"require": "./dist/observe.cjs",
|
|
67
|
+
"types": "./dist/src/observe/index.d.ts"
|
|
68
|
+
},
|
|
69
|
+
"./box": {
|
|
70
|
+
"import": "./dist/box.js",
|
|
71
|
+
"require": "./dist/box.cjs",
|
|
72
|
+
"types": "./dist/src/spatial/box/index.d.ts"
|
|
73
|
+
},
|
|
74
|
+
"./bounds": {
|
|
75
|
+
"import": "./dist/bounds.js",
|
|
76
|
+
"require": "./dist/bounds.cjs",
|
|
77
|
+
"types": "./dist/src/spatial/bounds/index.d.ts"
|
|
78
|
+
},
|
|
79
|
+
"./dimensions": {
|
|
80
|
+
"import": "./dist/dimensions.js",
|
|
81
|
+
"require": "./dist/dimensions.cjs",
|
|
82
|
+
"types": "./dist/src/spatial/dimensions/index.d.ts"
|
|
83
|
+
},
|
|
84
|
+
"./direction": {
|
|
85
|
+
"import": "./dist/direction.js",
|
|
86
|
+
"require": "./dist/direction.cjs",
|
|
87
|
+
"types": "./dist/src/spatial/direction/index.d.ts"
|
|
88
|
+
},
|
|
89
|
+
"./location": {
|
|
90
|
+
"import": "./dist/location.js",
|
|
91
|
+
"require": "./dist/location.cjs",
|
|
92
|
+
"types": "./dist/src/spatial/location/index.d.ts"
|
|
93
|
+
},
|
|
94
|
+
"./position": {
|
|
95
|
+
"import": "./dist/position.js",
|
|
96
|
+
"require": "./dist/position.cjs",
|
|
97
|
+
"types": "./dist/src/spatial/position/index.d.ts"
|
|
98
|
+
},
|
|
99
|
+
"./scale": {
|
|
100
|
+
"import": "./dist/scale.js",
|
|
101
|
+
"require": "./dist/scale.cjs",
|
|
102
|
+
"types": "./dist/src/spatial/scale/index.d.ts"
|
|
103
|
+
},
|
|
104
|
+
"./xy": {
|
|
105
|
+
"import": "./dist/xy.js",
|
|
106
|
+
"require": "./dist/xy.cjs",
|
|
107
|
+
"types": "./dist/src/spatial/xy/index.d.ts"
|
|
108
|
+
},
|
|
109
|
+
"./spatial": {
|
|
110
|
+
"import": "./dist/spatial.js",
|
|
111
|
+
"require": "./dist/spatial.cjs",
|
|
112
|
+
"types": "./dist/src/spatial/index.d.ts"
|
|
113
|
+
},
|
|
114
|
+
"./telem": {
|
|
115
|
+
"import": "./dist/telem.js",
|
|
116
|
+
"require": "./dist/telem.cjs",
|
|
117
|
+
"types": "./dist/src/telem/index.d.ts"
|
|
118
|
+
},
|
|
119
|
+
"./url": {
|
|
120
|
+
"import": "./dist/url.js",
|
|
121
|
+
"require": "./dist/url.cjs",
|
|
122
|
+
"types": "./dist/src/url/index.d.ts"
|
|
123
|
+
},
|
|
124
|
+
"./worker": {
|
|
125
|
+
"import": "./dist/worker.js",
|
|
126
|
+
"require": "./dist/worker.cjs",
|
|
127
|
+
"types": "./dist/src/worker/index.d.ts"
|
|
128
|
+
},
|
|
129
|
+
"./destructor": {
|
|
130
|
+
"import": "./dist/destructor.js",
|
|
131
|
+
"require": "./dist/destructor.cjs",
|
|
132
|
+
"types": "./dist/src/destructor.d.ts"
|
|
133
|
+
},
|
|
134
|
+
"./debounce": {
|
|
135
|
+
"import": "./dist/debounce.js",
|
|
136
|
+
"require": "./dist/debounce.cjs",
|
|
137
|
+
"types": "./dist/src/debounce/index.d.ts"
|
|
138
|
+
},
|
|
139
|
+
"./toArray": {
|
|
140
|
+
"import": "./dist/toArray.js",
|
|
141
|
+
"require": "./dist/toArray.cjs",
|
|
142
|
+
"types": "./dist/src/toArray.d.ts"
|
|
143
|
+
},
|
|
144
|
+
"./search": {
|
|
145
|
+
"import": "./dist/search.js",
|
|
146
|
+
"require": "./dist/search.cjs",
|
|
147
|
+
"types": "./dist/src/search.d.ts"
|
|
148
|
+
},
|
|
149
|
+
"./unique": {
|
|
150
|
+
"import": "./dist/unique.js",
|
|
151
|
+
"require": "./dist/unique.cjs",
|
|
152
|
+
"types": "./dist/src/unique.d.ts"
|
|
153
|
+
},
|
|
154
|
+
"./record": {
|
|
155
|
+
"import": "./dist/record.js",
|
|
156
|
+
"require": "./dist/record.cjs",
|
|
157
|
+
"types": "./dist/src/record.d.ts"
|
|
158
|
+
},
|
|
159
|
+
"./change": {
|
|
160
|
+
"import": "./dist/change.js",
|
|
161
|
+
"require": "./dist/change.cjs",
|
|
162
|
+
"types": "./dist/src/change/index.d.ts"
|
|
163
|
+
},
|
|
164
|
+
"./identity": {
|
|
165
|
+
"import": "./dist/identity.js",
|
|
166
|
+
"require": "./dist/identity.cjs",
|
|
167
|
+
"types": "./dist/src/identity.d.ts"
|
|
168
|
+
},
|
|
169
|
+
"./caseconv": {
|
|
170
|
+
"import": "./dist/caseconv.js",
|
|
171
|
+
"require": "./dist/caseconv.cjs",
|
|
172
|
+
"types": "./dist/src/caseconv/index.d.ts"
|
|
173
|
+
},
|
|
174
|
+
"./zodutil": {
|
|
175
|
+
"import": "./dist/zodutil.js",
|
|
176
|
+
"require": "./dist/zodutil.cjs",
|
|
177
|
+
"types": "./dist/src/zodutil/index.d.ts"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
36
180
|
"scripts": {
|
|
37
181
|
"build": "tsc --noEmit && vite build",
|
|
38
182
|
"test": "vitest",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
|
-
import { describe, expect,
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
13
|
import { binary } from "@/binary";
|
|
@@ -18,14 +18,39 @@ const SampleSchema = z.object({
|
|
|
18
18
|
value: z.unknown(),
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
binary.ENCODERS.forEach((e) => {
|
|
22
|
+
describe(`encoder ${e.contentType}`, () => {
|
|
23
|
+
it("should correctly encode and decode items", () => {
|
|
24
|
+
const sample = {
|
|
25
|
+
channelKey: "test",
|
|
26
|
+
timeStamp: 123,
|
|
27
|
+
value: new Array([1, 2, 3]),
|
|
28
|
+
};
|
|
29
|
+
const encoded = e.encode(sample);
|
|
30
|
+
expect(e.decode(encoded, SampleSchema)).toEqual(sample);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe("JSON", () => {
|
|
36
|
+
it("should correctly convert keys to snake case", () => {
|
|
23
37
|
const sample = {
|
|
24
38
|
channelKey: "test",
|
|
25
39
|
timeStamp: 123,
|
|
26
40
|
value: new Array([1, 2, 3]),
|
|
27
41
|
};
|
|
28
|
-
const encoded =
|
|
29
|
-
|
|
42
|
+
const encoded = binary.JSON_ECD.encodeString(sample);
|
|
43
|
+
const parse = JSON.parse(encoded);
|
|
44
|
+
expect(parse.channel_key).toEqual("test");
|
|
45
|
+
});
|
|
46
|
+
it("should correctly decode keys from snake case", () => {
|
|
47
|
+
const sample = {
|
|
48
|
+
channel_key: "test",
|
|
49
|
+
time_stamp: 123,
|
|
50
|
+
value: new Array([1, 2, 3]),
|
|
51
|
+
};
|
|
52
|
+
const encoded = JSON.stringify(sample);
|
|
53
|
+
const decoded = binary.JSON_ECD.decodeString(encoded, SampleSchema);
|
|
54
|
+
expect(decoded.channelKey).toEqual("test");
|
|
30
55
|
});
|
|
31
56
|
});
|
package/src/binary/encoder.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
|
-
import { type
|
|
10
|
+
import { type z,type ZodSchema } from "zod";
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { caseconv } from "@/caseconv";
|
|
13
13
|
import { isObject } from "@/identity";
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -40,14 +40,32 @@ export interface EncoderDecoder {
|
|
|
40
40
|
/** JSONEncoderDecoder is a JSON implementation of EncoderDecoder. */
|
|
41
41
|
export class JSONEncoderDecoder implements EncoderDecoder {
|
|
42
42
|
contentType = "application/json";
|
|
43
|
-
readonly decoder: TextDecoder;
|
|
43
|
+
private readonly decoder: TextDecoder;
|
|
44
|
+
private readonly encoder: TextEncoder;
|
|
44
45
|
|
|
45
46
|
constructor() {
|
|
46
47
|
this.decoder = new TextDecoder();
|
|
48
|
+
this.encoder = new TextEncoder();
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
encode(payload: unknown): ArrayBuffer {
|
|
50
|
-
|
|
52
|
+
return this.encoder.encode(this.encodeString(payload)).buffer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
decode<P extends z.ZodTypeAny>(
|
|
56
|
+
data: Uint8Array | ArrayBuffer,
|
|
57
|
+
schema?: P,
|
|
58
|
+
): z.output<P> {
|
|
59
|
+
return this.decodeString(this.decoder.decode(data), schema);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
decodeString<P extends z.ZodTypeAny>(data: string, schema?: P): z.output<P> {
|
|
63
|
+
const unpacked = caseconv.toCamel(JSON.parse(data));
|
|
64
|
+
return schema != null ? schema.parse(unpacked) : (unpacked as z.output<P>);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
encodeString(payload: unknown): string {
|
|
68
|
+
return JSON.stringify(caseconv.toSnake(payload), (_, v) => {
|
|
51
69
|
if (ArrayBuffer.isView(v)) return Array.from(v as Uint8Array);
|
|
52
70
|
if (isObject(v) && "encode_value" in v) {
|
|
53
71
|
if (typeof v.value === "bigint") return v.value.toString();
|
|
@@ -56,18 +74,11 @@ export class JSONEncoderDecoder implements EncoderDecoder {
|
|
|
56
74
|
if (typeof v === "bigint") return v.toString();
|
|
57
75
|
return v;
|
|
58
76
|
});
|
|
59
|
-
return new TextEncoder().encode(json);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
decode<P extends z.ZodTypeAny>(
|
|
63
|
-
data: Uint8Array | ArrayBuffer,
|
|
64
|
-
schema?: P,
|
|
65
|
-
): z.output<P> {
|
|
66
|
-
const unpacked = Case.toCamel(JSON.parse(this.decoder.decode(data)));
|
|
67
|
-
return schema != null ? schema.parse(unpacked) : (unpacked as P);
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
static registerCustomType(): void {}
|
|
71
80
|
}
|
|
72
81
|
|
|
73
|
-
export const
|
|
82
|
+
export const JSON_ECD = new JSONEncoderDecoder();
|
|
83
|
+
|
|
84
|
+
export const ENCODERS: EncoderDecoder[] = [JSON_ECD];
|
package/src/binary/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -15,13 +15,8 @@ const options = {
|
|
|
15
15
|
keepTypesOnRecursion: [Number, String, Uint8Array],
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
export const toSnake = <T>(entity: T): T => _snakeKeys(entity, options) as T;
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
export const toCamel = <T>(entity: T): T => _camelKeys(entity, options) as T;
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
export const toSnake = snakeKeys;
|
|
24
|
-
export const toCamel = camelKeys;
|
|
25
|
-
export const capitalize = (str: string): string =>
|
|
26
|
-
str[0].toUpperCase() + str.slice(1);
|
|
27
|
-
}
|
|
22
|
+
export const capitalize = (str: string): string => str[0].toUpperCase() + str.slice(1);
|