@dxos/util 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +273 -60
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +273 -60
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/array.d.ts +3 -2
- package/dist/types/src/array.d.ts.map +1 -1
- package/dist/types/src/deep.d.ts.map +1 -1
- package/dist/types/src/defer.d.ts +1 -1
- package/dist/types/src/defer.d.ts.map +1 -1
- package/dist/types/src/error-format.d.ts +5 -0
- package/dist/types/src/error-format.d.ts.map +1 -0
- package/dist/types/src/filename.d.ts +9 -0
- package/dist/types/src/filename.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/platform.d.ts +4 -1
- package/dist/types/src/platform.d.ts.map +1 -1
- package/dist/types/src/retry.d.ts +32 -0
- package/dist/types/src/retry.d.ts.map +1 -0
- package/dist/types/src/safe-parse.d.ts +6 -4
- package/dist/types/src/safe-parse.d.ts.map +1 -1
- package/dist/types/src/safe-stringify.d.ts +22 -0
- package/dist/types/src/safe-stringify.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +22 -4
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/unit.d.ts +12 -13
- package/dist/types/src/unit.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -7
- package/src/array.ts +9 -2
- package/src/binder.ts +2 -2
- package/src/deep.ts +2 -0
- package/src/defer.ts +1 -1
- package/src/error-format.ts +22 -0
- package/src/filename.ts +16 -0
- package/src/index.ts +4 -0
- package/src/platform.ts +11 -1
- package/src/retry.ts +74 -0
- package/src/safe-parse.ts +19 -16
- package/src/safe-stringify.ts +146 -0
- package/src/types.test.ts +11 -1
- package/src/types.ts +37 -9
- package/src/unit.test.ts +1 -1
- package/src/unit.ts +59 -28
- package/dist/types/src/explicit-resource-management-polyfill.d.ts +0 -1
- package/dist/types/src/explicit-resource-management-polyfill.d.ts.map +0 -1
- package/src/explicit-resource-management-polyfill.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/array-to-hex.ts":{"bytes":2461,"imports":[],"format":"esm"},"src/array.ts":{"bytes":11369,"imports":[],"format":"esm"},"src/assume.ts":{"bytes":1335,"imports":[],"format":"esm"},"src/binder.ts":{"bytes":1310,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true}],"format":"esm"},"src/bitfield.ts":{"bytes":8453,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/callback-collection.ts":{"bytes":3170,"imports":[],"format":"esm"},"src/callback.ts":{"bytes":5204,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/case.ts":{"bytes":4574,"imports":[],"format":"esm"},"src/chunk-array.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/circular-buffer.ts":{"bytes":6257,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/clear-undefined.ts":{"bytes":1554,"imports":[],"format":"esm"},"src/complex.ts":{"bytes":21712,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/deep.ts":{"bytes":3983,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"lodash.set","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/defer-function.ts":{"bytes":1558,"imports":[],"format":"esm"},"src/explicit-resource-management-polyfill.ts":{"bytes":1429,"imports":[],"format":"esm"},"src/defer.ts":{"bytes":3674,"imports":[{"path":"src/explicit-resource-management-polyfill.ts","kind":"import-statement","original":"./explicit-resource-management-polyfill"}],"format":"esm"},"src/entry.ts":{"bytes":3002,"imports":[],"format":"esm"},"src/for-each-async.ts":{"bytes":785,"imports":[],"format":"esm"},"src/human-hash.ts":{"bytes":19761,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/map.ts":{"bytes":1489,"imports":[],"format":"esm"},"src/instance-id.ts":{"bytes":4222,"imports":[{"path":"src/map.ts","kind":"import-statement","original":"./map"}],"format":"esm"},"src/interval.ts":{"bytes":1819,"imports":[],"format":"esm"},"src/join-tables.ts":{"bytes":3063,"imports":[],"format":"esm"},"src/uint8array.ts":{"bytes":3745,"imports":[],"format":"esm"},"src/json.ts":{"bytes":13272,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"src/human-hash.ts","kind":"import-statement","original":"./human-hash"},{"path":"src/uint8array.ts","kind":"import-statement","original":"./uint8array"}],"format":"esm"},"src/map-values.ts":{"bytes":12881,"imports":[],"format":"esm"},"src/no-infer.ts":{"bytes":474,"imports":[],"format":"esm"},"src/object.ts":{"bytes":1070,"imports":[],"format":"esm"},"src/order-keys.ts":{"bytes":1598,"imports":[],"format":"esm"},"src/order.ts":{"bytes":4971,"imports":[],"format":"esm"},"src/pick.ts":{"bytes":3648,"imports":[],"format":"esm"},"src/platform.ts":{"bytes":11239,"imports":[],"format":"esm"},"src/position.ts":{"bytes":2499,"imports":[],"format":"esm"},"src/random.ts":{"bytes":1303,"imports":[],"format":"esm"},"src/range.ts":{"bytes":2611,"imports":[],"format":"esm"},"src/reducers.ts":{"bytes":12812,"imports":[{"path":"src/map.ts","kind":"import-statement","original":"./map"}],"format":"esm"},"src/remove-undefined-keys.ts":{"bytes":4560,"imports":[],"format":"esm"},"src/safe-await.ts":{"bytes":2843,"imports":[],"format":"esm"},"src/safe-instanceof.ts":{"bytes":2680,"imports":[],"format":"esm"},"src/safe-parse.ts":{"bytes":2830,"imports":[],"format":"esm"},"src/sliding-window-summary.ts":{"bytes":7509,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/circular-buffer.ts","kind":"import-statement","original":"./circular-buffer"}],"format":"esm"},"src/sort.ts":{"bytes":3931,"imports":[],"format":"esm"},"src/string.ts":{"bytes":5646,"imports":[],"format":"esm"},"src/sum.ts":{"bytes":675,"imports":[],"format":"esm"},"src/throw-unhandled-error.ts":{"bytes":1163,"imports":[],"format":"esm"},"src/to-fallback.ts":{"bytes":14062,"imports":[],"format":"esm"},"src/tracer.ts":{"bytes":7225,"imports":[{"path":"src/map.ts","kind":"import-statement","original":"./map"}],"format":"esm"},"src/tree.ts":{"bytes":6250,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":8504,"imports":[],"format":"esm"},"src/unit.ts":{"bytes":5783,"imports":[],"format":"esm"},"src/url.ts":{"bytes":1627,"imports":[],"format":"esm"},"src/weak.ts":{"bytes":9591,"imports":[],"format":"esm"},"src/index.ts":{"bytes":4965,"imports":[{"path":"src/array-to-hex.ts","kind":"import-statement","original":"./array-to-hex"},{"path":"src/array.ts","kind":"import-statement","original":"./array"},{"path":"src/assume.ts","kind":"import-statement","original":"./assume"},{"path":"src/binder.ts","kind":"import-statement","original":"./binder"},{"path":"src/bitfield.ts","kind":"import-statement","original":"./bitfield"},{"path":"src/callback-collection.ts","kind":"import-statement","original":"./callback-collection"},{"path":"src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"src/case.ts","kind":"import-statement","original":"./case"},{"path":"src/chunk-array.ts","kind":"import-statement","original":"./chunk-array"},{"path":"src/circular-buffer.ts","kind":"import-statement","original":"./circular-buffer"},{"path":"src/clear-undefined.ts","kind":"import-statement","original":"./clear-undefined"},{"path":"src/complex.ts","kind":"import-statement","original":"./complex"},{"path":"src/deep.ts","kind":"import-statement","original":"./deep"},{"path":"src/defer-function.ts","kind":"import-statement","original":"./defer-function"},{"path":"src/defer.ts","kind":"import-statement","original":"./defer"},{"path":"src/entry.ts","kind":"import-statement","original":"./entry"},{"path":"src/for-each-async.ts","kind":"import-statement","original":"./for-each-async"},{"path":"src/human-hash.ts","kind":"import-statement","original":"./human-hash"},{"path":"src/instance-id.ts","kind":"import-statement","original":"./instance-id"},{"path":"src/interval.ts","kind":"import-statement","original":"./interval"},{"path":"src/join-tables.ts","kind":"import-statement","original":"./join-tables"},{"path":"src/json.ts","kind":"import-statement","original":"./json"},{"path":"src/map-values.ts","kind":"import-statement","original":"./map-values"},{"path":"src/map.ts","kind":"import-statement","original":"./map"},{"path":"src/no-infer.ts","kind":"import-statement","original":"./no-infer"},{"path":"src/object.ts","kind":"import-statement","original":"./object"},{"path":"src/order-keys.ts","kind":"import-statement","original":"./order-keys"},{"path":"src/order.ts","kind":"import-statement","original":"./order"},{"path":"src/pick.ts","kind":"import-statement","original":"./pick"},{"path":"src/platform.ts","kind":"import-statement","original":"./platform"},{"path":"src/position.ts","kind":"import-statement","original":"./position"},{"path":"src/random.ts","kind":"import-statement","original":"./random"},{"path":"src/range.ts","kind":"import-statement","original":"./range"},{"path":"src/reducers.ts","kind":"import-statement","original":"./reducers"},{"path":"src/remove-undefined-keys.ts","kind":"import-statement","original":"./remove-undefined-keys"},{"path":"src/safe-await.ts","kind":"import-statement","original":"./safe-await"},{"path":"src/safe-instanceof.ts","kind":"import-statement","original":"./safe-instanceof"},{"path":"src/safe-parse.ts","kind":"import-statement","original":"./safe-parse"},{"path":"src/sliding-window-summary.ts","kind":"import-statement","original":"./sliding-window-summary"},{"path":"src/sort.ts","kind":"import-statement","original":"./sort"},{"path":"src/string.ts","kind":"import-statement","original":"./string"},{"path":"src/sum.ts","kind":"import-statement","original":"./sum"},{"path":"src/throw-unhandled-error.ts","kind":"import-statement","original":"./throw-unhandled-error"},{"path":"src/to-fallback.ts","kind":"import-statement","original":"./to-fallback"},{"path":"src/tracer.ts","kind":"import-statement","original":"./tracer"},{"path":"src/tree.ts","kind":"import-statement","original":"./tree"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/uint8array.ts","kind":"import-statement","original":"./uint8array"},{"path":"src/unit.ts","kind":"import-statement","original":"./unit"},{"path":"src/url.ts","kind":"import-statement","original":"./url"},{"path":"src/weak.ts","kind":"import-statement","original":"./weak"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":133459},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"lodash.set","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["BitField","Callback","CallbackCollection","CircularBuffer","ComplexMap","ComplexSet","HumanHasher","MapEntry","SlidingWindowSummary","Tracer","Unit","WeakDictionary","accessBy","arrayMove","arrayToBuffer","arrayToHex","arrayToString","arraysEqual","assumeType","bufferToArray","byPosition","capitalize","chunkArray","clamp","clearUndefined","compareMulti","compareObject","compareScalar","compareString","createBinder","createBucketReducer","createGroupReducer","createSetDispatch","createUrl","decamelize","deepMapValues","deepMapValuesAsync","defaultMap","defer","deferAsync","deferFunction","diff","distinctBy","doAsync","entries","entry","exponentialBackoffInterval","forEachAsync","get","getAsyncProviderValue","getDate","getDebugName","getDeep","getHostPlatform","getPrototypeSpecificInstanceId","getProviderValue","hexToEmoji","hexToFallback","hexToHue","humanize","hyphenize","idEmoji","idHue","inferObjectOrder","inferRecordOrder","intersectBy","intersection","iosCheck","isNode","isNonNullable","isTruthy","joinTables","jsonKeyReplacer","jsonReplacer","jsonify","jsonlogify","kebabize","keyToEmoji","keyToFallback","keyToHue","keys","makeMap","makeSet","mapValues","median","mobileAndTabletCheck","numericalValues","omit","orderKeys","partition","pick","pickBy","randomInt","range","rangeFromTo","reduceGroupBy","reduceSeries","reduceSet","removeBy","removeProperties","removeUndefinedProperties","safariCheck","safeAwaitAll","safeInstanceof","safeParseFloat","safeParseInt","safeParseJson","set","setDeep","sortKeys","stringToArray","stringifyTree","stripUndefined","sum","throwUnhandledError","toEmoji","toFallback","toHue","tracer","trim","visitValues"],"entryPoint":"src/index.ts","inputs":{"src/array-to-hex.ts":{"bytesInOutput":341},"src/index.ts":{"bytesInOutput":0},"src/array.ts":{"bytesInOutput":1805},"src/assume.ts":{"bytesInOutput":31},"src/binder.ts":{"bytesInOutput":149},"src/bitfield.ts":{"bytesInOutput":1881},"src/callback-collection.ts":{"bytesInOutput":558},"src/callback.ts":{"bytesInOutput":1113},"src/case.ts":{"bytesInOutput":940},"src/chunk-array.ts":{"bytesInOutput":173},"src/circular-buffer.ts":{"bytesInOutput":1523},"src/clear-undefined.ts":{"bytesInOutput":223},"src/complex.ts":{"bytesInOutput":4440},"src/deep.ts":{"bytesInOutput":773},"src/defer-function.ts":{"bytesInOutput":72},"src/explicit-resource-management-polyfill.ts":{"bytesInOutput":100},"src/defer.ts":{"bytesInOutput":560},"src/entry.ts":{"bytesInOutput":487},"src/for-each-async.ts":{"bytesInOutput":62},"src/human-hash.ts":{"bytesInOutput":5674},"src/map.ts":{"bytesInOutput":193},"src/instance-id.ts":{"bytesInOutput":784},"src/interval.ts":{"bytesInOutput":290},"src/join-tables.ts":{"bytesInOutput":493},"src/json.ts":{"bytesInOutput":2958},"src/uint8array.ts":{"bytesInOutput":562},"src/map-values.ts":{"bytesInOutput":2490},"src/object.ts":{"bytesInOutput":82},"src/order-keys.ts":{"bytesInOutput":266},"src/order.ts":{"bytesInOutput":676},"src/pick.ts":{"bytesInOutput":482},"src/platform.ts":{"bytesInOutput":3211},"src/position.ts":{"bytesInOutput":271},"src/random.ts":{"bytesInOutput":148},"src/range.ts":{"bytesInOutput":371},"src/reducers.ts":{"bytesInOutput":2326},"src/remove-undefined-keys.ts":{"bytesInOutput":935},"src/safe-await.ts":{"bytesInOutput":345},"src/safe-instanceof.ts":{"bytesInOutput":371},"src/safe-parse.ts":{"bytesInOutput":476},"src/sliding-window-summary.ts":{"bytesInOutput":1807},"src/sort.ts":{"bytesInOutput":643},"src/string.ts":{"bytesInOutput":925},"src/sum.ts":{"bytesInOutput":57},"src/throw-unhandled-error.ts":{"bytesInOutput":90},"src/to-fallback.ts":{"bytesInOutput":4324},"src/tracer.ts":{"bytesInOutput":1390},"src/tree.ts":{"bytesInOutput":1193},"src/types.ts":{"bytesInOutput":907},"src/unit.ts":{"bytesInOutput":1308},"src/url.ts":{"bytesInOutput":246},"src/weak.ts":{"bytesInOutput":2054}},"bytes":56545}}}
|
|
1
|
+
{"inputs":{"src/array-to-hex.ts":{"bytes":2461,"imports":[],"format":"esm"},"src/array.ts":{"bytes":12000,"imports":[],"format":"esm"},"src/assume.ts":{"bytes":1335,"imports":[],"format":"esm"},"src/binder.ts":{"bytes":1302,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true}],"format":"esm"},"src/bitfield.ts":{"bytes":8453,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/callback-collection.ts":{"bytes":3170,"imports":[],"format":"esm"},"src/callback.ts":{"bytes":5204,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/case.ts":{"bytes":4574,"imports":[],"format":"esm"},"src/chunk-array.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/circular-buffer.ts":{"bytes":6257,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/clear-undefined.ts":{"bytes":1554,"imports":[],"format":"esm"},"src/complex.ts":{"bytes":21712,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/deep.ts":{"bytes":4375,"imports":[{"path":"lodash.get","kind":"import-statement","external":true},{"path":"lodash.set","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/defer-function.ts":{"bytes":1558,"imports":[],"format":"esm"},"src/defer.ts":{"bytes":3655,"imports":[{"path":"@hazae41/symbol-dispose-polyfill","kind":"import-statement","external":true}],"format":"esm"},"src/entry.ts":{"bytes":3002,"imports":[],"format":"esm"},"src/filename.ts":{"bytes":1347,"imports":[],"format":"esm"},"src/for-each-async.ts":{"bytes":785,"imports":[],"format":"esm"},"src/human-hash.ts":{"bytes":19761,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/map.ts":{"bytes":1489,"imports":[],"format":"esm"},"src/instance-id.ts":{"bytes":4222,"imports":[{"path":"src/map.ts","kind":"import-statement","original":"./map"}],"format":"esm"},"src/interval.ts":{"bytes":1819,"imports":[],"format":"esm"},"src/join-tables.ts":{"bytes":3063,"imports":[],"format":"esm"},"src/uint8array.ts":{"bytes":3745,"imports":[],"format":"esm"},"src/json.ts":{"bytes":13272,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"src/human-hash.ts","kind":"import-statement","original":"./human-hash"},{"path":"src/uint8array.ts","kind":"import-statement","original":"./uint8array"}],"format":"esm"},"src/map-values.ts":{"bytes":12881,"imports":[],"format":"esm"},"src/no-infer.ts":{"bytes":474,"imports":[],"format":"esm"},"src/object.ts":{"bytes":1070,"imports":[],"format":"esm"},"src/order-keys.ts":{"bytes":1598,"imports":[],"format":"esm"},"src/order.ts":{"bytes":4971,"imports":[],"format":"esm"},"src/pick.ts":{"bytes":3648,"imports":[],"format":"esm"},"src/platform.ts":{"bytes":17195,"imports":[],"format":"esm"},"src/position.ts":{"bytes":2499,"imports":[],"format":"esm"},"src/random.ts":{"bytes":1303,"imports":[],"format":"esm"},"src/range.ts":{"bytes":2611,"imports":[],"format":"esm"},"src/reducers.ts":{"bytes":12812,"imports":[{"path":"src/map.ts","kind":"import-statement","original":"./map"}],"format":"esm"},"src/remove-undefined-keys.ts":{"bytes":4560,"imports":[],"format":"esm"},"src/safe-await.ts":{"bytes":2843,"imports":[],"format":"esm"},"src/safe-instanceof.ts":{"bytes":2680,"imports":[],"format":"esm"},"src/safe-parse.ts":{"bytes":3395,"imports":[],"format":"esm"},"src/safe-stringify.ts":{"bytes":12563,"imports":[],"format":"esm"},"src/sliding-window-summary.ts":{"bytes":7509,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/circular-buffer.ts","kind":"import-statement","original":"./circular-buffer"}],"format":"esm"},"src/sort.ts":{"bytes":3931,"imports":[],"format":"esm"},"src/string.ts":{"bytes":5646,"imports":[],"format":"esm"},"src/sum.ts":{"bytes":675,"imports":[],"format":"esm"},"src/throw-unhandled-error.ts":{"bytes":1163,"imports":[],"format":"esm"},"src/to-fallback.ts":{"bytes":14062,"imports":[],"format":"esm"},"src/tracer.ts":{"bytes":7225,"imports":[{"path":"src/map.ts","kind":"import-statement","original":"./map"}],"format":"esm"},"src/tree.ts":{"bytes":6250,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":10382,"imports":[],"format":"esm"},"src/unit.ts":{"bytes":8810,"imports":[],"format":"esm"},"src/url.ts":{"bytes":1627,"imports":[],"format":"esm"},"src/weak.ts":{"bytes":9591,"imports":[],"format":"esm"},"src/error-format.ts":{"bytes":2111,"imports":[],"format":"esm"},"src/retry.ts":{"bytes":4961,"imports":[],"format":"esm"},"src/index.ts":{"bytes":5340,"imports":[{"path":"src/array-to-hex.ts","kind":"import-statement","original":"./array-to-hex"},{"path":"src/array.ts","kind":"import-statement","original":"./array"},{"path":"src/assume.ts","kind":"import-statement","original":"./assume"},{"path":"src/binder.ts","kind":"import-statement","original":"./binder"},{"path":"src/bitfield.ts","kind":"import-statement","original":"./bitfield"},{"path":"src/callback-collection.ts","kind":"import-statement","original":"./callback-collection"},{"path":"src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"src/case.ts","kind":"import-statement","original":"./case"},{"path":"src/chunk-array.ts","kind":"import-statement","original":"./chunk-array"},{"path":"src/circular-buffer.ts","kind":"import-statement","original":"./circular-buffer"},{"path":"src/clear-undefined.ts","kind":"import-statement","original":"./clear-undefined"},{"path":"src/complex.ts","kind":"import-statement","original":"./complex"},{"path":"src/deep.ts","kind":"import-statement","original":"./deep"},{"path":"src/defer-function.ts","kind":"import-statement","original":"./defer-function"},{"path":"src/defer.ts","kind":"import-statement","original":"./defer"},{"path":"src/entry.ts","kind":"import-statement","original":"./entry"},{"path":"src/filename.ts","kind":"import-statement","original":"./filename"},{"path":"src/for-each-async.ts","kind":"import-statement","original":"./for-each-async"},{"path":"src/human-hash.ts","kind":"import-statement","original":"./human-hash"},{"path":"src/instance-id.ts","kind":"import-statement","original":"./instance-id"},{"path":"src/interval.ts","kind":"import-statement","original":"./interval"},{"path":"src/join-tables.ts","kind":"import-statement","original":"./join-tables"},{"path":"src/json.ts","kind":"import-statement","original":"./json"},{"path":"src/map-values.ts","kind":"import-statement","original":"./map-values"},{"path":"src/map.ts","kind":"import-statement","original":"./map"},{"path":"src/no-infer.ts","kind":"import-statement","original":"./no-infer"},{"path":"src/object.ts","kind":"import-statement","original":"./object"},{"path":"src/order-keys.ts","kind":"import-statement","original":"./order-keys"},{"path":"src/order.ts","kind":"import-statement","original":"./order"},{"path":"src/pick.ts","kind":"import-statement","original":"./pick"},{"path":"src/platform.ts","kind":"import-statement","original":"./platform"},{"path":"src/position.ts","kind":"import-statement","original":"./position"},{"path":"src/random.ts","kind":"import-statement","original":"./random"},{"path":"src/range.ts","kind":"import-statement","original":"./range"},{"path":"src/reducers.ts","kind":"import-statement","original":"./reducers"},{"path":"src/remove-undefined-keys.ts","kind":"import-statement","original":"./remove-undefined-keys"},{"path":"src/safe-await.ts","kind":"import-statement","original":"./safe-await"},{"path":"src/safe-instanceof.ts","kind":"import-statement","original":"./safe-instanceof"},{"path":"src/safe-parse.ts","kind":"import-statement","original":"./safe-parse"},{"path":"src/safe-stringify.ts","kind":"import-statement","original":"./safe-stringify"},{"path":"src/sliding-window-summary.ts","kind":"import-statement","original":"./sliding-window-summary"},{"path":"src/sort.ts","kind":"import-statement","original":"./sort"},{"path":"src/string.ts","kind":"import-statement","original":"./string"},{"path":"src/sum.ts","kind":"import-statement","original":"./sum"},{"path":"src/throw-unhandled-error.ts","kind":"import-statement","original":"./throw-unhandled-error"},{"path":"src/to-fallback.ts","kind":"import-statement","original":"./to-fallback"},{"path":"src/tracer.ts","kind":"import-statement","original":"./tracer"},{"path":"src/tree.ts","kind":"import-statement","original":"./tree"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/uint8array.ts","kind":"import-statement","original":"./uint8array"},{"path":"src/unit.ts","kind":"import-statement","original":"./unit"},{"path":"src/url.ts","kind":"import-statement","original":"./url"},{"path":"src/weak.ts","kind":"import-statement","original":"./weak"},{"path":"src/error-format.ts","kind":"import-statement","original":"./error-format"},{"path":"src/retry.ts","kind":"import-statement","original":"./retry"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":149665},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"lodash.get","kind":"import-statement","external":true},{"path":"lodash.set","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@hazae41/symbol-dispose-polyfill","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["BitField","Callback","CallbackCollection","CircularBuffer","ComplexMap","ComplexSet","HumanHasher","MapEntry","SKIP","SlidingWindowSummary","Tracer","Unit","WeakDictionary","accessBy","arrayMove","arraySwap","arrayToBuffer","arrayToHex","arrayToString","arraysEqual","assumeType","bufferToArray","byPosition","capitalize","chunkArray","clamp","clearUndefined","coerceArray","compareMulti","compareObject","compareScalar","compareString","createBinder","createBucketReducer","createFilename","createGroupReducer","createReplacer","createSetDispatch","createUrl","decamelize","deepMapValues","deepMapValuesAsync","defaultFilter","defaultMap","defer","deferAsync","deferFunction","diff","distinctBy","doAsync","entries","entry","exponentialBackoffInterval","forEachAsync","formatErrorWithCauses","get","getAsyncProviderValue","getDate","getDebugName","getDeep","getHostPlatform","getPrototypeSpecificInstanceId","getProviderValue","hexToEmoji","hexToFallback","hexToHue","humanize","hyphenize","idEmoji","idHue","inferObjectOrder","inferRecordOrder","intersectBy","intersection","iosCheck","isBun","isMobile","isMobileOrTablet","isNode","isNonNullable","isTauri","isTruthy","joinTables","jsonKeyReplacer","jsonReplacer","jsonify","jsonlogify","kebabize","keyToEmoji","keyToFallback","keyToHue","keys","makeMap","makeSet","mapValues","median","numericalValues","omit","orderKeys","partition","pick","pickBy","randomInt","range","rangeFromTo","reduceGroupBy","reduceSeries","reduceSet","removeBy","removeProperties","removeUndefinedProperties","retry","safariCheck","safeAwaitAll","safeInstanceof","safeParseFloat","safeParseInt","safeParseJson","safeStringify","set","setDeep","sortKeys","stringToArray","stringifyTree","stripUndefined","sum","throwUnhandledError","toEmoji","toFallback","toHue","tracer","trim","visitValues"],"entryPoint":"src/index.ts","inputs":{"src/array-to-hex.ts":{"bytesInOutput":341},"src/index.ts":{"bytesInOutput":0},"src/array.ts":{"bytesInOutput":1931},"src/assume.ts":{"bytesInOutput":31},"src/binder.ts":{"bytesInOutput":153},"src/bitfield.ts":{"bytesInOutput":1881},"src/callback-collection.ts":{"bytesInOutput":558},"src/callback.ts":{"bytesInOutput":1113},"src/case.ts":{"bytesInOutput":940},"src/chunk-array.ts":{"bytesInOutput":173},"src/circular-buffer.ts":{"bytesInOutput":1523},"src/clear-undefined.ts":{"bytesInOutput":223},"src/complex.ts":{"bytesInOutput":4440},"src/deep.ts":{"bytesInOutput":773},"src/defer-function.ts":{"bytesInOutput":72},"src/defer.ts":{"bytesInOutput":603},"src/entry.ts":{"bytesInOutput":487},"src/filename.ts":{"bytesInOutput":176},"src/for-each-async.ts":{"bytesInOutput":62},"src/human-hash.ts":{"bytesInOutput":5674},"src/map.ts":{"bytesInOutput":193},"src/instance-id.ts":{"bytesInOutput":784},"src/interval.ts":{"bytesInOutput":290},"src/join-tables.ts":{"bytesInOutput":493},"src/json.ts":{"bytesInOutput":2958},"src/uint8array.ts":{"bytesInOutput":562},"src/map-values.ts":{"bytesInOutput":2490},"src/object.ts":{"bytesInOutput":82},"src/order-keys.ts":{"bytesInOutput":266},"src/order.ts":{"bytesInOutput":676},"src/pick.ts":{"bytesInOutput":482},"src/platform.ts":{"bytesInOutput":5433},"src/position.ts":{"bytesInOutput":271},"src/random.ts":{"bytesInOutput":148},"src/range.ts":{"bytesInOutput":371},"src/reducers.ts":{"bytesInOutput":2326},"src/remove-undefined-keys.ts":{"bytesInOutput":935},"src/safe-await.ts":{"bytesInOutput":345},"src/safe-instanceof.ts":{"bytesInOutput":371},"src/safe-parse.ts":{"bytesInOutput":532},"src/safe-stringify.ts":{"bytesInOutput":2493},"src/sliding-window-summary.ts":{"bytesInOutput":1807},"src/sort.ts":{"bytesInOutput":643},"src/string.ts":{"bytesInOutput":925},"src/sum.ts":{"bytesInOutput":57},"src/throw-unhandled-error.ts":{"bytesInOutput":90},"src/to-fallback.ts":{"bytesInOutput":4324},"src/tracer.ts":{"bytesInOutput":1390},"src/tree.ts":{"bytesInOutput":1193},"src/types.ts":{"bytesInOutput":1044},"src/unit.ts":{"bytesInOutput":2168},"src/url.ts":{"bytesInOutput":246},"src/weak.ts":{"bytesInOutput":2054},"src/error-format.ts":{"bytesInOutput":366},"src/retry.ts":{"bytesInOutput":903}},"bytes":64037}}}
|
|
@@ -97,16 +97,24 @@ var intersectBy = (arrays, selector) => {
|
|
|
97
97
|
return lookups.every((lookup) => lookup.has(key));
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
+
var coerceArray = (arr) => {
|
|
101
|
+
if (arr === void 0) {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
return Array.isArray(arr) ? arr : [
|
|
105
|
+
arr
|
|
106
|
+
];
|
|
107
|
+
};
|
|
100
108
|
|
|
101
109
|
// src/assume.ts
|
|
102
110
|
function assumeType(value) {
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
// src/binder.ts
|
|
106
|
-
import
|
|
114
|
+
import { promisify } from "node:util";
|
|
107
115
|
var createBinder = (obj) => ({
|
|
108
116
|
fn: (fn) => fn.bind(obj),
|
|
109
|
-
async: (fn) =>
|
|
117
|
+
async: (fn) => promisify(fn.bind(obj))
|
|
110
118
|
});
|
|
111
119
|
|
|
112
120
|
// src/bitfield.ts
|
|
@@ -596,11 +604,8 @@ var getDeep = (obj, path) => {
|
|
|
596
604
|
// src/defer-function.ts
|
|
597
605
|
var deferFunction = (fnProvider) => (...args) => fnProvider()(...args);
|
|
598
606
|
|
|
599
|
-
// src/explicit-resource-management-polyfill.ts
|
|
600
|
-
Symbol.dispose ??= Symbol("Symbol.dispose");
|
|
601
|
-
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
602
|
-
|
|
603
607
|
// src/defer.ts
|
|
608
|
+
import "@hazae41/symbol-dispose-polyfill";
|
|
604
609
|
var defer = (fn) => new DeferGuard(fn);
|
|
605
610
|
var DeferGuard = class {
|
|
606
611
|
_fn;
|
|
@@ -661,6 +666,12 @@ var MapEntry = class {
|
|
|
661
666
|
}
|
|
662
667
|
};
|
|
663
668
|
|
|
669
|
+
// src/filename.ts
|
|
670
|
+
var createFilename = ({ parts = [], ext, date = /* @__PURE__ */ new Date() }) => [
|
|
671
|
+
date.toISOString().replace(/[:.]/g, "-"),
|
|
672
|
+
...parts
|
|
673
|
+
].join("_") + (ext ? `.${ext}` : "");
|
|
674
|
+
|
|
664
675
|
// src/for-each-async.ts
|
|
665
676
|
var forEachAsync = (items, fn) => Promise.all(items.map(fn));
|
|
666
677
|
|
|
@@ -1356,7 +1367,18 @@ var omit = (obj, keys2) => {
|
|
|
1356
1367
|
|
|
1357
1368
|
// src/platform.ts
|
|
1358
1369
|
var isNode = () => typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
1359
|
-
var
|
|
1370
|
+
var isBun = () => globalThis.Bun !== void 0;
|
|
1371
|
+
var isTauri = () => !!globalThis.__TAURI__;
|
|
1372
|
+
var isMobile = () => {
|
|
1373
|
+
let check = false;
|
|
1374
|
+
(function(a) {
|
|
1375
|
+
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) {
|
|
1376
|
+
check = true;
|
|
1377
|
+
}
|
|
1378
|
+
})(navigator.userAgent || navigator.vendor || window.opera);
|
|
1379
|
+
return check;
|
|
1380
|
+
};
|
|
1381
|
+
var isMobileOrTablet = () => {
|
|
1360
1382
|
let check = false;
|
|
1361
1383
|
((a) => {
|
|
1362
1384
|
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) {
|
|
@@ -1585,31 +1607,115 @@ var safeInstanceof = (tag) => (target) => {
|
|
|
1585
1607
|
};
|
|
1586
1608
|
|
|
1587
1609
|
// src/safe-parse.ts
|
|
1588
|
-
|
|
1610
|
+
function safeParseInt(str, defaultValue) {
|
|
1589
1611
|
try {
|
|
1590
|
-
const
|
|
1591
|
-
return isNaN(
|
|
1612
|
+
const value = parseInt(str ?? "");
|
|
1613
|
+
return isNaN(value) ? defaultValue : value;
|
|
1592
1614
|
} catch {
|
|
1593
1615
|
return defaultValue;
|
|
1594
1616
|
}
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1617
|
+
}
|
|
1618
|
+
function safeParseFloat(str, defaultValue) {
|
|
1597
1619
|
try {
|
|
1598
|
-
|
|
1620
|
+
const value = parseFloat(str ?? "");
|
|
1621
|
+
return isNaN(value) ? defaultValue : value;
|
|
1599
1622
|
} catch {
|
|
1600
|
-
return defaultValue
|
|
1623
|
+
return defaultValue;
|
|
1601
1624
|
}
|
|
1602
|
-
}
|
|
1603
|
-
var safeParseJson = (
|
|
1604
|
-
if (
|
|
1625
|
+
}
|
|
1626
|
+
var safeParseJson = (str, defaultValue) => {
|
|
1627
|
+
if (str && str.length > 0) {
|
|
1605
1628
|
try {
|
|
1606
|
-
return JSON.parse(
|
|
1629
|
+
return JSON.parse(str);
|
|
1607
1630
|
} catch {
|
|
1608
1631
|
}
|
|
1609
1632
|
}
|
|
1610
1633
|
return defaultValue;
|
|
1611
1634
|
};
|
|
1612
1635
|
|
|
1636
|
+
// src/safe-stringify.ts
|
|
1637
|
+
var SKIP = Object.freeze({});
|
|
1638
|
+
function safeStringify(obj, filter = defaultFilter, indent = 2) {
|
|
1639
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
|
1640
|
+
function replacer(key, value) {
|
|
1641
|
+
try {
|
|
1642
|
+
let path = key;
|
|
1643
|
+
if (!key) {
|
|
1644
|
+
path = "$";
|
|
1645
|
+
return value;
|
|
1646
|
+
} else if (this) {
|
|
1647
|
+
const parentPath = seen.get(this);
|
|
1648
|
+
path = parentPath ? `${parentPath}.${key}` : key;
|
|
1649
|
+
}
|
|
1650
|
+
if (value == null) {
|
|
1651
|
+
return value;
|
|
1652
|
+
}
|
|
1653
|
+
if (typeof value === "function") {
|
|
1654
|
+
return void 0;
|
|
1655
|
+
}
|
|
1656
|
+
if (typeof value === "object" && Object.getPrototypeOf(value) !== Object.prototype) {
|
|
1657
|
+
return void 0;
|
|
1658
|
+
}
|
|
1659
|
+
if (typeof value === "object" && value !== null) {
|
|
1660
|
+
const exists = seen.get(value);
|
|
1661
|
+
if (exists) {
|
|
1662
|
+
return `[${path} => ${exists}]`;
|
|
1663
|
+
}
|
|
1664
|
+
seen.set(value, path);
|
|
1665
|
+
}
|
|
1666
|
+
if (filter) {
|
|
1667
|
+
const filteredValue = filter?.(key, value);
|
|
1668
|
+
if (filteredValue !== void 0) {
|
|
1669
|
+
return filteredValue === SKIP ? void 0 : filteredValue;
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
return value;
|
|
1673
|
+
} catch (error) {
|
|
1674
|
+
return `ERROR: ${error.message}`;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
return JSON.stringify(obj, replacer, indent);
|
|
1678
|
+
}
|
|
1679
|
+
var createReplacer = ({ omit: omit2, parse, maxDepth, maxArrayLen, maxStringLen } = {}) => {
|
|
1680
|
+
let currentDepth = 0;
|
|
1681
|
+
const depthMap = /* @__PURE__ */ new WeakMap();
|
|
1682
|
+
return function(key, value) {
|
|
1683
|
+
if (key === "") {
|
|
1684
|
+
currentDepth = 0;
|
|
1685
|
+
} else if (this && typeof this === "object") {
|
|
1686
|
+
const parentDepth = depthMap.get(this) ?? 0;
|
|
1687
|
+
currentDepth = parentDepth + 1;
|
|
1688
|
+
}
|
|
1689
|
+
if (typeof value === "function") {
|
|
1690
|
+
return SKIP;
|
|
1691
|
+
}
|
|
1692
|
+
if (value && typeof value === "object") {
|
|
1693
|
+
depthMap.set(value, currentDepth);
|
|
1694
|
+
if (maxDepth != null && currentDepth >= maxDepth) {
|
|
1695
|
+
return Array.isArray(value) ? `[{ length: ${value.length} }]` : `{ keys: ${Object.keys(value).length} }`;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
if (omit2?.includes(key)) {
|
|
1699
|
+
return SKIP;
|
|
1700
|
+
}
|
|
1701
|
+
if (parse?.includes(key) && typeof value === "string") {
|
|
1702
|
+
try {
|
|
1703
|
+
return JSON.parse(value);
|
|
1704
|
+
} catch {
|
|
1705
|
+
return value;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
if (maxArrayLen != null && Array.isArray(value) && value.length > maxArrayLen) {
|
|
1709
|
+
return `[length: ${value.length}]`;
|
|
1710
|
+
}
|
|
1711
|
+
if (maxStringLen != null && typeof value === "string" && value.length > maxStringLen) {
|
|
1712
|
+
return value.slice(0, maxStringLen) + "...";
|
|
1713
|
+
}
|
|
1714
|
+
return value;
|
|
1715
|
+
};
|
|
1716
|
+
};
|
|
1717
|
+
var defaultFilter = createReplacer();
|
|
1718
|
+
|
|
1613
1719
|
// src/sliding-window-summary.ts
|
|
1614
1720
|
import { invariant as invariant5 } from "@dxos/invariant";
|
|
1615
1721
|
var __dxlog_file5 = "/__w/dxos/dxos/packages/common/util/src/sliding-window-summary.ts";
|
|
@@ -2045,69 +2151,112 @@ var arrayMove = (array, from, to) => {
|
|
|
2045
2151
|
array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);
|
|
2046
2152
|
return array;
|
|
2047
2153
|
};
|
|
2154
|
+
function arraySwap(array, from, to) {
|
|
2155
|
+
const current = array[from];
|
|
2156
|
+
array[from] = array[to];
|
|
2157
|
+
array[to] = current;
|
|
2158
|
+
return array;
|
|
2159
|
+
}
|
|
2048
2160
|
|
|
2049
2161
|
// src/unit.ts
|
|
2050
|
-
var
|
|
2051
|
-
return (n, precision =
|
|
2162
|
+
var createFormat = (unit) => {
|
|
2163
|
+
return (n, precision = unit.precision ?? 0) => {
|
|
2052
2164
|
const value = n / unit.quotient;
|
|
2053
|
-
return
|
|
2165
|
+
return {
|
|
2166
|
+
unit,
|
|
2167
|
+
value,
|
|
2168
|
+
formattedValue: value.toFixed(precision),
|
|
2169
|
+
toString: () => `${value.toFixed(precision)}${unit.symbol}`
|
|
2170
|
+
};
|
|
2054
2171
|
};
|
|
2055
2172
|
};
|
|
2173
|
+
var MS_SECONDS = 1e3;
|
|
2174
|
+
var MS_MINUTES = 60 * MS_SECONDS;
|
|
2175
|
+
var MS_HOURS = 60 * MS_MINUTES;
|
|
2056
2176
|
var Unit = {
|
|
2057
|
-
//
|
|
2058
|
-
|
|
2177
|
+
// General.
|
|
2178
|
+
Percent: createFormat({
|
|
2179
|
+
symbol: "%",
|
|
2180
|
+
quotient: 1 / 100,
|
|
2181
|
+
precision: 2
|
|
2182
|
+
}),
|
|
2183
|
+
Thousand: createFormat({
|
|
2184
|
+
symbol: "k",
|
|
2185
|
+
quotient: 1e3,
|
|
2186
|
+
precision: 2
|
|
2187
|
+
}),
|
|
2188
|
+
// Bytes (note KB vs KiB).
|
|
2189
|
+
Gigabyte: createFormat({
|
|
2190
|
+
symbol: "GB",
|
|
2191
|
+
quotient: 1e3 * 1e3 * 1e3,
|
|
2192
|
+
precision: 2
|
|
2193
|
+
}),
|
|
2194
|
+
Megabyte: createFormat({
|
|
2195
|
+
symbol: "MB",
|
|
2196
|
+
quotient: 1e3 * 1e3,
|
|
2197
|
+
precision: 2
|
|
2198
|
+
}),
|
|
2199
|
+
Kilobyte: createFormat({
|
|
2200
|
+
symbol: "KB",
|
|
2201
|
+
quotient: 1e3,
|
|
2202
|
+
precision: 2
|
|
2203
|
+
}),
|
|
2204
|
+
Byte: createFormat({
|
|
2205
|
+
symbol: "B",
|
|
2206
|
+
quotient: 1
|
|
2207
|
+
}),
|
|
2208
|
+
// Time.
|
|
2209
|
+
Hour: createFormat({
|
|
2059
2210
|
symbol: "h",
|
|
2060
|
-
quotient:
|
|
2211
|
+
quotient: MS_HOURS
|
|
2061
2212
|
}),
|
|
2062
|
-
Minute:
|
|
2213
|
+
Minute: createFormat({
|
|
2063
2214
|
symbol: "m",
|
|
2064
|
-
quotient:
|
|
2215
|
+
quotient: MS_MINUTES
|
|
2065
2216
|
}),
|
|
2066
|
-
Second:
|
|
2217
|
+
Second: createFormat({
|
|
2067
2218
|
symbol: "s",
|
|
2068
|
-
quotient:
|
|
2219
|
+
quotient: MS_SECONDS,
|
|
2220
|
+
precision: 1
|
|
2069
2221
|
}),
|
|
2070
|
-
Millisecond:
|
|
2222
|
+
Millisecond: createFormat({
|
|
2071
2223
|
symbol: "ms",
|
|
2072
2224
|
quotient: 1
|
|
2073
2225
|
}),
|
|
2074
2226
|
Duration: (n) => {
|
|
2075
|
-
const hours = Math.floor(n /
|
|
2076
|
-
const minutes = Math.floor(n %
|
|
2227
|
+
const hours = Math.floor(n / MS_HOURS);
|
|
2228
|
+
const minutes = Math.floor(n % MS_HOURS / MS_MINUTES);
|
|
2077
2229
|
if (hours) {
|
|
2078
|
-
|
|
2230
|
+
const formattedValue = minutes ? `${hours}h ${minutes}m` : `${hours}h`;
|
|
2231
|
+
return {
|
|
2232
|
+
unit: {
|
|
2233
|
+
symbol: "h",
|
|
2234
|
+
quotient: MS_HOURS
|
|
2235
|
+
},
|
|
2236
|
+
value: hours,
|
|
2237
|
+
formattedValue,
|
|
2238
|
+
toString: () => formattedValue
|
|
2239
|
+
};
|
|
2079
2240
|
}
|
|
2080
|
-
const seconds = Math.floor(n % (60 * 1e3) / 1e3);
|
|
2081
2241
|
if (minutes) {
|
|
2082
|
-
|
|
2242
|
+
const seconds2 = (n - MS_MINUTES * minutes) / MS_SECONDS;
|
|
2243
|
+
const formattedValue = seconds2 ? `${minutes}m ${seconds2}s` : `${minutes}m`;
|
|
2244
|
+
return {
|
|
2245
|
+
unit: {
|
|
2246
|
+
symbol: "m",
|
|
2247
|
+
quotient: MS_MINUTES
|
|
2248
|
+
},
|
|
2249
|
+
value: minutes,
|
|
2250
|
+
formattedValue,
|
|
2251
|
+
toString: () => formattedValue
|
|
2252
|
+
};
|
|
2083
2253
|
}
|
|
2254
|
+
const seconds = n >= MS_SECONDS;
|
|
2084
2255
|
if (seconds) {
|
|
2085
|
-
return
|
|
2256
|
+
return Unit.Second(n);
|
|
2086
2257
|
}
|
|
2087
|
-
return
|
|
2088
|
-
}
|
|
2089
|
-
// bytes (note KB via KiB).
|
|
2090
|
-
Gigabyte: Formatter({
|
|
2091
|
-
symbol: "GB",
|
|
2092
|
-
quotient: 1e3 * 1e3 * 1e3
|
|
2093
|
-
}),
|
|
2094
|
-
Megabyte: Formatter({
|
|
2095
|
-
symbol: "MB",
|
|
2096
|
-
quotient: 1e3 * 1e3
|
|
2097
|
-
}),
|
|
2098
|
-
Kilobyte: Formatter({
|
|
2099
|
-
symbol: "KB",
|
|
2100
|
-
quotient: 1e3
|
|
2101
|
-
}),
|
|
2102
|
-
// general.
|
|
2103
|
-
Thousand: Formatter({
|
|
2104
|
-
symbol: "k",
|
|
2105
|
-
quotient: 1e3
|
|
2106
|
-
}),
|
|
2107
|
-
Percent: Formatter({
|
|
2108
|
-
symbol: "%",
|
|
2109
|
-
quotient: 1 / 100
|
|
2110
|
-
})
|
|
2258
|
+
return Unit.Millisecond(n);
|
|
2259
|
+
}
|
|
2111
2260
|
};
|
|
2112
2261
|
|
|
2113
2262
|
// src/url.ts
|
|
@@ -2213,6 +2362,58 @@ var WeakDictionary = class {
|
|
|
2213
2362
|
this._finalization.unregister(value);
|
|
2214
2363
|
}
|
|
2215
2364
|
};
|
|
2365
|
+
|
|
2366
|
+
// src/error-format.ts
|
|
2367
|
+
var formatErrorWithCauses = (error) => {
|
|
2368
|
+
const lines = [];
|
|
2369
|
+
let current = error;
|
|
2370
|
+
let level = 0;
|
|
2371
|
+
while (current) {
|
|
2372
|
+
const prefix = level === 0 ? "" : `Caused by: `;
|
|
2373
|
+
lines.push(prefix + (current.stack ?? String(current)));
|
|
2374
|
+
if (!(current.cause instanceof Error)) break;
|
|
2375
|
+
current = current.cause;
|
|
2376
|
+
level += 1;
|
|
2377
|
+
}
|
|
2378
|
+
return lines.join("\n\n");
|
|
2379
|
+
};
|
|
2380
|
+
|
|
2381
|
+
// src/retry.ts
|
|
2382
|
+
var DEFAULT_RETRY_OPTIONS = {
|
|
2383
|
+
count: 3,
|
|
2384
|
+
delayMs: 100,
|
|
2385
|
+
exponent: 2,
|
|
2386
|
+
retryOnError: async () => true,
|
|
2387
|
+
retryOnValue: async () => false
|
|
2388
|
+
};
|
|
2389
|
+
var retry = async (options, cb) => {
|
|
2390
|
+
const fullOptions = {
|
|
2391
|
+
...DEFAULT_RETRY_OPTIONS,
|
|
2392
|
+
...options
|
|
2393
|
+
};
|
|
2394
|
+
let numRetries = 0, currentDelay = fullOptions.delayMs;
|
|
2395
|
+
while (true) {
|
|
2396
|
+
let result;
|
|
2397
|
+
try {
|
|
2398
|
+
result = await cb();
|
|
2399
|
+
} catch (err) {
|
|
2400
|
+
if (numRetries > fullOptions.count || !await fullOptions.retryOnError(err)) {
|
|
2401
|
+
throw err;
|
|
2402
|
+
}
|
|
2403
|
+
await new Promise((resolve) => setTimeout(resolve, currentDelay));
|
|
2404
|
+
currentDelay *= fullOptions.exponent;
|
|
2405
|
+
numRetries++;
|
|
2406
|
+
continue;
|
|
2407
|
+
}
|
|
2408
|
+
if (!await fullOptions.retryOnValue(result)) {
|
|
2409
|
+
return result;
|
|
2410
|
+
}
|
|
2411
|
+
await new Promise((resolve) => setTimeout(resolve, currentDelay));
|
|
2412
|
+
currentDelay *= fullOptions.exponent;
|
|
2413
|
+
numRetries++;
|
|
2414
|
+
continue;
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2216
2417
|
export {
|
|
2217
2418
|
BitField,
|
|
2218
2419
|
Callback,
|
|
@@ -2222,12 +2423,14 @@ export {
|
|
|
2222
2423
|
ComplexSet,
|
|
2223
2424
|
HumanHasher,
|
|
2224
2425
|
MapEntry,
|
|
2426
|
+
SKIP,
|
|
2225
2427
|
SlidingWindowSummary,
|
|
2226
2428
|
Tracer,
|
|
2227
2429
|
Unit,
|
|
2228
2430
|
WeakDictionary,
|
|
2229
2431
|
accessBy,
|
|
2230
2432
|
arrayMove,
|
|
2433
|
+
arraySwap,
|
|
2231
2434
|
arrayToBuffer,
|
|
2232
2435
|
arrayToHex,
|
|
2233
2436
|
arrayToString,
|
|
@@ -2239,18 +2442,22 @@ export {
|
|
|
2239
2442
|
chunkArray,
|
|
2240
2443
|
clamp,
|
|
2241
2444
|
clearUndefined,
|
|
2445
|
+
coerceArray,
|
|
2242
2446
|
compareMulti,
|
|
2243
2447
|
compareObject,
|
|
2244
2448
|
compareScalar,
|
|
2245
2449
|
compareString,
|
|
2246
2450
|
createBinder,
|
|
2247
2451
|
createBucketReducer,
|
|
2452
|
+
createFilename,
|
|
2248
2453
|
createGroupReducer,
|
|
2454
|
+
createReplacer,
|
|
2249
2455
|
createSetDispatch,
|
|
2250
2456
|
createUrl,
|
|
2251
2457
|
decamelize,
|
|
2252
2458
|
deepMapValues,
|
|
2253
2459
|
deepMapValuesAsync,
|
|
2460
|
+
defaultFilter,
|
|
2254
2461
|
defaultMap,
|
|
2255
2462
|
defer,
|
|
2256
2463
|
deferAsync,
|
|
@@ -2262,6 +2469,7 @@ export {
|
|
|
2262
2469
|
entry,
|
|
2263
2470
|
exponentialBackoffInterval,
|
|
2264
2471
|
forEachAsync,
|
|
2472
|
+
formatErrorWithCauses,
|
|
2265
2473
|
get,
|
|
2266
2474
|
getAsyncProviderValue,
|
|
2267
2475
|
getDate,
|
|
@@ -2282,8 +2490,12 @@ export {
|
|
|
2282
2490
|
intersectBy,
|
|
2283
2491
|
intersection,
|
|
2284
2492
|
iosCheck,
|
|
2493
|
+
isBun,
|
|
2494
|
+
isMobile,
|
|
2495
|
+
isMobileOrTablet,
|
|
2285
2496
|
isNode,
|
|
2286
2497
|
isNonNullable,
|
|
2498
|
+
isTauri,
|
|
2287
2499
|
isTruthy,
|
|
2288
2500
|
joinTables,
|
|
2289
2501
|
jsonKeyReplacer,
|
|
@@ -2299,7 +2511,6 @@ export {
|
|
|
2299
2511
|
makeSet,
|
|
2300
2512
|
mapValues,
|
|
2301
2513
|
median,
|
|
2302
|
-
mobileAndTabletCheck,
|
|
2303
2514
|
numericalValues,
|
|
2304
2515
|
omit,
|
|
2305
2516
|
orderKeys,
|
|
@@ -2315,12 +2526,14 @@ export {
|
|
|
2315
2526
|
removeBy,
|
|
2316
2527
|
removeProperties,
|
|
2317
2528
|
removeUndefinedProperties,
|
|
2529
|
+
retry,
|
|
2318
2530
|
safariCheck,
|
|
2319
2531
|
safeAwaitAll,
|
|
2320
2532
|
safeInstanceof,
|
|
2321
2533
|
safeParseFloat,
|
|
2322
2534
|
safeParseInt,
|
|
2323
2535
|
safeParseJson,
|
|
2536
|
+
safeStringify,
|
|
2324
2537
|
set,
|
|
2325
2538
|
setDeep,
|
|
2326
2539
|
sortKeys,
|