@fireproof/vendor 0.0.0-smoke → 0.0.2-dev-test
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/merge-package.ts +207 -0
- package/p-limit/index.d.ts +81 -0
- package/p-limit/index.js +104 -0
- package/p-limit/index.test-d.ts +19 -0
- package/p-limit/license +9 -0
- package/p-limit/package.json +59 -0
- package/p-limit/readme.md +128 -0
- package/p-limit/test.js +241 -0
- package/package.json +12 -9
- package/to-esm-transform.ts +42 -0
- package/patched/@ipld/dag-json/.github/dependabot.yml +0 -11
- package/patched/@ipld/dag-json/.github/workflows/js-test-and-release.yml +0 -28
- package/patched/@ipld/dag-json/CHANGELOG.md +0 -202
- package/patched/@ipld/dag-json/LICENSE +0 -4
- package/patched/@ipld/dag-json/LICENSE-APACHE +0 -5
- package/patched/@ipld/dag-json/LICENSE-MIT +0 -19
- package/patched/@ipld/dag-json/README.md +0 -58
- package/patched/@ipld/dag-json/ipld-dag-json-10.2.3.tgz +0 -0
- package/patched/@ipld/dag-json/package.json +0 -173
- package/patched/@ipld/dag-json/src/index.js +0 -291
- package/patched/@ipld/dag-json/test/test-basics.spec.js +0 -290
- package/patched/@ipld/dag-json/test/ts-use/package.json +0 -11
- package/patched/@ipld/dag-json/test/ts-use/src/main.ts +0 -54
- package/patched/@ipld/dag-json/test/ts-use/tsconfig.json +0 -9
- package/patched/@ipld/dag-json/tsconfig.json +0 -14
- package/patched/cborg/.github/dependabot.yml +0 -16
- package/patched/cborg/.github/workflows/test-and-release.yml +0 -52
- package/patched/cborg/CHANGELOG.md +0 -513
- package/patched/cborg/LICENSE +0 -13
- package/patched/cborg/README.md +0 -515
- package/patched/cborg/bench/bench.js +0 -117
- package/patched/cborg/bench/json.js +0 -124
- package/patched/cborg/bench/package.json +0 -8
- package/patched/cborg/cborg-4.2.7.tgz +0 -0
- package/patched/cborg/cborg.js +0 -31
- package/patched/cborg/example-bytestrings.js +0 -180
- package/patched/cborg/example-json.js +0 -6
- package/patched/cborg/example.js +0 -5
- package/patched/cborg/interface.ts +0 -56
- package/patched/cborg/lib/0uint.js +0 -227
- package/patched/cborg/lib/1negint.js +0 -111
- package/patched/cborg/lib/2bytes.js +0 -133
- package/patched/cborg/lib/3string.js +0 -90
- package/patched/cborg/lib/4array.js +0 -113
- package/patched/cborg/lib/5map.js +0 -113
- package/patched/cborg/lib/6tag.js +0 -80
- package/patched/cborg/lib/7float.js +0 -308
- package/patched/cborg/lib/bin.js +0 -189
- package/patched/cborg/lib/bl.js +0 -124
- package/patched/cborg/lib/byte-utils.js +0 -417
- package/patched/cborg/lib/common.js +0 -27
- package/patched/cborg/lib/decode.js +0 -209
- package/patched/cborg/lib/diagnostic.js +0 -156
- package/patched/cborg/lib/diagnostic_test.js +0 -117
- package/patched/cborg/lib/encode.js +0 -464
- package/patched/cborg/lib/is.js +0 -106
- package/patched/cborg/lib/json/decode.js +0 -462
- package/patched/cborg/lib/json/encode.js +0 -299
- package/patched/cborg/lib/json/json.js +0 -4
- package/patched/cborg/lib/jump.js +0 -209
- package/patched/cborg/lib/length.js +0 -61
- package/patched/cborg/lib/token.js +0 -76
- package/patched/cborg/package.json +0 -169
- package/patched/cborg/pnpm-lock.yaml +0 -6096
- package/patched/cborg/taglib.js +0 -73
- package/patched/cborg/test/appendix_a.js +0 -647
- package/patched/cborg/test/common.js +0 -18
- package/patched/cborg/test/node-test-bin.js +0 -402
- package/patched/cborg/test/noop-bin-test.js +0 -3
- package/patched/cborg/test/test-0uint.js +0 -103
- package/patched/cborg/test/test-1negint.js +0 -96
- package/patched/cborg/test/test-2bytes.js +0 -198
- package/patched/cborg/test/test-3string.js +0 -136
- package/patched/cborg/test/test-4array.js +0 -93
- package/patched/cborg/test/test-5map.js +0 -284
- package/patched/cborg/test/test-6tag.js +0 -85
- package/patched/cborg/test/test-7float.js +0 -131
- package/patched/cborg/test/test-bl.js +0 -37
- package/patched/cborg/test/test-cbor-vectors.js +0 -107
- package/patched/cborg/test/test-decode-errors.js +0 -65
- package/patched/cborg/test/test-fuzz.js +0 -42
- package/patched/cborg/test/test-json.js +0 -219
- package/patched/cborg/test/test-length.js +0 -65
- package/patched/cborg/test/test-partial.js +0 -111
- package/patched/cborg/tsconfig.json +0 -45
- package/patched/cborg/types/cborg.d.ts +0 -28
- package/patched/cborg/types/cborg.d.ts.map +0 -1
- package/patched/cborg/types/example.d.ts +0 -2
- package/patched/cborg/types/example.d.ts.map +0 -1
- package/patched/cborg/types/interface.d.ts +0 -47
- package/patched/cborg/types/interface.d.ts.map +0 -1
- package/patched/cborg/types/lib/0uint.d.ts +0 -100
- package/patched/cborg/types/lib/0uint.d.ts.map +0 -1
- package/patched/cborg/types/lib/1negint.d.ts +0 -58
- package/patched/cborg/types/lib/1negint.d.ts.map +0 -1
- package/patched/cborg/types/lib/2bytes.d.ts +0 -68
- package/patched/cborg/types/lib/2bytes.d.ts.map +0 -1
- package/patched/cborg/types/lib/3string.d.ts +0 -46
- package/patched/cborg/types/lib/3string.d.ts.map +0 -1
- package/patched/cborg/types/lib/4array.d.ts +0 -65
- package/patched/cborg/types/lib/4array.d.ts.map +0 -1
- package/patched/cborg/types/lib/5map.d.ts +0 -65
- package/patched/cborg/types/lib/5map.d.ts.map +0 -1
- package/patched/cborg/types/lib/6tag.d.ts +0 -61
- package/patched/cborg/types/lib/6tag.d.ts.map +0 -1
- package/patched/cborg/types/lib/7float.d.ts +0 -60
- package/patched/cborg/types/lib/7float.d.ts.map +0 -1
- package/patched/cborg/types/lib/bin.d.ts +0 -4
- package/patched/cborg/types/lib/bin.d.ts.map +0 -1
- package/patched/cborg/types/lib/bl.d.ts +0 -26
- package/patched/cborg/types/lib/bl.d.ts.map +0 -1
- package/patched/cborg/types/lib/byte-utils.d.ts +0 -53
- package/patched/cborg/types/lib/byte-utils.d.ts.map +0 -1
- package/patched/cborg/types/lib/common.d.ts +0 -10
- package/patched/cborg/types/lib/common.d.ts.map +0 -1
- package/patched/cborg/types/lib/decode.d.ts +0 -41
- package/patched/cborg/types/lib/decode.d.ts.map +0 -1
- package/patched/cborg/types/lib/diagnostic.d.ts +0 -12
- package/patched/cborg/types/lib/diagnostic.d.ts.map +0 -1
- package/patched/cborg/types/lib/diagnostic_test.d.ts +0 -2
- package/patched/cborg/types/lib/diagnostic_test.d.ts.map +0 -1
- package/patched/cborg/types/lib/encode.d.ts +0 -50
- package/patched/cborg/types/lib/encode.d.ts.map +0 -1
- package/patched/cborg/types/lib/is.d.ts +0 -6
- package/patched/cborg/types/lib/is.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/decode.d.ts +0 -67
- package/patched/cborg/types/lib/json/decode.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/encode.d.ts +0 -11
- package/patched/cborg/types/lib/json/encode.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/forward-cborg.d.ts +0 -6
- package/patched/cborg/types/lib/json/forward-cborg.d.ts.map +0 -1
- package/patched/cborg/types/lib/json/json.d.ts +0 -6
- package/patched/cborg/types/lib/json/json.d.ts.map +0 -1
- package/patched/cborg/types/lib/jump.d.ts +0 -12
- package/patched/cborg/types/lib/jump.d.ts.map +0 -1
- package/patched/cborg/types/lib/length.d.ts +0 -27
- package/patched/cborg/types/lib/length.d.ts.map +0 -1
- package/patched/cborg/types/lib/token.d.ts +0 -59
- package/patched/cborg/types/lib/token.d.ts.map +0 -1
- package/patched/cborg/types/taglib.d.ts +0 -18
- package/patched/cborg/types/taglib.d.ts.map +0 -1
- package/patched/cborg/types/tsconfig.tsbuildinfo +0 -1
- package/src/@ipld/car/car/LICENSE +0 -4
- package/src/@ipld/car/car/README.md +0 -1078
- package/src/@ipld/car/car/dist/index.min.js +0 -5
- package/src/@ipld/car/car/dist/src/api.d.ts +0 -72
- package/src/@ipld/car/car/dist/src/api.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-decoder.d.ts +0 -67
- package/src/@ipld/car/car/dist/src/buffer-decoder.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-reader-browser.d.ts +0 -116
- package/src/@ipld/car/car/dist/src/buffer-reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-reader.d.ts +0 -31
- package/src/@ipld/car/car/dist/src/buffer-reader.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/buffer-writer.d.ts +0 -86
- package/src/@ipld/car/car/dist/src/buffer-writer.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/coding.d.ts +0 -49
- package/src/@ipld/car/car/dist/src/coding.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/decoder-common.d.ts +0 -43
- package/src/@ipld/car/car/dist/src/decoder-common.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/decoder.d.ts +0 -87
- package/src/@ipld/car/car/dist/src/decoder.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/encoder.d.ts +0 -17
- package/src/@ipld/car/car/dist/src/encoder.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/header-validator.d.ts +0 -5
- package/src/@ipld/car/car/dist/src/header-validator.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/index-browser.d.ts +0 -10
- package/src/@ipld/car/car/dist/src/index-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/index.d.ts +0 -11
- package/src/@ipld/car/car/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/indexed-reader-browser.d.ts +0 -5
- package/src/@ipld/car/car/dist/src/indexed-reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/indexed-reader.d.ts +0 -152
- package/src/@ipld/car/car/dist/src/indexed-reader.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/indexer.d.ts +0 -95
- package/src/@ipld/car/car/dist/src/indexer.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/iterator-channel.d.ts +0 -7
- package/src/@ipld/car/car/dist/src/iterator-channel.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/iterator.d.ts +0 -174
- package/src/@ipld/car/car/dist/src/iterator.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/reader-browser.d.ts +0 -151
- package/src/@ipld/car/car/dist/src/reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/reader.d.ts +0 -35
- package/src/@ipld/car/car/dist/src/reader.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/writer-browser.d.ts +0 -155
- package/src/@ipld/car/car/dist/src/writer-browser.d.ts.map +0 -1
- package/src/@ipld/car/car/dist/src/writer.d.ts +0 -45
- package/src/@ipld/car/car/dist/src/writer.d.ts.map +0 -1
- package/src/@ipld/car/car/node_modules/.bin/cborg +0 -17
- package/src/@ipld/car/car/package.json +0 -235
- package/src/@ipld/car/car/src/api.ts +0 -90
- package/src/@ipld/car/car/src/buffer-decoder.js +0 -213
- package/src/@ipld/car/car/src/buffer-reader-browser.js +0 -144
- package/src/@ipld/car/car/src/buffer-reader.js +0 -51
- package/src/@ipld/car/car/src/buffer-writer.js +0 -286
- package/src/@ipld/car/car/src/coding.ts +0 -68
- package/src/@ipld/car/car/src/decoder-common.js +0 -82
- package/src/@ipld/car/car/src/decoder.js +0 -347
- package/src/@ipld/car/car/src/encoder.js +0 -76
- package/src/@ipld/car/car/src/header-validator.js +0 -214
- package/src/@ipld/car/car/src/header.ipldsch +0 -18
- package/src/@ipld/car/car/src/index-browser.js +0 -18
- package/src/@ipld/car/car/src/index.js +0 -21
- package/src/@ipld/car/car/src/indexed-reader-browser.js +0 -7
- package/src/@ipld/car/car/src/indexed-reader.js +0 -211
- package/src/@ipld/car/car/src/indexer.js +0 -130
- package/src/@ipld/car/car/src/iterator-channel.js +0 -91
- package/src/@ipld/car/car/src/iterator.js +0 -267
- package/src/@ipld/car/car/src/reader-browser.js +0 -194
- package/src/@ipld/car/car/src/reader.js +0 -56
- package/src/@ipld/car/car/src/writer-browser.js +0 -250
- package/src/@ipld/car/car/src/writer.js +0 -84
- package/src/@ipld/dag-cbor/dag-cbor/LICENSE +0 -4
- package/src/@ipld/dag-cbor/dag-cbor/README.md +0 -80
- package/src/@ipld/dag-cbor/dag-cbor/dist/index.min.js +0 -3
- package/src/@ipld/dag-cbor/dag-cbor/dist/src/index.d.ts +0 -67
- package/src/@ipld/dag-cbor/dag-cbor/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/dag-cbor/dag-cbor/node_modules/.bin/cborg +0 -17
- package/src/@ipld/dag-cbor/dag-cbor/package.json +0 -171
- package/src/@ipld/dag-cbor/dag-cbor/src/index.js +0 -147
- package/src/@ipld/dag-json/dag-json/LICENSE +0 -4
- package/src/@ipld/dag-json/dag-json/README.md +0 -58
- package/src/@ipld/dag-json/dag-json/dist/index.min.js +0 -3
- package/src/@ipld/dag-json/dag-json/dist/src/index.d.ts +0 -12
- package/src/@ipld/dag-json/dag-json/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/dag-json/dag-json/node_modules/.bin/cborg +0 -17
- package/src/@ipld/dag-json/dag-json/package.json +0 -173
- package/src/@ipld/dag-json/dag-json/src/index.js +0 -291
- package/src/@web3-storage/pail/pail/LICENSE.md +0 -232
- package/src/@web3-storage/pail/pail/README.md +0 -84
- package/src/@web3-storage/pail/pail/cli.js +0 -218
- package/src/@web3-storage/pail/pail/dist/src/api.d.ts +0 -59
- package/src/@web3-storage/pail/pail/dist/src/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/batch/api.d.ts +0 -31
- package/src/@web3-storage/pail/pail/dist/src/batch/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/batch/index.d.ts +0 -75
- package/src/@web3-storage/pail/pail/dist/src/batch/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/batch/shard.d.ts +0 -3
- package/src/@web3-storage/pail/pail/dist/src/batch/shard.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/block.d.ts +0 -35
- package/src/@web3-storage/pail/pail/dist/src/block.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/clock/api.d.ts +0 -10
- package/src/@web3-storage/pail/pail/dist/src/clock/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/clock/index.d.ts +0 -48
- package/src/@web3-storage/pail/pail/dist/src/clock/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/api.d.ts +0 -26
- package/src/@web3-storage/pail/pail/dist/src/crdt/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/api.d.ts +0 -11
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/api.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/index.d.ts +0 -5
- package/src/@web3-storage/pail/pail/dist/src/crdt/batch/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/crdt/index.d.ts +0 -9
- package/src/@web3-storage/pail/pail/dist/src/crdt/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/diff.d.ts +0 -13
- package/src/@web3-storage/pail/pail/dist/src/diff.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/index.d.ts +0 -10
- package/src/@web3-storage/pail/pail/dist/src/index.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/merge.d.ts +0 -5
- package/src/@web3-storage/pail/pail/dist/src/merge.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/src/shard.d.ts +0 -43
- package/src/@web3-storage/pail/pail/dist/src/shard.d.ts.map +0 -1
- package/src/@web3-storage/pail/pail/dist/tsconfig.tsbuildinfo +0 -1
- package/src/@web3-storage/pail/pail/node_modules/.bin/pail +0 -17
- package/src/@web3-storage/pail/pail/package.json +0 -173
- package/src/@web3-storage/pail/pail/src/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/api.ts +0 -90
- package/src/@web3-storage/pail/pail/src/batch/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/batch/api.ts +0 -59
- package/src/@web3-storage/pail/pail/src/batch/index.js +0 -258
- package/src/@web3-storage/pail/pail/src/batch/shard.js +0 -13
- package/src/@web3-storage/pail/pail/src/block.js +0 -75
- package/src/@web3-storage/pail/pail/src/clock/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/clock/api.ts +0 -12
- package/src/@web3-storage/pail/pail/src/clock/index.js +0 -182
- package/src/@web3-storage/pail/pail/src/crdt/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/crdt/api.ts +0 -33
- package/src/@web3-storage/pail/pail/src/crdt/batch/api.js +0 -1
- package/src/@web3-storage/pail/pail/src/crdt/batch/api.ts +0 -30
- package/src/@web3-storage/pail/pail/src/crdt/batch/index.js +0 -155
- package/src/@web3-storage/pail/pail/src/crdt/index.js +0 -354
- package/src/@web3-storage/pail/pail/src/diff.js +0 -151
- package/src/@web3-storage/pail/pail/src/index.js +0 -406
- package/src/@web3-storage/pail/pail/src/merge.js +0 -43
- package/src/@web3-storage/pail/pail/src/shard.js +0 -180
- package/src/cborg/cborg/.github/dependabot.yml +0 -16
- package/src/cborg/cborg/.github/workflows/test-and-release.yml +0 -52
- package/src/cborg/cborg/CHANGELOG.md +0 -513
- package/src/cborg/cborg/LICENSE +0 -13
- package/src/cborg/cborg/README.md +0 -515
- package/src/cborg/cborg/bench/bench.js +0 -117
- package/src/cborg/cborg/bench/json.js +0 -124
- package/src/cborg/cborg/bench/package.json +0 -8
- package/src/cborg/cborg/cborg.js +0 -31
- package/src/cborg/cborg/example-bytestrings.js +0 -180
- package/src/cborg/cborg/example-json.js +0 -6
- package/src/cborg/cborg/example.js +0 -5
- package/src/cborg/cborg/interface.ts +0 -56
- package/src/cborg/cborg/lib/0uint.js +0 -227
- package/src/cborg/cborg/lib/1negint.js +0 -111
- package/src/cborg/cborg/lib/2bytes.js +0 -133
- package/src/cborg/cborg/lib/3string.js +0 -90
- package/src/cborg/cborg/lib/4array.js +0 -113
- package/src/cborg/cborg/lib/5map.js +0 -113
- package/src/cborg/cborg/lib/6tag.js +0 -80
- package/src/cborg/cborg/lib/7float.js +0 -308
- package/src/cborg/cborg/lib/bin.js +0 -189
- package/src/cborg/cborg/lib/bl.js +0 -124
- package/src/cborg/cborg/lib/byte-utils.js +0 -417
- package/src/cborg/cborg/lib/common.js +0 -27
- package/src/cborg/cborg/lib/decode.js +0 -209
- package/src/cborg/cborg/lib/diagnostic.js +0 -156
- package/src/cborg/cborg/lib/diagnostic_test.js +0 -117
- package/src/cborg/cborg/lib/encode.js +0 -464
- package/src/cborg/cborg/lib/is.js +0 -106
- package/src/cborg/cborg/lib/json/decode.js +0 -462
- package/src/cborg/cborg/lib/json/encode.js +0 -299
- package/src/cborg/cborg/lib/json/json.js +0 -4
- package/src/cborg/cborg/lib/jump.js +0 -209
- package/src/cborg/cborg/lib/length.js +0 -61
- package/src/cborg/cborg/lib/token.js +0 -76
- package/src/cborg/cborg/node_modules/.bin/cborg +0 -17
- package/src/cborg/cborg/package.json +0 -168
- package/src/cborg/cborg/taglib.js +0 -73
- package/src/cborg/cborg/test/appendix_a.js +0 -647
- package/src/cborg/cborg/test/common.js +0 -18
- package/src/cborg/cborg/test/node-test-bin.js +0 -402
- package/src/cborg/cborg/test/noop-bin-test.js +0 -3
- package/src/cborg/cborg/test/test-0uint.js +0 -103
- package/src/cborg/cborg/test/test-1negint.js +0 -96
- package/src/cborg/cborg/test/test-2bytes.js +0 -198
- package/src/cborg/cborg/test/test-3string.js +0 -136
- package/src/cborg/cborg/test/test-4array.js +0 -93
- package/src/cborg/cborg/test/test-5map.js +0 -284
- package/src/cborg/cborg/test/test-6tag.js +0 -85
- package/src/cborg/cborg/test/test-7float.js +0 -131
- package/src/cborg/cborg/test/test-bl.js +0 -37
- package/src/cborg/cborg/test/test-cbor-vectors.js +0 -107
- package/src/cborg/cborg/test/test-decode-errors.js +0 -65
- package/src/cborg/cborg/test/test-fuzz.js +0 -42
- package/src/cborg/cborg/test/test-json.js +0 -219
- package/src/cborg/cborg/test/test-length.js +0 -65
- package/src/cborg/cborg/test/test-partial.js +0 -111
- package/src/cborg/cborg/tsconfig.json +0 -45
- package/src/cborg/cborg/types/cborg.d.ts +0 -28
- package/src/cborg/cborg/types/cborg.d.ts.map +0 -1
- package/src/cborg/cborg/types/example.d.ts +0 -2
- package/src/cborg/cborg/types/example.d.ts.map +0 -1
- package/src/cborg/cborg/types/interface.d.ts +0 -47
- package/src/cborg/cborg/types/interface.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/0uint.d.ts +0 -100
- package/src/cborg/cborg/types/lib/0uint.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/1negint.d.ts +0 -58
- package/src/cborg/cborg/types/lib/1negint.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/2bytes.d.ts +0 -68
- package/src/cborg/cborg/types/lib/2bytes.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/3string.d.ts +0 -46
- package/src/cborg/cborg/types/lib/3string.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/4array.d.ts +0 -65
- package/src/cborg/cborg/types/lib/4array.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/5map.d.ts +0 -65
- package/src/cborg/cborg/types/lib/5map.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/6tag.d.ts +0 -61
- package/src/cborg/cborg/types/lib/6tag.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/7float.d.ts +0 -60
- package/src/cborg/cborg/types/lib/7float.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/bin.d.ts +0 -4
- package/src/cborg/cborg/types/lib/bin.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/bl.d.ts +0 -26
- package/src/cborg/cborg/types/lib/bl.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/byte-utils.d.ts +0 -53
- package/src/cborg/cborg/types/lib/byte-utils.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/common.d.ts +0 -10
- package/src/cborg/cborg/types/lib/common.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/decode.d.ts +0 -41
- package/src/cborg/cborg/types/lib/decode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/diagnostic.d.ts +0 -12
- package/src/cborg/cborg/types/lib/diagnostic.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/diagnostic_test.d.ts +0 -2
- package/src/cborg/cborg/types/lib/diagnostic_test.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/encode.d.ts +0 -50
- package/src/cborg/cborg/types/lib/encode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/is.d.ts +0 -6
- package/src/cborg/cborg/types/lib/is.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/decode.d.ts +0 -67
- package/src/cborg/cborg/types/lib/json/decode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/encode.d.ts +0 -11
- package/src/cborg/cborg/types/lib/json/encode.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/forward-cborg.d.ts +0 -6
- package/src/cborg/cborg/types/lib/json/forward-cborg.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/json/json.d.ts +0 -6
- package/src/cborg/cborg/types/lib/json/json.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/jump.d.ts +0 -12
- package/src/cborg/cborg/types/lib/jump.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/length.d.ts +0 -27
- package/src/cborg/cborg/types/lib/length.d.ts.map +0 -1
- package/src/cborg/cborg/types/lib/token.d.ts +0 -59
- package/src/cborg/cborg/types/lib/token.d.ts.map +0 -1
- package/src/cborg/cborg/types/taglib.d.ts +0 -18
- package/src/cborg/cborg/types/taglib.d.ts.map +0 -1
- package/src/cborg/cborg/types/tsconfig.tsbuildinfo +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/LICENSE +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/README.md +0 -105
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/index.min.js +0 -3
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.d.ts +0 -57
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.js +0 -73
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/errors.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.d.ts +0 -355
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.js +0 -197
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js +0 -9
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js +0 -9
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.js +0 -38
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/identity.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.js +0 -30
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.js +0 -9
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/json.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.js +0 -37
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/raw.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js +0 -29
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js +0 -153
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js +0 -59
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js +0 -25
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js +0 -104
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts +0 -3
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js +0 -20
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts +0 -6
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js +0 -116
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js +0 -57
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts +0 -6
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js +0 -30
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js.map +0 -1
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/dist/typedoc-urls.json +0 -58
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/package.json +0 -180
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/errors.ts +0 -87
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/index.ts +0 -498
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/dag-cbor.ts +0 -12
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/dag-json.ts +0 -12
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/identity.ts +0 -49
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/index.ts +0 -35
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/json.ts +0 -12
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/raw.ts +0 -49
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/directory.ts +0 -39
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.ts +0 -198
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/hamt-sharded-directory.ts +0 -76
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/raw.ts +0 -37
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/index.ts +0 -121
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/extract-data-from-block.ts +0 -24
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.ts +0 -149
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/resolve-object-path.ts +0 -62
- package/src/ipfs-unixfs-exporter/ipfs-unixfs-exporter/src/utils/validate-offset-and-length.ts +0 -38
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ipld/dag-json",
|
|
3
|
-
"version": "10.2.3",
|
|
4
|
-
"description": "JS implementation of DAG-JSON",
|
|
5
|
-
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
6
|
-
"license": "Apache-2.0 OR MIT",
|
|
7
|
-
"homepage": "https://github.com/ipld/js-dag-json#readme",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/ipld/js-dag-json.git"
|
|
11
|
-
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/ipld/js-dag-json/issues"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"ipfs",
|
|
17
|
-
"ipld",
|
|
18
|
-
"multiformats"
|
|
19
|
-
],
|
|
20
|
-
"engines": {
|
|
21
|
-
"node": ">=16.0.0",
|
|
22
|
-
"npm": ">=7.0.0"
|
|
23
|
-
},
|
|
24
|
-
"type": "module",
|
|
25
|
-
"types": "./dist/src/index.d.ts",
|
|
26
|
-
"typesVersions": {
|
|
27
|
-
"*": {
|
|
28
|
-
"*": [
|
|
29
|
-
"*",
|
|
30
|
-
"dist/*",
|
|
31
|
-
"dist/src/*",
|
|
32
|
-
"dist/src/*/index"
|
|
33
|
-
],
|
|
34
|
-
"src/*": [
|
|
35
|
-
"*",
|
|
36
|
-
"dist/*",
|
|
37
|
-
"dist/src/*",
|
|
38
|
-
"dist/src/*/index"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"files": [
|
|
43
|
-
"src",
|
|
44
|
-
"dist",
|
|
45
|
-
"!dist/test",
|
|
46
|
-
"!**/*.tsbuildinfo"
|
|
47
|
-
],
|
|
48
|
-
"exports": {
|
|
49
|
-
".": {
|
|
50
|
-
"types": "./dist/src/index.d.ts",
|
|
51
|
-
"import": "./src/index.js"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"eslintConfig": {
|
|
55
|
-
"extends": "ipfs",
|
|
56
|
-
"parserOptions": {
|
|
57
|
-
"sourceType": "module"
|
|
58
|
-
},
|
|
59
|
-
"ignorePatterns": [
|
|
60
|
-
"test/ts-use"
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
"release": {
|
|
64
|
-
"branches": [
|
|
65
|
-
"master"
|
|
66
|
-
],
|
|
67
|
-
"plugins": [
|
|
68
|
-
[
|
|
69
|
-
"@semantic-release/commit-analyzer",
|
|
70
|
-
{
|
|
71
|
-
"preset": "conventionalcommits",
|
|
72
|
-
"releaseRules": [
|
|
73
|
-
{
|
|
74
|
-
"breaking": true,
|
|
75
|
-
"release": "major"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"revert": true,
|
|
79
|
-
"release": "patch"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "feat",
|
|
83
|
-
"release": "minor"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"type": "fix",
|
|
87
|
-
"release": "patch"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"type": "docs",
|
|
91
|
-
"release": "patch"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"type": "test",
|
|
95
|
-
"release": "patch"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"type": "deps",
|
|
99
|
-
"release": "patch"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"scope": "no-release",
|
|
103
|
-
"release": false
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
[
|
|
109
|
-
"@semantic-release/release-notes-generator",
|
|
110
|
-
{
|
|
111
|
-
"preset": "conventionalcommits",
|
|
112
|
-
"presetConfig": {
|
|
113
|
-
"types": [
|
|
114
|
-
{
|
|
115
|
-
"type": "feat",
|
|
116
|
-
"section": "Features"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"type": "fix",
|
|
120
|
-
"section": "Bug Fixes"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"type": "chore",
|
|
124
|
-
"section": "Trivial Changes"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"type": "docs",
|
|
128
|
-
"section": "Documentation"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"type": "deps",
|
|
132
|
-
"section": "Dependencies"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"type": "test",
|
|
136
|
-
"section": "Tests"
|
|
137
|
-
}
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
"@semantic-release/changelog",
|
|
143
|
-
"@semantic-release/npm",
|
|
144
|
-
"@semantic-release/github",
|
|
145
|
-
"@semantic-release/git"
|
|
146
|
-
]
|
|
147
|
-
},
|
|
148
|
-
"scripts": {
|
|
149
|
-
"clean": "aegir clean",
|
|
150
|
-
"lint": "aegir lint",
|
|
151
|
-
"build": "aegir build",
|
|
152
|
-
"release": "aegir release",
|
|
153
|
-
"test": "npm run lint && aegir test",
|
|
154
|
-
"test:ts": "npm run test --prefix test/ts-use",
|
|
155
|
-
"test:node": "aegir test -t node --cov",
|
|
156
|
-
"test:chrome": "aegir test -t browser --cov",
|
|
157
|
-
"test:chrome-webworker": "aegir test -t webworker",
|
|
158
|
-
"test:firefox": "aegir test -t browser -- --browser firefox",
|
|
159
|
-
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
|
|
160
|
-
"test:electron-main": "aegir test -t electron-main",
|
|
161
|
-
"dep-check": "aegir dep-check"
|
|
162
|
-
},
|
|
163
|
-
"dependencies": {
|
|
164
|
-
"cborg": "^4.0.0",
|
|
165
|
-
"multiformats": "^13.1.0"
|
|
166
|
-
},
|
|
167
|
-
"devDependencies": {
|
|
168
|
-
"@ipld/garbage": "^6.0.0",
|
|
169
|
-
"aegir": "^45.0.7",
|
|
170
|
-
"eslint-config-ipfs": "^7.0.6",
|
|
171
|
-
"eslint-plugin-n": "^17.14.0"
|
|
172
|
-
}
|
|
173
|
-
}
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
/* eslint max-depth: ["error", 7] */
|
|
2
|
-
import { Token, Type } from 'cborg'
|
|
3
|
-
import * as cborgJson from 'cborg/json'
|
|
4
|
-
import { CID } from 'multiformats'
|
|
5
|
-
import { base64 } from 'multiformats/bases/base64'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @template T
|
|
9
|
-
* @typedef {import('multiformats/codecs/interface').ByteView<T>} ByteView
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* @template T
|
|
13
|
-
* @typedef {import('multiformats/codecs/interface').ArrayBufferView<T>} ArrayBufferView
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* @template T
|
|
17
|
-
* @typedef {import('multiformats').ToString<T>} ToString
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {import('cborg/interface').DecodeTokenizer} DecodeTokenizer
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @template T
|
|
25
|
-
* @param {ByteView<T> | ArrayBufferView<T>} buf
|
|
26
|
-
* @returns {ByteView<T>}
|
|
27
|
-
*/
|
|
28
|
-
function toByteView (buf) {
|
|
29
|
-
if (buf instanceof ArrayBuffer) {
|
|
30
|
-
return new Uint8Array(buf, 0, buf.byteLength)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return buf
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* cidEncoder will receive all Objects during encode, it needs to filter out
|
|
38
|
-
* anything that's not a CID and return `null` for that so it's encoded as
|
|
39
|
-
* normal. Encoding a CID means replacing it with a `{"/":"<CidString>}`
|
|
40
|
-
* object as per the DAG-JSON spec.
|
|
41
|
-
*
|
|
42
|
-
* @param {any} obj
|
|
43
|
-
* @returns {Token[]|null}
|
|
44
|
-
*/
|
|
45
|
-
function cidEncoder (obj) {
|
|
46
|
-
if (obj.asCID !== obj && obj['/'] !== obj.bytes) {
|
|
47
|
-
return null // any other kind of object
|
|
48
|
-
}
|
|
49
|
-
const cid = CID.asCID(obj)
|
|
50
|
-
/* c8 ignore next 4 */
|
|
51
|
-
// very unlikely case, and it'll probably throw a recursion error in cborg
|
|
52
|
-
if (!cid) {
|
|
53
|
-
return null
|
|
54
|
-
}
|
|
55
|
-
const cidString = cid.toString()
|
|
56
|
-
|
|
57
|
-
return [
|
|
58
|
-
new Token(Type.map, Infinity, 1),
|
|
59
|
-
new Token(Type.string, '/', 1), // key
|
|
60
|
-
new Token(Type.string, cidString, cidString.length), // value
|
|
61
|
-
new Token(Type.break, undefined, 1)
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* bytesEncoder will receive all Uint8Arrays (and friends) during encode, it
|
|
67
|
-
* needs to replace it with a `{"/":{"bytes":"Base64ByteString"}}` object as
|
|
68
|
-
* per the DAG-JSON spec.
|
|
69
|
-
*
|
|
70
|
-
* @param {Uint8Array} bytes
|
|
71
|
-
* @returns {Token[]|null}
|
|
72
|
-
*/
|
|
73
|
-
function bytesEncoder (bytes) {
|
|
74
|
-
const bytesString = base64.encode(bytes).slice(1) // no mbase prefix
|
|
75
|
-
return [
|
|
76
|
-
new Token(Type.map, Infinity, 1),
|
|
77
|
-
new Token(Type.string, '/', 1), // key
|
|
78
|
-
new Token(Type.map, Infinity, 1), // value
|
|
79
|
-
new Token(Type.string, 'bytes', 5), // inner key
|
|
80
|
-
new Token(Type.string, bytesString, bytesString.length), // inner value
|
|
81
|
-
new Token(Type.break, undefined, 1),
|
|
82
|
-
new Token(Type.break, undefined, 1)
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* taBytesEncoder wraps bytesEncoder() but for the more exotic typed arrays so
|
|
88
|
-
* that we access the underlying ArrayBuffer data
|
|
89
|
-
*
|
|
90
|
-
* @param {Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array|Float64Array|Uint8ClampedArray|BigInt64Array|BigUint64Array} obj
|
|
91
|
-
* @returns {Token[]|null}
|
|
92
|
-
*/
|
|
93
|
-
function taBytesEncoder (obj) {
|
|
94
|
-
return bytesEncoder(new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength))
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* abBytesEncoder wraps bytesEncoder() but for plain ArrayBuffers
|
|
99
|
-
*
|
|
100
|
-
* @param {ArrayBuffer} ab
|
|
101
|
-
* @returns {Token[]|null}
|
|
102
|
-
*/
|
|
103
|
-
function abBytesEncoder (ab) {
|
|
104
|
-
return bytesEncoder(new Uint8Array(ab))
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// eslint-disable-next-line jsdoc/require-returns-check
|
|
108
|
-
/**
|
|
109
|
-
* Intercept all `undefined` values from an object walk and reject the entire
|
|
110
|
-
* object if we find one.
|
|
111
|
-
*
|
|
112
|
-
* @returns {null}
|
|
113
|
-
*/
|
|
114
|
-
function undefinedEncoder () {
|
|
115
|
-
throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded')
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Intercept all `number` values from an object walk and reject the entire
|
|
120
|
-
* object if we find something that doesn't fit the IPLD data model (NaN &
|
|
121
|
-
* Infinity).
|
|
122
|
-
*
|
|
123
|
-
* @param {number} num
|
|
124
|
-
* @returns {null}
|
|
125
|
-
*/
|
|
126
|
-
function numberEncoder (num) {
|
|
127
|
-
if (Number.isNaN(num)) {
|
|
128
|
-
throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded')
|
|
129
|
-
}
|
|
130
|
-
if (num === Infinity || num === -Infinity) {
|
|
131
|
-
throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded')
|
|
132
|
-
}
|
|
133
|
-
return null // process with standard number encoder
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const encodeOptions = {
|
|
137
|
-
typeEncoders: {
|
|
138
|
-
Object: cidEncoder,
|
|
139
|
-
Buffer: bytesEncoder,
|
|
140
|
-
Uint8Array: bytesEncoder,
|
|
141
|
-
Int8Array: taBytesEncoder,
|
|
142
|
-
Uint16Array: taBytesEncoder,
|
|
143
|
-
Int16Array: taBytesEncoder,
|
|
144
|
-
Uint32Array: taBytesEncoder,
|
|
145
|
-
Int32Array: taBytesEncoder,
|
|
146
|
-
Float32Array: taBytesEncoder,
|
|
147
|
-
Float64Array: taBytesEncoder,
|
|
148
|
-
Uint8ClampedArray: taBytesEncoder,
|
|
149
|
-
BigInt64Array: taBytesEncoder,
|
|
150
|
-
BigUint64Array: taBytesEncoder,
|
|
151
|
-
DataView: taBytesEncoder,
|
|
152
|
-
ArrayBuffer: abBytesEncoder,
|
|
153
|
-
undefined: undefinedEncoder,
|
|
154
|
-
number: numberEncoder
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* @implements {DecodeTokenizer}
|
|
160
|
-
*/
|
|
161
|
-
class DagJsonTokenizer extends cborgJson.Tokenizer {
|
|
162
|
-
/**
|
|
163
|
-
* @param {Uint8Array} data
|
|
164
|
-
* @param {object} [options]
|
|
165
|
-
*/
|
|
166
|
-
constructor (data, options) {
|
|
167
|
-
super(data, options)
|
|
168
|
-
/** @type {Token[]} */
|
|
169
|
-
this.tokenBuffer = []
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @returns {boolean}
|
|
174
|
-
*/
|
|
175
|
-
done () {
|
|
176
|
-
return this.tokenBuffer.length === 0 && super.done()
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* @returns {Token}
|
|
181
|
-
*/
|
|
182
|
-
_next () {
|
|
183
|
-
if (this.tokenBuffer.length > 0) {
|
|
184
|
-
// @ts-ignore https://github.com/Microsoft/TypeScript/issues/30406
|
|
185
|
-
return this.tokenBuffer.pop()
|
|
186
|
-
}
|
|
187
|
-
return super.next()
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Implements rules outlined in https://github.com/ipld/specs/pull/356
|
|
192
|
-
*
|
|
193
|
-
* @returns {Token}
|
|
194
|
-
*/
|
|
195
|
-
next () {
|
|
196
|
-
const token = this._next()
|
|
197
|
-
|
|
198
|
-
if (token.type.compare(Type.map) === 0) {
|
|
199
|
-
const keyToken = this._next()
|
|
200
|
-
if (keyToken.type.compare(Type.string) === 0 && keyToken.value === '/') {
|
|
201
|
-
const valueToken = this._next()
|
|
202
|
-
if (valueToken.type.compare(Type.string) === 0) { // *must* be a CID
|
|
203
|
-
const breakToken = this._next() // swallow the end-of-map token
|
|
204
|
-
if (breakToken.type.compare(Type.break)) {
|
|
205
|
-
throw new Error('Invalid encoded CID form')
|
|
206
|
-
}
|
|
207
|
-
this.tokenBuffer.push(valueToken) // CID.parse will pick this up after our tag token
|
|
208
|
-
return new Token(Type.tag, 42, 0)
|
|
209
|
-
}
|
|
210
|
-
if (valueToken.type.compare(Type.map) === 0) {
|
|
211
|
-
const innerKeyToken = this._next()
|
|
212
|
-
if (innerKeyToken.type.compare(Type.string) === 0 && innerKeyToken.value === 'bytes') {
|
|
213
|
-
const innerValueToken = this._next()
|
|
214
|
-
if (innerValueToken.type.compare(Type.string) === 0) { // *must* be Bytes
|
|
215
|
-
for (let i = 0; i < 2; i++) {
|
|
216
|
-
const breakToken = this._next() // swallow two end-of-map tokens
|
|
217
|
-
if (breakToken.type.compare(Type.break)) {
|
|
218
|
-
throw new Error('Invalid encoded Bytes form')
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
const bytes = base64.decode(`m${innerValueToken.value}`)
|
|
222
|
-
return new Token(Type.bytes, bytes, innerValueToken.value.length)
|
|
223
|
-
}
|
|
224
|
-
this.tokenBuffer.push(innerValueToken) // bail
|
|
225
|
-
}
|
|
226
|
-
this.tokenBuffer.push(innerKeyToken) // bail
|
|
227
|
-
}
|
|
228
|
-
this.tokenBuffer.push(valueToken) // bail
|
|
229
|
-
}
|
|
230
|
-
this.tokenBuffer.push(keyToken) // bail
|
|
231
|
-
}
|
|
232
|
-
return token
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const decodeOptions = {
|
|
237
|
-
allowIndefinite: false,
|
|
238
|
-
allowUndefined: false,
|
|
239
|
-
allowNaN: false,
|
|
240
|
-
allowInfinity: false,
|
|
241
|
-
allowBigInt: true, // this will lead to BigInt for ints outside of
|
|
242
|
-
// safe-integer range, which may surprise users
|
|
243
|
-
strict: true,
|
|
244
|
-
useMaps: false,
|
|
245
|
-
rejectDuplicateMapKeys: true,
|
|
246
|
-
/** @type {import('cborg').TagDecoder[]} */
|
|
247
|
-
tags: []
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// we're going to get TAG(42)STRING("bafy...") from the tokenizer so we only need
|
|
251
|
-
// to deal with the STRING("bafy...") at this point
|
|
252
|
-
decodeOptions.tags[42] = CID.parse
|
|
253
|
-
|
|
254
|
-
export const name = 'dag-json'
|
|
255
|
-
export const code = 0x0129
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @template T
|
|
259
|
-
* @param {T} node
|
|
260
|
-
* @returns {ByteView<T>}
|
|
261
|
-
*/
|
|
262
|
-
export const encode = (node) => cborgJson.encode(node, encodeOptions)
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* @template T
|
|
266
|
-
* @param {ByteView<T> | ArrayBufferView<T>} data
|
|
267
|
-
* @returns {T}
|
|
268
|
-
*/
|
|
269
|
-
export const decode = (data) => {
|
|
270
|
-
const buf = toByteView(data)
|
|
271
|
-
// the tokenizer is stateful so we need a single instance of it
|
|
272
|
-
const options = Object.assign(decodeOptions, { tokenizer: new DagJsonTokenizer(buf, decodeOptions) })
|
|
273
|
-
return cborgJson.decode(buf, options)
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* @template T
|
|
278
|
-
* @param {T} node
|
|
279
|
-
* @returns {ToString<T>}
|
|
280
|
-
*/
|
|
281
|
-
export const format = (node) => utf8Decoder.decode(encode(node))
|
|
282
|
-
export { format as stringify }
|
|
283
|
-
const utf8Decoder = new TextDecoder()
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* @template T
|
|
287
|
-
* @param {ToString<T>} data
|
|
288
|
-
* @returns {T}
|
|
289
|
-
*/
|
|
290
|
-
export const parse = (data) => decode(utf8Encoder.encode(data))
|
|
291
|
-
const utf8Encoder = new TextEncoder()
|