@fireproof/vendor 0.0.0-smoke → 1.0.1
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 +155 -8
- package/src/@ipld/car/{car/README.md → README.md} +229 -175
- package/src/@ipld/car/dist/src/reader.d.ts.map +1 -0
- package/src/@ipld/car/{car/src → src}/reader.js +19 -2
- package/src/cborg/cborg/{lib/bin.js → bin.js} +2 -2
- package/src/cborg/cborg/common.js +28 -0
- package/{patched/cborg/lib → src/cborg/cborg}/decode.js +24 -22
- package/src/cborg/cborg/{lib/diagnostic.js → diagnostic.js} +6 -4
- package/{patched/cborg/lib → src/cborg/cborg}/diagnostic_test.js +1 -1
- package/src/cborg/cborg/{lib/encode.js → encode.js} +23 -21
- package/{patched/cborg/cborg.js → src/cborg/cborg/index.js} +12 -10
- package/src/cborg/cborg/{lib/length.js → length.js} +3 -2
- package/{patched → src}/cborg/interface.ts +7 -4
- package/src/cborg/{cborg/lib/json → json}/decode.js +25 -25
- package/src/cborg/{cborg/lib/json → json}/encode.js +19 -16
- package/src/cborg/{cborg/package.json → package.json} +15 -11
- package/src/cborg/{cborg/taglib.js → taglib.js} +3 -1
- package/src/cborg/{cborg/test → test}/common.js +1 -1
- package/{patched → src}/cborg/test/noop-bin-test.js +1 -1
- package/{patched → src}/cborg/test/test-0uint.js +2 -2
- package/src/cborg/{cborg/test → test}/test-1negint.js +2 -2
- package/src/cborg/{cborg/test → test}/test-2bytes.js +2 -2
- package/src/cborg/{cborg/test → test}/test-3string.js +2 -2
- package/{patched → src}/cborg/test/test-4array.js +2 -2
- package/{patched → src}/cborg/test/test-5map.js +2 -2
- package/src/cborg/{cborg/test → test}/test-6tag.js +2 -3
- package/{patched → src}/cborg/test/test-7float.js +2 -2
- package/{patched → src}/cborg/test/test-bl.js +1 -1
- package/src/cborg/{cborg/test → test}/test-cbor-vectors.js +2 -2
- package/src/cborg/{cborg/test → test}/test-decode-errors.js +2 -2
- package/{patched → src}/cborg/test/test-fuzz.js +1 -1
- package/src/cborg/{cborg/test → test}/test-json.js +25 -25
- package/{patched → src}/cborg/test/test-length.js +3 -3
- package/src/cborg/{cborg/test → test}/test-partial.js +2 -2
- package/src/cborg/{cborg/tsconfig.json → tsconfig.json} +5 -2
- package/{patched/cborg/types/lib → src/cborg/types/cborg}/decode.d.ts +5 -3
- package/src/cborg/types/cborg/decode.d.ts.map +1 -0
- package/{patched/cborg/types/lib → src/cborg/types/cborg}/encode.d.ts +4 -3
- package/src/cborg/types/cborg/encode.d.ts.map +1 -0
- package/src/cborg/types/cborg/index.d.ts +26 -0
- package/src/cborg/types/cborg/index.d.ts.map +1 -0
- package/src/cborg/types/cborg/is.d.ts.map +1 -0
- package/src/cborg/{cborg/types → types}/interface.d.ts +6 -4
- package/src/cborg/types/interface.d.ts.map +1 -0
- package/{patched/cborg/types/lib → src/cborg/types}/json/decode.d.ts +7 -7
- package/src/cborg/types/json/decode.d.ts.map +1 -0
- package/src/cborg/types/json/encode.d.ts +11 -0
- package/src/cborg/types/json/encode.d.ts.map +1 -0
- package/src/cborg/types/json/json.d.ts.map +1 -0
- package/{patched → src}/cborg/types/taglib.d.ts +1 -1
- package/{patched → src}/cborg/types/taglib.d.ts.map +1 -1
- package/src/cborg/types/tsconfig.tsbuildinfo +1 -0
- package/{patched/cborg/types/lib → src/cborg/types/utils}/0uint.d.ts +6 -4
- package/src/cborg/types/utils/0uint.d.ts.map +1 -0
- package/{patched/cborg/types/lib → src/cborg/types/utils}/1negint.d.ts +4 -3
- package/src/cborg/types/utils/1negint.d.ts.map +1 -0
- package/src/cborg/{cborg/types/lib → types/utils}/2bytes.d.ts +5 -4
- package/src/cborg/types/utils/2bytes.d.ts.map +1 -0
- package/src/cborg/{cborg/types/lib → types/utils}/3string.d.ts +1 -1
- package/src/cborg/types/utils/3string.d.ts.map +1 -0
- package/{patched/cborg/types/lib → src/cborg/types/utils}/4array.d.ts +3 -2
- package/src/cborg/types/utils/4array.d.ts.map +1 -0
- package/src/cborg/{cborg/types/lib → types/utils}/5map.d.ts +3 -2
- package/src/cborg/types/utils/5map.d.ts.map +1 -0
- package/{patched/cborg/types/lib → src/cborg/types/utils}/6tag.d.ts +4 -3
- package/src/cborg/types/utils/6tag.d.ts.map +1 -0
- package/src/cborg/{cborg/types/lib → types/utils}/7float.d.ts +2 -2
- package/src/cborg/types/utils/7float.d.ts.map +1 -0
- package/src/cborg/types/utils/bl.d.ts.map +1 -0
- package/src/cborg/types/utils/byte-utils.d.ts.map +1 -0
- package/src/cborg/types/utils/common.d.ts +8 -0
- package/src/cborg/types/utils/common.d.ts.map +1 -0
- package/src/cborg/types/utils/index.d.ts +13 -0
- package/src/cborg/types/utils/index.d.ts.map +1 -0
- package/src/cborg/types/utils/jump.d.ts +16 -0
- package/src/cborg/types/utils/jump.d.ts.map +1 -0
- package/src/cborg/types/utils/token.d.ts.map +1 -0
- package/src/cborg/{cborg/lib → utils}/0uint.js +16 -14
- package/src/cborg/{cborg/lib → utils}/1negint.js +5 -5
- package/src/cborg/{cborg/lib → utils}/2bytes.js +16 -14
- package/src/cborg/{cborg/lib → utils}/3string.js +4 -4
- package/src/cborg/{cborg/lib → utils}/4array.js +7 -6
- package/{patched/cborg/lib → src/cborg/utils}/5map.js +6 -6
- package/{patched/cborg/lib → src/cborg/utils}/6tag.js +4 -3
- package/src/cborg/{cborg/lib → utils}/7float.js +23 -21
- package/{patched/cborg/lib → src/cborg/utils}/bl.js +1 -1
- package/src/cborg/utils/common.js +11 -0
- package/src/cborg/utils/index.js +12 -0
- package/src/cborg/utils/jump.js +222 -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-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/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/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/7float.js +0 -308
- package/patched/cborg/lib/bin.js +0 -189
- package/patched/cborg/lib/common.js +0 -27
- package/patched/cborg/lib/diagnostic.js +0 -156
- package/patched/cborg/lib/encode.js +0 -464
- package/patched/cborg/lib/json/decode.js +0 -462
- package/patched/cborg/lib/json/encode.js +0 -299
- package/patched/cborg/lib/jump.js +0 -209
- package/patched/cborg/lib/length.js +0 -61
- 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/common.js +0 -18
- 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-6tag.js +0 -85
- 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-json.js +0 -219
- 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/interface.d.ts +0 -47
- package/patched/cborg/types/interface.d.ts.map +0 -1
- package/patched/cborg/types/lib/0uint.d.ts.map +0 -1
- 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.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.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.map +0 -1
- 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.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.map +0 -1
- package/patched/cborg/types/lib/is.d.ts.map +0 -1
- 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.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.map +0 -1
- package/patched/cborg/types/tsconfig.tsbuildinfo +0 -1
- package/src/@ipld/car/car/dist/src/reader.d.ts.map +0 -1
- 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/5map.js +0 -113
- package/src/cborg/cborg/lib/6tag.js +0 -80
- 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_test.js +0 -117
- 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/token.js +0 -76
- package/src/cborg/cborg/node_modules/.bin/cborg +0 -17
- 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-4array.js +0 -93
- package/src/cborg/cborg/test/test-5map.js +0 -284
- 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-fuzz.js +0 -42
- package/src/cborg/cborg/test/test-length.js +0 -65
- 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.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.map +0 -1
- 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.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.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/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/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}/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/.github/dependabot.yml +0 -0
- /package/{patched → src}/cborg/.github/workflows/test-and-release.yml +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/cborg/lib → src/cborg/cborg}/is.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/cborg/lib → src/cborg}/json/json.js +0 -0
- /package/{patched → src}/cborg/test/appendix_a.js +0 -0
- /package/{patched → src}/cborg/test/node-test-bin.js +0 -0
- /package/{patched/cborg/types/lib → src/cborg/types/cborg}/is.d.ts +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/cborg/types/lib → src/cborg/types}/json/json.d.ts +0 -0
- /package/{patched/cborg/types/lib → src/cborg/types/utils}/bl.d.ts +0 -0
- /package/{patched/cborg/types/lib → src/cborg/types/utils}/byte-utils.d.ts +0 -0
- /package/{patched/cborg/types/lib → src/cborg/types/utils}/token.d.ts +0 -0
- /package/{patched/cborg/lib → src/cborg/utils}/byte-utils.js +0 -0
- /package/{patched/cborg/lib → src/cborg/utils}/token.js +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,23 +1,21 @@
|
|
|
1
1
|
// never reference the file directly to ensure the
|
|
2
2
|
// indepency of the json module
|
|
3
|
-
import { Type } from "@fireproof/vendor/cborg"
|
|
4
3
|
import { encodeCustom } from "@fireproof/vendor/cborg"
|
|
5
|
-
import {
|
|
6
|
-
import { asU8A, fromString } from "@fireproof/vendor/cborg"
|
|
4
|
+
import { Type, asU8A, fromString } from 'cborg/utils'
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
|
-
* @typedef {import('
|
|
10
|
-
* @typedef {import('
|
|
11
|
-
* @typedef {import('
|
|
12
|
-
* @typedef {import('
|
|
7
|
+
* @typedef {import('../interface').EncodeOptions} EncodeOptions
|
|
8
|
+
* @typedef {import('../interface').TokenTypeEncoder} TokenTypeEncoder
|
|
9
|
+
* @typedef {import('cborg/utils').Token} Token
|
|
10
|
+
* @typedef {import('cborg/utils').Bl} Bl
|
|
13
11
|
*/
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
|
-
* @param {(buf: Bl, token: Token) => void} action
|
|
14
|
+
* @param {(buf: Bl, token: Token, opt: EncodeOptions) => void} action
|
|
17
15
|
* @returns {TokenTypeEncoder}
|
|
18
16
|
*/
|
|
19
17
|
function wrapCompareTokens (action) {
|
|
20
|
-
const wrapped = (/** @type {Bl} */ buf, /** @type {Token} */token) => action(buf, token)
|
|
18
|
+
const wrapped = (/** @type {Bl} */ buf, /** @type {Token} */token, /** @type {EncodeOptions} */opt) => action(buf, token, opt)
|
|
21
19
|
/**
|
|
22
20
|
* @param {Token} tok1
|
|
23
21
|
* @param {Token} tok2
|
|
@@ -32,7 +30,7 @@ function wrapCompareTokens (action) {
|
|
|
32
30
|
/**
|
|
33
31
|
* @returns {TokenTypeEncoder[]}
|
|
34
32
|
*/
|
|
35
|
-
function makeJSONEncoders() {
|
|
33
|
+
function makeJSONEncoders () {
|
|
36
34
|
/** @type {TokenTypeEncoder[]} */
|
|
37
35
|
const encoders = []
|
|
38
36
|
/** @type {{type:Type,elements:number}[]} */
|
|
@@ -73,11 +71,11 @@ function makeJSONEncoders() {
|
|
|
73
71
|
buf.push(isa)
|
|
74
72
|
})
|
|
75
73
|
|
|
76
|
-
encoders[Type.negint.major] = wrapCompareTokens((buf, token) => {
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
encoders[Type.negint.major] = wrapCompareTokens((buf, token, opt) => {
|
|
75
|
+
encoders[Type.uint.major](buf, token, opt)
|
|
76
|
+
})
|
|
79
77
|
|
|
80
|
-
encoders[Type.bytes.major] = wrapCompareTokens((_buf, _token) => {
|
|
78
|
+
encoders[Type.bytes.major] = wrapCompareTokens((_buf, _token, { encodeErrPrefix }) => {
|
|
81
79
|
throw new Error(`${encodeErrPrefix} unsupported type: Uint8Array`)
|
|
82
80
|
})
|
|
83
81
|
|
|
@@ -102,7 +100,7 @@ function makeJSONEncoders() {
|
|
|
102
100
|
encoders[Type.tag.major] = wrapCompareTokens((_buf, _token) => {
|
|
103
101
|
})
|
|
104
102
|
|
|
105
|
-
encoders[Type.float.major] = wrapCompareTokens((buf, token) => {
|
|
103
|
+
encoders[Type.float.major] = wrapCompareTokens((buf, token, { encodeErrPrefix }) => {
|
|
106
104
|
if (token.type.equals(Type.break)) {
|
|
107
105
|
const recurs = inRecursive.pop()
|
|
108
106
|
if (recurs) {
|
|
@@ -260,6 +258,7 @@ function makeJSONEncoders() {
|
|
|
260
258
|
// }
|
|
261
259
|
// }
|
|
262
260
|
|
|
261
|
+
const encodeErrPrefix = 'JSON encode error:'
|
|
263
262
|
/**
|
|
264
263
|
* @param {(Token|Token[])[]} e1
|
|
265
264
|
* @param {(Token|Token[])[]} e2
|
|
@@ -284,7 +283,11 @@ function mapSorter (e1, e2) {
|
|
|
284
283
|
throw new Error(`${encodeErrPrefix} unexpected duplicate map keys, this is not supported`)
|
|
285
284
|
}
|
|
286
285
|
|
|
287
|
-
const defaultEncodeOptions = {
|
|
286
|
+
const defaultEncodeOptions = {
|
|
287
|
+
addBreakTokens: true,
|
|
288
|
+
encodeErrPrefix,
|
|
289
|
+
mapSorter
|
|
290
|
+
}
|
|
288
291
|
|
|
289
292
|
/**
|
|
290
293
|
* @param {any} data
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "cborg",
|
|
3
3
|
"version": "4.2.7",
|
|
4
4
|
"description": "Fast CBOR with a focus on strictness",
|
|
5
|
-
"main": "cborg.js",
|
|
5
|
+
"main": "cborg/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"cborg": "
|
|
8
|
+
"cborg": "cborg/bin.js"
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -38,33 +38,37 @@
|
|
|
38
38
|
},
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|
|
41
|
-
"import": "./cborg.js",
|
|
42
|
-
"types": "./types/cborg.d.ts"
|
|
41
|
+
"import": "./cborg/index.js",
|
|
42
|
+
"types": "./types/cborg/index.d.ts"
|
|
43
43
|
},
|
|
44
44
|
"./length": {
|
|
45
|
-
"import": "./
|
|
46
|
-
"types": "./types/
|
|
45
|
+
"import": "./cborg/length.js",
|
|
46
|
+
"types": "./types/cborg/length.d.ts"
|
|
47
47
|
},
|
|
48
48
|
"./taglib": {
|
|
49
49
|
"import": "./taglib.js",
|
|
50
50
|
"types": "./types/taglib.d.ts"
|
|
51
51
|
},
|
|
52
52
|
"./json": {
|
|
53
|
-
"import": "./
|
|
54
|
-
"types": "./types/
|
|
53
|
+
"import": "./json/json.js",
|
|
54
|
+
"types": "./types/json/json.d.ts"
|
|
55
55
|
},
|
|
56
56
|
"./interface": {
|
|
57
57
|
"types": "./types/interface.d.ts"
|
|
58
|
+
},
|
|
59
|
+
"./utils": {
|
|
60
|
+
"import": "./utils/index.js",
|
|
61
|
+
"types": "./types/utils/index.d.ts"
|
|
58
62
|
}
|
|
59
63
|
},
|
|
60
64
|
"types": "cborg.d.ts",
|
|
61
65
|
"typesVersions": {
|
|
62
66
|
"*": {
|
|
63
67
|
"json": [
|
|
64
|
-
"types/
|
|
68
|
+
"types/json/json.d.ts"
|
|
65
69
|
],
|
|
66
70
|
"length": [
|
|
67
|
-
"types/
|
|
71
|
+
"types/cborg/length.d.ts"
|
|
68
72
|
],
|
|
69
73
|
"*": [
|
|
70
74
|
"types/*"
|
|
@@ -156,7 +160,7 @@
|
|
|
156
160
|
]
|
|
157
161
|
},
|
|
158
162
|
"scripts": {
|
|
159
|
-
"lint": "standard *.js
|
|
163
|
+
"lint": "standard *.js cborg/*.js json/*.js utils/*.js test/*.js",
|
|
160
164
|
"build": "npm run build:types",
|
|
161
165
|
"build:types": "tsc --build",
|
|
162
166
|
"test:node": "c8 --check-coverage --exclude=test/** mocha test/test-*.js",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
6
|
-
import { fromHex, toHex } from '
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { fromHex, toHex } from 'cborg/utils'
|
|
7
7
|
|
|
8
8
|
const { assert } = chai
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
6
|
-
import { fromHex, toHex } from '
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { fromHex, toHex } from 'cborg/utils'
|
|
7
7
|
|
|
8
8
|
const { assert } = chai
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
6
|
-
import { useBuffer, fromHex, toHex } from '
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { useBuffer, fromHex, toHex } from 'cborg/utils'
|
|
7
7
|
|
|
8
8
|
const { assert } = chai
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
6
|
-
import { fromHex, toHex } from '
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { fromHex, toHex } from 'cborg/utils'
|
|
7
7
|
|
|
8
8
|
const { assert } = chai
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
6
|
-
import { fromHex, toHex } from '
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { fromHex, toHex } from 'cborg/utils'
|
|
7
7
|
|
|
8
8
|
const { assert } = chai
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
6
|
-
import { fromHex, toHex } from '
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { fromHex, toHex } from 'cborg/utils'
|
|
7
7
|
|
|
8
8
|
const { assert } = chai
|
|
9
9
|
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { fromHex, toHex } from '../lib/byte-utils.js'
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { fromHex, toHex, Token, Type } from 'cborg/utils'
|
|
8
7
|
import { dateDecoder, dateEncoder } from './common.js'
|
|
9
8
|
|
|
10
9
|
const { assert } = chai
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
6
|
-
import { fromHex, toHex } from '
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
|
+
import { fromHex, toHex } from 'cborg/utils'
|
|
7
7
|
|
|
8
8
|
const { assert } = chai
|
|
9
9
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
|
|
5
|
-
import { decode, encode } from
|
|
5
|
+
import { decode, encode } from "@fireproof/vendor/cborg"
|
|
6
6
|
import * as taglib from "@fireproof/vendor/cborg/taglib"
|
|
7
|
-
import { fromHex, toHex } from '
|
|
7
|
+
import { fromHex, toHex } from 'cborg/utils'
|
|
8
8
|
// fixtures from https://github.com/cbor/test-vectors
|
|
9
9
|
import { fixtures } from './appendix_a.js'
|
|
10
10
|
|
|
@@ -154,39 +154,39 @@ describe('json basics', () => {
|
|
|
154
154
|
})
|
|
155
155
|
|
|
156
156
|
it('should throw on bad types', () => {
|
|
157
|
-
assert.throws(() => encode(new Uint8Array([1, 2])), /
|
|
158
|
-
assert.throws(() => encode({ boop: new Uint8Array([1, 2]) }), /
|
|
159
|
-
assert.throws(() => encode(undefined), /
|
|
160
|
-
assert.throws(() => encode(new Map([[1, 2], [2, 3]])), /
|
|
161
|
-
assert.throws(() => encode(new Map([[['foo', 'bar'], 2], [['bar', 'foo'], 3]])), /
|
|
157
|
+
assert.throws(() => encode(new Uint8Array([1, 2])), /JSON encode error: unsupported type: Uint8Array/)
|
|
158
|
+
assert.throws(() => encode({ boop: new Uint8Array([1, 2]) }), /JSON encode error: unsupported type: Uint8Array/)
|
|
159
|
+
assert.throws(() => encode(undefined), /JSON encode error: unsupported type: undefined/)
|
|
160
|
+
assert.throws(() => encode(new Map([[1, 2], [2, 3]])), /JSON encode error: non-string map keys are not supported/)
|
|
161
|
+
assert.throws(() => encode(new Map([[['foo', 'bar'], 2], [['bar', 'foo'], 3]])), /JSON encode error: complex map keys are not supported/)
|
|
162
162
|
})
|
|
163
163
|
|
|
164
164
|
it('should throw on bad decode failure modes', () => {
|
|
165
|
-
assert.throws(() => decode(toBytes('{"a":1 & "b":2}')), '
|
|
166
|
-
assert.throws(() => decode(toBytes('{"a":1,"b"!2}')), '
|
|
167
|
-
assert.throws(() => decode(toBytes('[1,2&3]')), '
|
|
168
|
-
assert.throws(() => decode(toBytes('{"a":!}')), '
|
|
169
|
-
assert.throws(() => decode(toBytes('"abc')), '
|
|
170
|
-
assert.throws(() => decode(toBytes('"ab\\xc"')), '
|
|
171
|
-
assert.throws(() => decode(toBytes('"ab\x1Ec"')), '
|
|
172
|
-
assert.throws(() => decode(toBytes('"ab\\')), '
|
|
165
|
+
assert.throws(() => decode(toBytes('{"a":1 & "b":2}')), 'JSON decode error: unexpected character at position 7, was expecting object delimiter but found \'&\'')
|
|
166
|
+
assert.throws(() => decode(toBytes('{"a":1,"b"!2}')), 'JSON decode error: unexpected character at position 10, was expecting key/value delimiter \':\' but found \'!\'')
|
|
167
|
+
assert.throws(() => decode(toBytes('[1,2&3]')), 'JSON decode error: unexpected character at position 4, was expecting array delimiter but found \'&\'')
|
|
168
|
+
assert.throws(() => decode(toBytes('{"a":!}')), 'JSON decode error: unexpected character at position 5')
|
|
169
|
+
assert.throws(() => decode(toBytes('"abc')), 'JSON decode error: unexpected end of string at position 4')
|
|
170
|
+
assert.throws(() => decode(toBytes('"ab\\xc"')), 'JSON decode error: unexpected string escape character at position 5')
|
|
171
|
+
assert.throws(() => decode(toBytes('"ab\x1Ec"')), 'JSON decode error: invalid control character at position 3')
|
|
172
|
+
assert.throws(() => decode(toBytes('"ab\\')), 'JSON decode error: unexpected string termination at position 4')
|
|
173
173
|
// begining of a quoted string with 3-byte unicode sequence with the last one truncated
|
|
174
|
-
assert.throws(() => decode(toBytes('"☺').subarray(0, 3)), '
|
|
175
|
-
assert.throws(() => decode(toBytes('"\\uxyza"')), '
|
|
176
|
-
assert.throws(() => decode(toBytes('"\\u11"')), '
|
|
177
|
-
assert.throws(() => decode(toBytes('-boop')), '
|
|
178
|
-
assert.throws(() => decode(toBytes('{"v":nope}')), '
|
|
179
|
-
assert.throws(() => decode(toBytes('[n]')), '
|
|
180
|
-
assert.throws(() => decode(toBytes('{"v":truu}')), '
|
|
181
|
-
assert.throws(() => decode(toBytes('[tr]')), '
|
|
182
|
-
assert.throws(() => decode(toBytes('{"v":flase}')), '
|
|
183
|
-
assert.throws(() => decode(toBytes('[fa]')), '
|
|
184
|
-
assert.throws(() => decode(toBytes('-0..1')), '
|
|
174
|
+
assert.throws(() => decode(toBytes('"☺').subarray(0, 3)), 'JSON decode error: unexpected unicode sequence at position 1')
|
|
175
|
+
assert.throws(() => decode(toBytes('"\\uxyza"')), 'JSON decode error: unexpected unicode escape character at position 3')
|
|
176
|
+
assert.throws(() => decode(toBytes('"\\u11"')), 'JSON decode error: unexpected end of unicode escape sequence at position 3')
|
|
177
|
+
assert.throws(() => decode(toBytes('-boop')), 'JSON decode error: unexpected token at position 1')
|
|
178
|
+
assert.throws(() => decode(toBytes('{"v":nope}')), 'JSON decode error: unexpected token at position 7, expected to find \'null\'')
|
|
179
|
+
assert.throws(() => decode(toBytes('[n]')), 'JSON decode error: unexpected end of input at position 1')
|
|
180
|
+
assert.throws(() => decode(toBytes('{"v":truu}')), 'JSON decode error: unexpected token at position 9, expected to find \'true\'')
|
|
181
|
+
assert.throws(() => decode(toBytes('[tr]')), 'JSON decode error: unexpected end of input at position 1')
|
|
182
|
+
assert.throws(() => decode(toBytes('{"v":flase}')), 'JSON decode error: unexpected token at position 7, expected to find \'false\'')
|
|
183
|
+
assert.throws(() => decode(toBytes('[fa]')), 'JSON decode error: unexpected end of input at position 1')
|
|
184
|
+
assert.throws(() => decode(toBytes('-0..1')), 'JSON decode error: unexpected token at position 3')
|
|
185
185
|
})
|
|
186
186
|
|
|
187
187
|
it('should throw when rejectDuplicateMapKeys enabled on duplicate keys', () => {
|
|
188
188
|
assert.deepStrictEqual(decode(toBytes('{"foo":1,"foo":2}')), { foo: 2 })
|
|
189
|
-
assert.throws(() => decode(toBytes('{"foo":1,"foo":2}'), { rejectDuplicateMapKeys: true }), /
|
|
189
|
+
assert.throws(() => decode(toBytes('{"foo":1,"foo":2}'), { rejectDuplicateMapKeys: true }), /JSON decode error: found repeat map key "foo"/)
|
|
190
190
|
})
|
|
191
191
|
|
|
192
192
|
it('decodeFirst', () => {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
import { garbage } from 'ipld-garbage'
|
|
5
|
-
import { uintBoundaries } from '
|
|
6
|
-
import { encode } from
|
|
7
|
-
import { encodedLength } from
|
|
5
|
+
import { uintBoundaries } from 'cborg/utils'
|
|
6
|
+
import { encode } from "@fireproof/vendor/cborg"
|
|
7
|
+
import { encodedLength } from "@fireproof/vendor/cborg/length"
|
|
8
8
|
import { dateEncoder } from './common.js'
|
|
9
9
|
|
|
10
10
|
const { assert } = chai
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as chai from 'chai'
|
|
4
4
|
import { garbage } from 'ipld-garbage'
|
|
5
|
-
import { uintBoundaries } from '
|
|
6
|
-
import { encode, decodeFirst } from
|
|
5
|
+
import { uintBoundaries } from 'cborg/utils'
|
|
6
|
+
import { encode, decodeFirst } from "@fireproof/vendor/cborg"
|
|
7
7
|
import { dateDecoder, dateEncoder } from './common.js'
|
|
8
8
|
|
|
9
9
|
const { assert } = chai
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
"emitDeclarationOnly": true,
|
|
29
29
|
"paths": {
|
|
30
30
|
"cborg": [
|
|
31
|
-
"cborg.js"
|
|
31
|
+
"cborg/index.js"
|
|
32
|
+
],
|
|
33
|
+
"cborg/utils": [
|
|
34
|
+
"./utils/index.js"
|
|
32
35
|
]
|
|
33
36
|
}
|
|
34
37
|
},
|
|
@@ -37,7 +40,7 @@
|
|
|
37
40
|
"example.js",
|
|
38
41
|
"taglib.js",
|
|
39
42
|
"lib/"
|
|
40
|
-
],
|
|
43
|
+
, "utils/byte-utils.js", "utils/jump.js", "utils/0uint.js", "utils/1negint.js", "utils/2bytes.js", "utils/3string.js", "utils/4array.js", "utils/5map.js", "utils/6tag.js", "utils/7float.js", "json" ],
|
|
41
44
|
"exclude": [
|
|
42
45
|
"node_modules"
|
|
43
46
|
],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export type Token = import("
|
|
1
|
+
export type Token = import("cborg/utils").Token;
|
|
2
2
|
export type DecodeOptions = import("../interface").DecodeOptions;
|
|
3
3
|
export type DecodeTokenizer = import("../interface").DecodeTokenizer;
|
|
4
|
+
export type DecodeFunction = import("../interface").DecodeFunction;
|
|
4
5
|
/**
|
|
5
6
|
* @implements {DecodeTokenizer}
|
|
6
7
|
*/
|
|
@@ -9,13 +10,14 @@ export class Tokeniser implements DecodeTokenizer {
|
|
|
9
10
|
* @param {Uint8Array} data
|
|
10
11
|
* @param {DecodeOptions} options
|
|
11
12
|
*/
|
|
12
|
-
constructor(data: Uint8Array, options
|
|
13
|
+
constructor(data: Uint8Array, options: DecodeOptions);
|
|
13
14
|
_pos: number;
|
|
14
15
|
data: Uint8Array<ArrayBufferLike>;
|
|
15
16
|
options: import("../interface").DecodeOptions;
|
|
17
|
+
jump: import("../interface").DecodeFunction[];
|
|
16
18
|
pos(): number;
|
|
17
19
|
done(): boolean;
|
|
18
|
-
next(): import("
|
|
20
|
+
next(): import("cborg/utils").Token;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* @param {DecodeTokenizer} tokeniser
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../cborg/decode.js"],"names":[],"mappings":"oBAGa,OAAO,aAAa,EAAE,KAAK;4BAC3B,OAAO,cAAc,EAAE,aAAa;8BACpC,OAAO,cAAc,EAAE,eAAe;6BACtC,OAAO,cAAc,EAAE,cAAc;AAWlD;;GAEG;AACH,kCAFgB,eAAe;IAG7B;;;OAGG;IACH,kBAHW,UAAU,WACV,aAAa,EAOvB;IAJC,aAAa;IACb,kCAAgB;IAChB,8CAAsB;IACtB,8CAAyC;IAG3C,cAEC;IAED,gBAEC;IAED,oCAgBC;CACF;AA6ED;;;;GAIG;AACH,0CAJW,eAAe,WACf,aAAa,GACX,GAAG,6BAAW,CAoC1B;AAuBD;;;;GAIG;AACH,6BAJW,UAAU,YACV,aAAa,GACX,GAAG,CASf;AAjCD;;;;GAIG;AACH,kCAJW,UAAU,YACV,aAAa,GACX,CAAC,GAAG,EAAE,UAAU,CAAC,CAgB7B;AAtID,mCAAiC;AADjC,kCAA+B"}
|
|
@@ -8,11 +8,11 @@ export type TokenTypeEncoder = import("../interface").TokenTypeEncoder;
|
|
|
8
8
|
export type TokenOrNestedTokens = import("../interface").TokenOrNestedTokens;
|
|
9
9
|
/**
|
|
10
10
|
* @param {any} obj
|
|
11
|
-
* @param {EncodeOptions}
|
|
11
|
+
* @param {EncodeOptions} options
|
|
12
12
|
* @param {Reference} [refStack]
|
|
13
13
|
* @returns {TokenOrNestedTokens}
|
|
14
14
|
*/
|
|
15
|
-
export function objectToTokens(obj: any, options
|
|
15
|
+
export function objectToTokens(obj: any, options: EncodeOptions, refStack?: Reference): TokenOrNestedTokens;
|
|
16
16
|
/**
|
|
17
17
|
* @param {any} data
|
|
18
18
|
* @param {EncodeOptions} [options]
|
|
@@ -31,9 +31,10 @@ export class Ref implements Reference {
|
|
|
31
31
|
/**
|
|
32
32
|
* @param {Reference|undefined} stack
|
|
33
33
|
* @param {object|any[]} obj
|
|
34
|
+
* @param {EncodeOptions} options
|
|
34
35
|
* @returns {Reference}
|
|
35
36
|
*/
|
|
36
|
-
static createCheck(stack: Reference | undefined, obj: object | any[]): Reference;
|
|
37
|
+
static createCheck(stack: Reference | undefined, obj: object | any[], { encodeErrPrefix }: EncodeOptions): Reference;
|
|
37
38
|
/**
|
|
38
39
|
* @param {object|any[]} obj
|
|
39
40
|
* @param {Reference|undefined} parent
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../cborg/encode.js"],"names":[],"mappings":"AAiCA,oCAAoC;AACpC,oCADc,gBAAgB,EAAE,CAY/B;4BA7BY,OAAO,cAAc,EAAE,aAAa;kCACpC,OAAO,cAAc,EAAE,mBAAmB;wBAC1C,OAAO,cAAc,EAAE,SAAS;gCAChC,OAAO,cAAc,EAAE,iBAAiB;+BACxC,OAAO,cAAc,EAAE,gBAAgB;kCACvC,OAAO,cAAc,EAAE,mBAAmB;AAmQvD;;;;;GAKG;AACH,oCALW,GAAG,WACH,aAAa,aACb,SAAS,GACP,mBAAmB,CAgB/B;AA2JD;;;;GAIG;AACH,6BAJW,GAAG,YACH,aAAa,GACX,UAAU,CAKtB;AAvCD;;;;;GAKG;AACH,mCALW,GAAG,YACH,gBAAgB,EAAE,WAClB,aAAa,GACX,UAAU,CAyBtB;AAlZD,8BAA8B;AAC9B,4BADiB,SAAS;IA0BxB;;;;;OAKG;IACH,0BALW,SAAS,GAAC,SAAS,OACnB,MAAM,GAAC,GAAG,EAAE,uBACZ,aAAa,GACX,SAAS,CAOrB;IAnCD;;;OAGG;IACH,iBAHW,MAAM,GAAC,GAAG,EAAE,UACZ,SAAS,GAAC,SAAS,EAK7B;IAFC,oBAAc;IACd,qDAAoB;IAGtB;;;OAGG;IACH,cAHW,MAAM,GAAC,GAAG,EAAE,GACV,OAAO,CAWnB;CAcF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { encodeCustom } from "./encode.js";
|
|
2
|
+
/**
|
|
3
|
+
* There was originally just `TypeEncoder` so don't break types by renaming or not exporting
|
|
4
|
+
*/
|
|
5
|
+
export type TagDecoder = import("../interface").TagDecoder;
|
|
6
|
+
/**
|
|
7
|
+
* Export the types that were present in the original manual cborg.d.ts
|
|
8
|
+
*/
|
|
9
|
+
export type TypeEncoder = import("../interface").OptionalTypeEncoder;
|
|
10
|
+
/**
|
|
11
|
+
* Export the types that were present in the original manual cborg.d.ts
|
|
12
|
+
*/
|
|
13
|
+
export type DecodeOptions = import("../interface").DecodeOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Export the types that were present in the original manual cborg.d.ts
|
|
16
|
+
*/
|
|
17
|
+
export type EncodeOptions = import("../interface").EncodeOptions;
|
|
18
|
+
import { decode } from './decode.js';
|
|
19
|
+
import { decodeFirst } from './decode.js';
|
|
20
|
+
import { Tokeniser } from './decode.js';
|
|
21
|
+
import { tokensToObject } from './decode.js';
|
|
22
|
+
import { encode } from './encode.js';
|
|
23
|
+
import { Token } from 'cborg/utils';
|
|
24
|
+
import { Type } from 'cborg/utils';
|
|
25
|
+
export { decode, decodeFirst, Tokeniser as Tokenizer, tokensToObject, encode, Token, Type };
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../cborg/index.js"],"names":[],"mappings":";;;;yBAaa,OAAO,cAAc,EAAE,UAAU;;;;0BAEjC,OAAO,cAAc,EAAE,mBAAmB;;;;4BAC1C,OAAO,cAAc,EAAE,aAAa;;;;4BACpC,OAAO,cAAc,EAAE,aAAa;uBAhBc,aAAa;4BAAb,aAAa;0BAAb,aAAa;+BAAb,aAAa;uBADrD,aAAa;sBAER,aAAa;qBAAb,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../cborg/is.js"],"names":[],"mappings":"AAiDA;;;GAGG;AACH,0BAHW,GAAG,GACD,MAAM,CAiClB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Token } from '
|
|
2
|
-
import { Bl } from './lib/bl';
|
|
1
|
+
import type { Token, Bl } from 'cborg/utils';
|
|
3
2
|
export type TokenOrNestedTokens = Token | Token[] | TokenOrNestedTokens[];
|
|
4
3
|
export interface Reference {
|
|
5
4
|
parent: Reference | undefined;
|
|
@@ -9,10 +8,11 @@ export interface Reference {
|
|
|
9
8
|
export type OptionalTypeEncoder = (data: any, typ: string, options: EncodeOptions, refStack?: Reference) => TokenOrNestedTokens | null;
|
|
10
9
|
export type StrictTypeEncoder = (data: any, typ: string, options: EncodeOptions, refStack?: Reference) => TokenOrNestedTokens;
|
|
11
10
|
export type TokenTypeEncoder = {
|
|
12
|
-
(buf: Bl, token: Token, options
|
|
11
|
+
(buf: Bl, token: Token, options: EncodeOptions): void;
|
|
13
12
|
compareTokens(t1: Token, t2: Token): number;
|
|
14
|
-
encodedSize?(token: Token, options
|
|
13
|
+
encodedSize?(token: Token, options: EncodeOptions): number;
|
|
15
14
|
};
|
|
15
|
+
export type DecodeFunction = (data: Uint8Array, pos: number, minor: number, options: DecodeOptions) => any;
|
|
16
16
|
export type MapSorter = (e1: (Token | Token[])[], e2: (Token | Token[])[]) => number;
|
|
17
17
|
export type QuickEncodeToken = (token: Token) => Uint8Array | undefined;
|
|
18
18
|
export interface DecodeTokenizer {
|
|
@@ -34,6 +34,7 @@ export interface DecodeOptions {
|
|
|
34
34
|
retainStringBytes?: boolean;
|
|
35
35
|
tags?: TagDecoder[];
|
|
36
36
|
tokenizer?: DecodeTokenizer;
|
|
37
|
+
decodeErrPrefix: string;
|
|
37
38
|
}
|
|
38
39
|
export interface EncodeOptions {
|
|
39
40
|
float64?: boolean;
|
|
@@ -43,5 +44,6 @@ export interface EncodeOptions {
|
|
|
43
44
|
typeEncoders?: {
|
|
44
45
|
[typeName: string]: OptionalTypeEncoder;
|
|
45
46
|
};
|
|
47
|
+
encodeErrPrefix: string;
|
|
46
48
|
}
|
|
47
49
|
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,KAAK,EAAE,GAAG,mBAAmB,EAAE,CAAA;AAEzE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAA;IAC7B,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,CAAA;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAA;CACvC;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,SAAS,KAAK,mBAAmB,GAAG,IAAI,CAAA;AAEtI,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,SAAS,KAAK,mBAAmB,CAAA;AAE7H,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IACtD,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,MAAM,CAAC;IAE5C,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC;CAC5D,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAC,UAAU,EAAE,GAAG,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,OAAO,EAAC,aAAa,KAAK,GAAG,CAAA;AAEtG,MAAM,MAAM,SAAS,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,MAAM,CAAA;AAEpF,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,UAAU,GAAG,SAAS,CAAA;AAEvE,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,OAAO,CAAC;IAChB,IAAI,IAAI,KAAK,CAAC;IACd,GAAG,IAAI,MAAM,CAAC;CACf;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;AAE5C,MAAM,WAAW,aAAa;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;KAAE,CAAA;IAC1D,eAAe,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type DecodeOptions = import("
|
|
2
|
-
export type DecodeTokenizer = import("
|
|
1
|
+
export type DecodeOptions = import("../interface").DecodeOptions;
|
|
2
|
+
export type DecodeTokenizer = import("../interface").DecodeTokenizer;
|
|
3
3
|
/**
|
|
4
4
|
* @param {Uint8Array} data
|
|
5
5
|
* @param {DecodeOptions} [options]
|
|
@@ -13,8 +13,8 @@ export function decode(data: Uint8Array, options?: DecodeOptions): any;
|
|
|
13
13
|
*/
|
|
14
14
|
export function decodeFirst(data: Uint8Array, options?: DecodeOptions): [any, Uint8Array];
|
|
15
15
|
/**
|
|
16
|
-
* @typedef {import('
|
|
17
|
-
* @typedef {import('
|
|
16
|
+
* @typedef {import('../interface').DecodeOptions} DecodeOptions
|
|
17
|
+
* @typedef {import('../interface').DecodeTokenizer} DecodeTokenizer
|
|
18
18
|
*/
|
|
19
19
|
/**
|
|
20
20
|
* @implements {DecodeTokenizer}
|
|
@@ -24,10 +24,10 @@ export class Tokenizer implements DecodeTokenizer {
|
|
|
24
24
|
* @param {Uint8Array} data
|
|
25
25
|
* @param {DecodeOptions} options
|
|
26
26
|
*/
|
|
27
|
-
constructor(data: Uint8Array, options
|
|
27
|
+
constructor(data: Uint8Array, options: DecodeOptions);
|
|
28
28
|
_pos: number;
|
|
29
29
|
data: Uint8Array<ArrayBufferLike>;
|
|
30
|
-
options: import("
|
|
30
|
+
options: import("../interface").DecodeOptions;
|
|
31
31
|
/** @type {string[]} */
|
|
32
32
|
modeStack: string[];
|
|
33
33
|
lastToken: string;
|
|
@@ -63,5 +63,5 @@ export class Tokenizer implements DecodeTokenizer {
|
|
|
63
63
|
*/
|
|
64
64
|
next(): Token;
|
|
65
65
|
}
|
|
66
|
-
import { Token } from 'cborg';
|
|
66
|
+
import { Token } from 'cborg/utils';
|
|
67
67
|
//# sourceMappingURL=decode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../json/decode.js"],"names":[],"mappings":"4BAMa,OAAO,cAAc,EAAE,aAAa;8BACpC,OAAO,cAAc,EAAE,eAAe;AAgbnD;;;;GAIG;AACH,6BAJW,UAAU,YACV,aAAa,GACX,GAAG,CAMf;AAED;;;;GAIG;AACH,kCAJW,UAAU,YACV,aAAa,GACX,CAAC,GAAG,EAAE,UAAU,CAAC,CAM7B;AAtcD;;;GAGG;AAEH;;GAEG;AACH,kCAFgB,eAAe;IAG7B;;;OAGG;IACH,kBAHW,UAAU,WACV,aAAa,EASvB;IANC,aAAa;IACb,kCAAgB;IAChB,8CAAsB;IACtB,uBAAuB;IACvB,WADW,MAAM,EAAE,CACO;IAC1B,kBAAmB;IAGrB,cAEC;IAED;;OAEG;IACH,QAFa,OAAO,CAInB;IAED;;OAEG;IACH,MAFa,MAAM,CAIlB;IAED;;OAEG;IACH,eAFa,MAAM,CAIlB;IAED,uBAMC;IAED;;OAEG;IACH,YAFW,MAAM,EAAE,QAWlB;IAED,qBA+DC;IAED;;OAEG;IACH,eAFa,KAAK,CAkLjB;IAED;;OAEG;IACH,cAFa,KAAK,CAuCjB;IAED;;OAEG;IACH,QAFa,KAAK,CAyEjB;CACF;sBAlbkD,aAAa"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type EncodeOptions = import("../interface").EncodeOptions;
|
|
2
|
+
export type TokenTypeEncoder = import("../interface").TokenTypeEncoder;
|
|
3
|
+
export type Token = import("cborg/utils").Token;
|
|
4
|
+
export type Bl = import("cborg/utils").Bl;
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} data
|
|
7
|
+
* @param {EncodeOptions} [options]
|
|
8
|
+
* @returns {Uint8Array}
|
|
9
|
+
*/
|
|
10
|
+
export function encode(data: any, options?: EncodeOptions): Uint8Array;
|
|
11
|
+
//# sourceMappingURL=encode.d.ts.map
|