@fireproof/vendor 0.0.0-smoke → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +150 -7
- 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-APACHE +0 -5
- package/patched/@ipld/dag-json/LICENSE-MIT +0 -19
- package/patched/@ipld/dag-json/ipld-dag-json-10.2.3.tgz +0 -0
- 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/cborg-4.2.7.tgz +0 -0
- package/patched/cborg/example-json.js +0 -6
- package/patched/cborg/example.js +0 -5
- package/patched/cborg/lib/0uint.js +0 -227
- package/patched/cborg/lib/json/decode.js +0 -462
- package/patched/cborg/lib/json/encode.js +0 -299
- package/patched/cborg/package.json +0 -169
- package/patched/cborg/pnpm-lock.yaml +0 -6096
- package/patched/cborg/test/common.js +0 -18
- package/patched/cborg/test/test-cbor-vectors.js +0 -107
- package/patched/cborg/test/test-json.js +0 -219
- package/src/@ipld/car/car/node_modules/.bin/cborg +0 -17
- package/src/@ipld/dag-cbor/dag-cbor/node_modules/.bin/cborg +0 -17
- package/src/@ipld/dag-json/dag-json/README.md +0 -58
- 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/@web3-storage/pail/pail/node_modules/.bin/pail +0 -17
- 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/interface.ts +0 -56
- 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/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/taglib.js +0 -73
- package/src/cborg/cborg/test/appendix_a.js +0 -647
- 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-decode-errors.js +0 -65
- package/src/cborg/cborg/test/test-fuzz.js +0 -42
- 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/{patched/@ipld/dag-json → src/@ipld/car}/LICENSE +0 -0
- /package/src/@ipld/car/{car/README.md → README.md} +0 -0
- /package/src/@ipld/car/{car/dist → dist}/index.min.js +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/api.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/api.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-decoder.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-decoder.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-reader-browser.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-reader-browser.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-reader.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-reader.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-writer.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/buffer-writer.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/coding.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/coding.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/decoder-common.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/decoder-common.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/decoder.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/decoder.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/encoder.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/encoder.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/header-validator.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/header-validator.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/index-browser.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/index-browser.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/index.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/index.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/indexed-reader-browser.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/indexed-reader-browser.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/indexed-reader.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/indexed-reader.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/indexer.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/indexer.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/iterator-channel.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/iterator-channel.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/iterator.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/iterator.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/reader-browser.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/reader-browser.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/reader.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/reader.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/writer-browser.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/writer-browser.d.ts.map +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/writer.d.ts +0 -0
- /package/src/@ipld/car/{car/dist → dist}/src/writer.d.ts.map +0 -0
- /package/src/@ipld/car/{car/package.json → package.json} +0 -0
- /package/src/@ipld/car/{car/src → src}/api.ts +0 -0
- /package/src/@ipld/car/{car/src → src}/buffer-decoder.js +0 -0
- /package/src/@ipld/car/{car/src → src}/buffer-reader-browser.js +0 -0
- /package/src/@ipld/car/{car/src → src}/buffer-reader.js +0 -0
- /package/src/@ipld/car/{car/src → src}/buffer-writer.js +0 -0
- /package/src/@ipld/car/{car/src → src}/coding.ts +0 -0
- /package/src/@ipld/car/{car/src → src}/decoder-common.js +0 -0
- /package/src/@ipld/car/{car/src → src}/decoder.js +0 -0
- /package/src/@ipld/car/{car/src → src}/encoder.js +0 -0
- /package/src/@ipld/car/{car/src → src}/header-validator.js +0 -0
- /package/src/@ipld/car/{car/src → src}/header.ipldsch +0 -0
- /package/src/@ipld/car/{car/src → src}/index-browser.js +0 -0
- /package/src/@ipld/car/{car/src → src}/index.js +0 -0
- /package/src/@ipld/car/{car/src → src}/indexed-reader-browser.js +0 -0
- /package/src/@ipld/car/{car/src → src}/indexed-reader.js +0 -0
- /package/src/@ipld/car/{car/src → src}/indexer.js +0 -0
- /package/src/@ipld/car/{car/src → src}/iterator-channel.js +0 -0
- /package/src/@ipld/car/{car/src → src}/iterator.js +0 -0
- /package/src/@ipld/car/{car/src → src}/reader-browser.js +0 -0
- /package/src/@ipld/car/{car/src → src}/reader.js +0 -0
- /package/src/@ipld/car/{car/src → src}/writer-browser.js +0 -0
- /package/src/@ipld/car/{car/src → src}/writer.js +0 -0
- /package/src/@ipld/{car/car → dag-cbor}/LICENSE +0 -0
- /package/src/@ipld/dag-cbor/{dag-cbor/README.md → README.md} +0 -0
- /package/src/@ipld/dag-cbor/{dag-cbor/dist → dist}/index.min.js +0 -0
- /package/src/@ipld/dag-cbor/{dag-cbor/dist → dist}/src/index.d.ts +0 -0
- /package/src/@ipld/dag-cbor/{dag-cbor/dist → dist}/src/index.d.ts.map +0 -0
- /package/src/@ipld/dag-cbor/{dag-cbor/package.json → package.json} +0 -0
- /package/src/@ipld/dag-cbor/{dag-cbor/src → src}/index.js +0 -0
- /package/src/@ipld/{dag-cbor/dag-cbor → dag-json}/LICENSE +0 -0
- /package/{patched → src}/@ipld/dag-json/README.md +0 -0
- /package/src/@ipld/dag-json/{dag-json/dist → dist}/index.min.js +0 -0
- /package/src/@ipld/dag-json/{dag-json/dist → dist}/src/index.d.ts +0 -0
- /package/src/@ipld/dag-json/{dag-json/dist → dist}/src/index.d.ts.map +0 -0
- /package/{patched → src}/@ipld/dag-json/package.json +0 -0
- /package/src/@ipld/dag-json/{dag-json/src → src}/index.js +0 -0
- /package/src/@web3-storage/pail/{pail/LICENSE.md → LICENSE.md} +0 -0
- /package/src/@web3-storage/pail/{pail/README.md → README.md} +0 -0
- /package/src/@web3-storage/pail/{pail/cli.js → cli.js} +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/api.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/api.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/batch/api.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/batch/api.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/batch/index.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/batch/index.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/batch/shard.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/batch/shard.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/block.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/block.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/clock/api.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/clock/api.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/clock/index.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/clock/index.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/api.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/api.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/batch/api.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/batch/api.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/batch/index.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/batch/index.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/index.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/crdt/index.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/diff.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/diff.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/index.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/index.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/merge.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/merge.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/shard.d.ts +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/src/shard.d.ts.map +0 -0
- /package/src/@web3-storage/pail/{pail/dist → dist}/tsconfig.tsbuildinfo +0 -0
- /package/src/@web3-storage/pail/{pail/package.json → package.json} +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/api.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/api.ts +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/batch/api.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/batch/api.ts +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/batch/index.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/batch/shard.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/block.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/clock/api.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/clock/api.ts +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/clock/index.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/crdt/api.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/crdt/api.ts +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/crdt/batch/api.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/crdt/batch/api.ts +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/crdt/batch/index.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/crdt/index.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/diff.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/index.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/merge.js +0 -0
- /package/src/@web3-storage/pail/{pail/src → src}/shard.js +0 -0
- /package/{patched → src}/cborg/CHANGELOG.md +0 -0
- /package/{patched → src}/cborg/LICENSE +0 -0
- /package/{patched → src}/cborg/README.md +0 -0
- /package/{patched → src}/cborg/bench/bench.js +0 -0
- /package/{patched → src}/cborg/bench/json.js +0 -0
- /package/{patched → src}/cborg/bench/package.json +0 -0
- /package/{patched → src}/cborg/cborg.js +0 -0
- /package/{patched → src}/cborg/example-bytestrings.js +0 -0
- /package/src/cborg/{cborg/example-json.js → example-json.js} +0 -0
- /package/src/cborg/{cborg/example.js → example.js} +0 -0
- /package/{patched → src}/cborg/interface.ts +0 -0
- /package/src/cborg/{cborg/lib → lib}/0uint.js +0 -0
- /package/{patched → src}/cborg/lib/1negint.js +0 -0
- /package/{patched → src}/cborg/lib/2bytes.js +0 -0
- /package/{patched → src}/cborg/lib/3string.js +0 -0
- /package/{patched → src}/cborg/lib/4array.js +0 -0
- /package/{patched → src}/cborg/lib/5map.js +0 -0
- /package/{patched → src}/cborg/lib/6tag.js +0 -0
- /package/{patched → src}/cborg/lib/7float.js +0 -0
- /package/{patched → src}/cborg/lib/bin.js +0 -0
- /package/{patched → src}/cborg/lib/bl.js +0 -0
- /package/{patched → src}/cborg/lib/byte-utils.js +0 -0
- /package/{patched → src}/cborg/lib/common.js +0 -0
- /package/{patched → src}/cborg/lib/decode.js +0 -0
- /package/{patched → src}/cborg/lib/diagnostic.js +0 -0
- /package/{patched → src}/cborg/lib/diagnostic_test.js +0 -0
- /package/{patched → src}/cborg/lib/encode.js +0 -0
- /package/{patched → src}/cborg/lib/is.js +0 -0
- /package/src/cborg/{cborg/lib → lib}/json/decode.js +0 -0
- /package/src/cborg/{cborg/lib → lib}/json/encode.js +0 -0
- /package/{patched → src}/cborg/lib/json/json.js +0 -0
- /package/{patched → src}/cborg/lib/jump.js +0 -0
- /package/{patched → src}/cborg/lib/length.js +0 -0
- /package/{patched → src}/cborg/lib/token.js +0 -0
- /package/src/cborg/{cborg/package.json → package.json} +0 -0
- /package/{patched → src}/cborg/taglib.js +0 -0
- /package/{patched → src}/cborg/test/appendix_a.js +0 -0
- /package/src/cborg/{cborg/test → test}/common.js +0 -0
- /package/{patched → src}/cborg/test/node-test-bin.js +0 -0
- /package/{patched → src}/cborg/test/noop-bin-test.js +0 -0
- /package/{patched → src}/cborg/test/test-0uint.js +0 -0
- /package/{patched → src}/cborg/test/test-1negint.js +0 -0
- /package/{patched → src}/cborg/test/test-2bytes.js +0 -0
- /package/{patched → src}/cborg/test/test-3string.js +0 -0
- /package/{patched → src}/cborg/test/test-4array.js +0 -0
- /package/{patched → src}/cborg/test/test-5map.js +0 -0
- /package/{patched → src}/cborg/test/test-6tag.js +0 -0
- /package/{patched → src}/cborg/test/test-7float.js +0 -0
- /package/{patched → src}/cborg/test/test-bl.js +0 -0
- /package/src/cborg/{cborg/test → test}/test-cbor-vectors.js +0 -0
- /package/{patched → src}/cborg/test/test-decode-errors.js +0 -0
- /package/{patched → src}/cborg/test/test-fuzz.js +0 -0
- /package/src/cborg/{cborg/test → test}/test-json.js +0 -0
- /package/{patched → src}/cborg/test/test-length.js +0 -0
- /package/{patched → src}/cborg/test/test-partial.js +0 -0
- /package/{patched → src}/cborg/tsconfig.json +0 -0
- /package/{patched → src}/cborg/types/cborg.d.ts +0 -0
- /package/{patched → src}/cborg/types/cborg.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/example.d.ts +0 -0
- /package/{patched → src}/cborg/types/example.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/interface.d.ts +0 -0
- /package/{patched → src}/cborg/types/interface.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/0uint.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/0uint.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/1negint.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/1negint.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/2bytes.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/2bytes.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/3string.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/3string.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/4array.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/4array.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/5map.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/5map.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/6tag.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/6tag.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/7float.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/7float.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/bin.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/bin.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/bl.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/bl.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/byte-utils.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/byte-utils.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/common.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/common.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/decode.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/decode.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/diagnostic.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/diagnostic.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/diagnostic_test.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/diagnostic_test.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/encode.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/encode.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/is.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/is.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/json/decode.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/json/decode.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/json/encode.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/json/encode.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/json/forward-cborg.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/json/forward-cborg.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/json/json.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/json/json.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/jump.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/jump.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/length.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/length.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/lib/token.d.ts +0 -0
- /package/{patched → src}/cborg/types/lib/token.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/taglib.d.ts +0 -0
- /package/{patched → src}/cborg/types/taglib.d.ts.map +0 -0
- /package/{patched → src}/cborg/types/tsconfig.tsbuildinfo +0 -0
- /package/src/{@ipld/dag-json/dag-json → ipfs-unixfs-exporter}/LICENSE +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/README.md → README.md} +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/index.min.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/errors.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/errors.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/errors.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/errors.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/index.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/index.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/index.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/index.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-cbor.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-cbor.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-cbor.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-cbor.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-json.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-json.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-json.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/dag-json.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/identity.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/identity.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/identity.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/identity.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/index.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/index.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/index.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/index.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/json.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/json.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/json.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/json.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/raw.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/raw.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/raw.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/raw.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/directory.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/directory.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/directory.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/directory.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/file.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/file.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/file.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/file.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/raw.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/raw.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/raw.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/content/raw.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/index.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/index.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/index.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/resolvers/unixfs-v1/index.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/extract-data-from-block.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/extract-data-from-block.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/extract-data-from-block.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/extract-data-from-block.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/find-cid-in-shard.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/find-cid-in-shard.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/find-cid-in-shard.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/find-cid-in-shard.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/resolve-object-path.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/resolve-object-path.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/resolve-object-path.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/resolve-object-path.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/validate-offset-and-length.d.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/validate-offset-and-length.d.ts.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/validate-offset-and-length.js +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/src/utils/validate-offset-and-length.js.map +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/dist → dist}/typedoc-urls.json +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/package.json → package.json} +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/errors.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/index.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/dag-cbor.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/dag-json.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/identity.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/index.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/json.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/raw.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/unixfs-v1/content/directory.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/unixfs-v1/content/file.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/unixfs-v1/content/hamt-sharded-directory.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/unixfs-v1/content/raw.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/resolvers/unixfs-v1/index.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/utils/extract-data-from-block.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/utils/find-cid-in-shard.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/utils/resolve-object-path.ts +0 -0
- /package/src/ipfs-unixfs-exporter/{ipfs-unixfs-exporter/src → src}/utils/validate-offset-and-length.ts +0 -0
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
// never reference the file directly to ensure the
|
|
2
|
-
// indepency of the json module
|
|
3
|
-
import { Type } from 'cborg'
|
|
4
|
-
import { encodeCustom } from 'cborg'
|
|
5
|
-
import { encodeErrPrefix } from 'cborg'
|
|
6
|
-
import { asU8A, fromString } from 'cborg'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {import('../../interface').EncodeOptions} EncodeOptions
|
|
10
|
-
* @typedef {import('../../interface').TokenTypeEncoder} TokenTypeEncoder
|
|
11
|
-
* @typedef {import('../token').Token} Token
|
|
12
|
-
* @typedef {import('../bl').Bl} Bl
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param {(buf: Bl, token: Token) => void} action
|
|
17
|
-
* @returns {TokenTypeEncoder}
|
|
18
|
-
*/
|
|
19
|
-
function wrapCompareTokens (action) {
|
|
20
|
-
const wrapped = (/** @type {Bl} */ buf, /** @type {Token} */token) => action(buf, token)
|
|
21
|
-
/**
|
|
22
|
-
* @param {Token} tok1
|
|
23
|
-
* @param {Token} tok2
|
|
24
|
-
* @returns {number}
|
|
25
|
-
*/
|
|
26
|
-
wrapped.compareTokens = function compareTokens (tok1, tok2) {
|
|
27
|
-
return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0
|
|
28
|
-
}
|
|
29
|
-
return wrapped
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @returns {TokenTypeEncoder[]}
|
|
34
|
-
*/
|
|
35
|
-
function makeJSONEncoders() {
|
|
36
|
-
/** @type {TokenTypeEncoder[]} */
|
|
37
|
-
const encoders = []
|
|
38
|
-
/** @type {{type:Type,elements:number}[]} */
|
|
39
|
-
const inRecursive = []
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @param {Bl} buf
|
|
43
|
-
*/
|
|
44
|
-
function prefix (buf) {
|
|
45
|
-
const recurs = inRecursive[inRecursive.length - 1]
|
|
46
|
-
if (recurs) {
|
|
47
|
-
if (recurs.type.equals(Type.array)) {
|
|
48
|
-
recurs.elements++
|
|
49
|
-
if (recurs.elements !== 1) { // >first
|
|
50
|
-
buf.push([44]) // ','
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (recurs.type.equals(Type.map)) {
|
|
54
|
-
recurs.elements++
|
|
55
|
-
if (recurs.elements !== 1) { // >first
|
|
56
|
-
if (recurs.elements % 2 === 1) { // key
|
|
57
|
-
buf.push([44]) // ','
|
|
58
|
-
} else {
|
|
59
|
-
buf.push([58]) // ':'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
encoders[Type.uint.major] = wrapCompareTokens((buf, token) => {
|
|
67
|
-
prefix(buf)
|
|
68
|
-
const is = String(token.value)
|
|
69
|
-
const isa = []
|
|
70
|
-
for (let i = 0; i < is.length; i++) {
|
|
71
|
-
isa[i] = is.charCodeAt(i)
|
|
72
|
-
}
|
|
73
|
-
buf.push(isa)
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
encoders[Type.negint.major] = wrapCompareTokens((buf, token) => {
|
|
77
|
-
encoders[Type.uint.major](buf, token)
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
encoders[Type.bytes.major] = wrapCompareTokens((_buf, _token) => {
|
|
81
|
-
throw new Error(`${encodeErrPrefix} unsupported type: Uint8Array`)
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
encoders[Type.string.major] = wrapCompareTokens((buf, token) => {
|
|
85
|
-
prefix(buf)
|
|
86
|
-
const byts = fromString(JSON.stringify(token.value))
|
|
87
|
-
buf.push(byts.length > 32 ? asU8A(byts) : byts)
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
encoders[Type.array.major] = wrapCompareTokens((buf, _token) => {
|
|
91
|
-
prefix(buf)
|
|
92
|
-
inRecursive.push({ type: Type.array, elements: 0 })
|
|
93
|
-
buf.push([91]) // '['
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
encoders[Type.map.major] = wrapCompareTokens((buf, _token) => {
|
|
97
|
-
prefix(buf)
|
|
98
|
-
inRecursive.push({ type: Type.map, elements: 0 })
|
|
99
|
-
buf.push([123]) // '{'
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
encoders[Type.tag.major] = wrapCompareTokens((_buf, _token) => {
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
encoders[Type.float.major] = wrapCompareTokens((buf, token) => {
|
|
106
|
-
if (token.type.equals(Type.break)) {
|
|
107
|
-
const recurs = inRecursive.pop()
|
|
108
|
-
if (recurs) {
|
|
109
|
-
if (recurs.type.equals(Type.array)) {
|
|
110
|
-
buf.push([93]) // ']'
|
|
111
|
-
} else if (recurs.type.equals(Type.map)) {
|
|
112
|
-
buf.push([125]) // '}'
|
|
113
|
-
/* c8 ignore next 3 */
|
|
114
|
-
} else {
|
|
115
|
-
throw new Error('Unexpected recursive type; this should not happen!')
|
|
116
|
-
}
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
/* c8 ignore next 2 */
|
|
120
|
-
throw new Error('Unexpected break; this should not happen!')
|
|
121
|
-
}
|
|
122
|
-
if (token.value === undefined) {
|
|
123
|
-
throw new Error(`${encodeErrPrefix} unsupported type: undefined`)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
prefix(buf)
|
|
127
|
-
if (token.type.equals(Type.true)) {
|
|
128
|
-
buf.push([116, 114, 117, 101]) // 'true'
|
|
129
|
-
return
|
|
130
|
-
} else if (token.type.equals(Type.false)) {
|
|
131
|
-
buf.push([102, 97, 108, 115, 101]) // 'false'
|
|
132
|
-
return
|
|
133
|
-
} else if (token.type.equals(Type.null)) {
|
|
134
|
-
buf.push([110, 117, 108, 108]) // 'null'
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// number
|
|
139
|
-
const is = String(token.value)
|
|
140
|
-
const isa = []
|
|
141
|
-
let dp = false
|
|
142
|
-
for (let i = 0; i < is.length; i++) {
|
|
143
|
-
isa[i] = is.charCodeAt(i)
|
|
144
|
-
if (!dp && (isa[i] === 46 || isa[i] === 101 || isa[i] === 69)) { // '[.eE]'
|
|
145
|
-
dp = true
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (!dp) { // need a decimal point for floats
|
|
149
|
-
isa.push(46) // '.'
|
|
150
|
-
isa.push(48) // '0'
|
|
151
|
-
}
|
|
152
|
-
buf.push(isa)
|
|
153
|
-
})
|
|
154
|
-
return encoders
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// The below code is mostly taken and modified from https://github.com/feross/buffer
|
|
158
|
-
// Licensed MIT. Copyright (c) Feross Aboukhadijeh
|
|
159
|
-
// function encodeUtf8 (string, byts) {
|
|
160
|
-
// let codePoint
|
|
161
|
-
// const length = string.length
|
|
162
|
-
// let leadSurrogate = null
|
|
163
|
-
|
|
164
|
-
// for (let i = 0; i < length; ++i) {
|
|
165
|
-
// codePoint = string.charCodeAt(i)
|
|
166
|
-
|
|
167
|
-
// // is surrogate component
|
|
168
|
-
// if (codePoint > 0xd7ff && codePoint < 0xe000) {
|
|
169
|
-
// // last char was a lead
|
|
170
|
-
// if (!leadSurrogate) {
|
|
171
|
-
// // no lead yet
|
|
172
|
-
// /* c8 ignore next 9 */
|
|
173
|
-
// if (codePoint > 0xdbff) {
|
|
174
|
-
// // unexpected trail
|
|
175
|
-
// byts.push(0xef, 0xbf, 0xbd)
|
|
176
|
-
// continue
|
|
177
|
-
// } else if (i + 1 === length) {
|
|
178
|
-
// // unpaired lead
|
|
179
|
-
// byts.push(0xef, 0xbf, 0xbd)
|
|
180
|
-
// continue
|
|
181
|
-
// }
|
|
182
|
-
|
|
183
|
-
// // valid lead
|
|
184
|
-
// leadSurrogate = codePoint
|
|
185
|
-
|
|
186
|
-
// continue
|
|
187
|
-
// }
|
|
188
|
-
|
|
189
|
-
// // 2 leads in a row
|
|
190
|
-
// /* c8 ignore next 5 */
|
|
191
|
-
// if (codePoint < 0xdc00) {
|
|
192
|
-
// byts.push(0xef, 0xbf, 0xbd)
|
|
193
|
-
// leadSurrogate = codePoint
|
|
194
|
-
// continue
|
|
195
|
-
// }
|
|
196
|
-
|
|
197
|
-
// // valid surrogate pair
|
|
198
|
-
// codePoint = (leadSurrogate - 0xd800 << 10 | codePoint - 0xdc00) + 0x10000
|
|
199
|
-
// /* c8 ignore next 4 */
|
|
200
|
-
// } else if (leadSurrogate) {
|
|
201
|
-
// // valid bmp char, but last char was a lead
|
|
202
|
-
// byts.push(0xef, 0xbf, 0xbd)
|
|
203
|
-
// }
|
|
204
|
-
|
|
205
|
-
// leadSurrogate = null
|
|
206
|
-
|
|
207
|
-
// // encode utf8
|
|
208
|
-
// if (codePoint < 0x80) {
|
|
209
|
-
// // special JSON escapes
|
|
210
|
-
// switch (codePoint) {
|
|
211
|
-
// case 8: // '\b'
|
|
212
|
-
// byts.push(92, 98) // '\\b'
|
|
213
|
-
// continue
|
|
214
|
-
// case 9: // '\t'
|
|
215
|
-
// byts.push(92, 116) // '\\t'
|
|
216
|
-
// continue
|
|
217
|
-
// case 10: // '\n'
|
|
218
|
-
// byts.push(92, 110) // '\\n'
|
|
219
|
-
// continue
|
|
220
|
-
// case 12: // '\f'
|
|
221
|
-
// byts.push(92, 102) // '\\f'
|
|
222
|
-
// continue
|
|
223
|
-
// case 13: // '\r'
|
|
224
|
-
// byts.push(92, 114) // '\\r'
|
|
225
|
-
// continue
|
|
226
|
-
// case 34: // '"'
|
|
227
|
-
// byts.push(92, 34) // '\\"'
|
|
228
|
-
// continue
|
|
229
|
-
// case 92: // '\\'
|
|
230
|
-
// byts.push(92, 92) // '\\\\'
|
|
231
|
-
// continue
|
|
232
|
-
// }
|
|
233
|
-
|
|
234
|
-
// byts.push(codePoint)
|
|
235
|
-
// } else if (codePoint < 0x800) {
|
|
236
|
-
// /* c8 ignore next 1 */
|
|
237
|
-
// byts.push(
|
|
238
|
-
// codePoint >> 0x6 | 0xc0,
|
|
239
|
-
// codePoint & 0x3f | 0x80
|
|
240
|
-
// )
|
|
241
|
-
// } else if (codePoint < 0x10000) {
|
|
242
|
-
// /* c8 ignore next 1 */
|
|
243
|
-
// byts.push(
|
|
244
|
-
// codePoint >> 0xc | 0xe0,
|
|
245
|
-
// codePoint >> 0x6 & 0x3f | 0x80,
|
|
246
|
-
// codePoint & 0x3f | 0x80
|
|
247
|
-
// )
|
|
248
|
-
// /* c8 ignore next 9 */
|
|
249
|
-
// } else if (codePoint < 0x110000) {
|
|
250
|
-
// byts.push(
|
|
251
|
-
// codePoint >> 0x12 | 0xf0,
|
|
252
|
-
// codePoint >> 0xc & 0x3f | 0x80,
|
|
253
|
-
// codePoint >> 0x6 & 0x3f | 0x80,
|
|
254
|
-
// codePoint & 0x3f | 0x80
|
|
255
|
-
// )
|
|
256
|
-
// } else {
|
|
257
|
-
// /* c8 ignore next 2 */
|
|
258
|
-
// throw new Error('Invalid code point')
|
|
259
|
-
// }
|
|
260
|
-
// }
|
|
261
|
-
// }
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* @param {(Token|Token[])[]} e1
|
|
265
|
-
* @param {(Token|Token[])[]} e2
|
|
266
|
-
* @returns {number}
|
|
267
|
-
*/
|
|
268
|
-
function mapSorter (e1, e2) {
|
|
269
|
-
if (Array.isArray(e1[0]) || Array.isArray(e2[0])) {
|
|
270
|
-
throw new Error(`${encodeErrPrefix} complex map keys are not supported`)
|
|
271
|
-
}
|
|
272
|
-
const keyToken1 = e1[0]
|
|
273
|
-
const keyToken2 = e2[0]
|
|
274
|
-
if (!keyToken1.type.equals(Type.string) || !keyToken2.type.equals(Type.string)) {
|
|
275
|
-
throw new Error(`${encodeErrPrefix} non-string map keys are not supported`)
|
|
276
|
-
}
|
|
277
|
-
if (keyToken1 < keyToken2) {
|
|
278
|
-
return -1
|
|
279
|
-
}
|
|
280
|
-
if (keyToken1 > keyToken2) {
|
|
281
|
-
return 1
|
|
282
|
-
}
|
|
283
|
-
/* c8 ignore next 1 */
|
|
284
|
-
throw new Error(`${encodeErrPrefix} unexpected duplicate map keys, this is not supported`)
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
const defaultEncodeOptions = { addBreakTokens: true, mapSorter }
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* @param {any} data
|
|
291
|
-
* @param {EncodeOptions} [options]
|
|
292
|
-
* @returns {Uint8Array}
|
|
293
|
-
*/
|
|
294
|
-
function encode (data, options) {
|
|
295
|
-
options = Object.assign({}, defaultEncodeOptions, options)
|
|
296
|
-
return encodeCustom(data, makeJSONEncoders(), options)
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export { encode }
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cborg",
|
|
3
|
-
"version": "4.2.7",
|
|
4
|
-
"description": "Fast CBOR with a focus on strictness",
|
|
5
|
-
"main": "cborg.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"cborg": "lib/bin.js"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"lint": "standard *.js lib/*.js test/*.js",
|
|
12
|
-
"build": "npm run build:types",
|
|
13
|
-
"build:types": "tsc --build",
|
|
14
|
-
"prepublishOnly": "npm run build",
|
|
15
|
-
"test:node": "c8 --check-coverage --exclude=test/** mocha test/test-*.js",
|
|
16
|
-
"test:browser": "polendina --cleanup test/test-*.js",
|
|
17
|
-
"test": "npm run lint && npm run build && npm run test:node && npm run test:browser",
|
|
18
|
-
"test:ci": "npm run test",
|
|
19
|
-
"coverage": "c8 --reporter=html --reporter=text mocha test/test-*.js && npx st -d coverage -p 8888"
|
|
20
|
-
},
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git@github.com:rvagg/cborg.git"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"cbor"
|
|
27
|
-
],
|
|
28
|
-
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
29
|
-
"license": "Apache-2.0",
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
32
|
-
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
33
|
-
"@semantic-release/git": "^10.0.1",
|
|
34
|
-
"@semantic-release/github": "^11.0.0",
|
|
35
|
-
"@semantic-release/npm": "^12.0.1",
|
|
36
|
-
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
37
|
-
"@types/chai": "^5.0.0",
|
|
38
|
-
"@types/mocha": "^10.0.8",
|
|
39
|
-
"@types/node": "^22.7.0",
|
|
40
|
-
"c8": "^10.1.2",
|
|
41
|
-
"chai": "^5.1.1",
|
|
42
|
-
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
43
|
-
"ipld-garbage": "^5.0.0",
|
|
44
|
-
"mocha": "^11.0.1",
|
|
45
|
-
"polendina": "^3.2.2",
|
|
46
|
-
"semantic-release": "^24.1.1",
|
|
47
|
-
"standard": "^17.1.2",
|
|
48
|
-
"typescript": "^5.6.2"
|
|
49
|
-
},
|
|
50
|
-
"exports": {
|
|
51
|
-
".": {
|
|
52
|
-
"import": "./cborg.js",
|
|
53
|
-
"types": "./types/cborg.d.ts"
|
|
54
|
-
},
|
|
55
|
-
"./length": {
|
|
56
|
-
"import": "./lib/length.js",
|
|
57
|
-
"types": "./types/lib/length.d.ts"
|
|
58
|
-
},
|
|
59
|
-
"./taglib": {
|
|
60
|
-
"import": "./taglib.js",
|
|
61
|
-
"types": "./types/taglib.d.ts"
|
|
62
|
-
},
|
|
63
|
-
"./json": {
|
|
64
|
-
"import": "./lib/json/json.js",
|
|
65
|
-
"types": "./types/lib/json/json.d.ts"
|
|
66
|
-
},
|
|
67
|
-
"./interface": {
|
|
68
|
-
"types": "./types/interface.d.ts"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"types": "cborg.d.ts",
|
|
72
|
-
"typesVersions": {
|
|
73
|
-
"*": {
|
|
74
|
-
"json": [
|
|
75
|
-
"types/lib/json/json.d.ts"
|
|
76
|
-
],
|
|
77
|
-
"length": [
|
|
78
|
-
"types/lib/length.d.ts"
|
|
79
|
-
],
|
|
80
|
-
"*": [
|
|
81
|
-
"types/*"
|
|
82
|
-
],
|
|
83
|
-
"types/*": [
|
|
84
|
-
"types/*"
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"release": {
|
|
89
|
-
"branches": [
|
|
90
|
-
"master"
|
|
91
|
-
],
|
|
92
|
-
"plugins": [
|
|
93
|
-
[
|
|
94
|
-
"@semantic-release/commit-analyzer",
|
|
95
|
-
{
|
|
96
|
-
"preset": "conventionalcommits",
|
|
97
|
-
"releaseRules": [
|
|
98
|
-
{
|
|
99
|
-
"breaking": true,
|
|
100
|
-
"release": "major"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"revert": true,
|
|
104
|
-
"release": "patch"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"type": "feat",
|
|
108
|
-
"release": "minor"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"type": "fix",
|
|
112
|
-
"release": "patch"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"type": "chore",
|
|
116
|
-
"release": "patch"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"type": "docs",
|
|
120
|
-
"release": "patch"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"type": "test",
|
|
124
|
-
"release": "patch"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"scope": "no-release",
|
|
128
|
-
"release": false
|
|
129
|
-
}
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
],
|
|
133
|
-
[
|
|
134
|
-
"@semantic-release/release-notes-generator",
|
|
135
|
-
{
|
|
136
|
-
"preset": "conventionalcommits",
|
|
137
|
-
"presetConfig": {
|
|
138
|
-
"types": [
|
|
139
|
-
{
|
|
140
|
-
"type": "feat",
|
|
141
|
-
"section": "Features"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"type": "fix",
|
|
145
|
-
"section": "Bug Fixes"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"type": "chore",
|
|
149
|
-
"section": "Trivial Changes"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"type": "docs",
|
|
153
|
-
"section": "Trivial Changes"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"type": "test",
|
|
157
|
-
"section": "Tests"
|
|
158
|
-
}
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
"@semantic-release/changelog",
|
|
164
|
-
"@semantic-release/npm",
|
|
165
|
-
"@semantic-release/github",
|
|
166
|
-
"@semantic-release/git"
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
}
|