create-leo-app 0.7.3 → 0.8.4
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/README.md +3 -3
- package/dist/index.mjs +38 -38
- package/package.json +5 -7
- package/template-extension/package.json +4 -4
- package/template-nextjs-ts/package.json +9 -9
- package/template-node/package.json +2 -2
- package/template-node-ts/package.json +5 -5
- package/template-offline-public-transaction-ts/package.json +5 -5
- package/template-react-leo/README.md +3 -8
- package/template-react-leo/package.json +23 -23
- package/template-react-leo/vite.config.js +2 -1
- package/template-react-managed-worker/README.md +1 -3
- package/template-react-managed-worker/package.json +22 -22
- package/template-react-managed-worker/vite.config.js +2 -1
- package/template-react-ts/README.md +3 -8
- package/template-react-ts/package.json +28 -28
- package/template-react-ts/vite.config.ts +2 -1
- package/template-vanilla/main.js +1 -1
- package/template-vanilla/package.json +3 -3
- package/template-vanilla/vite.config.js +3 -1
- package/template-nextjs-ts/node_modules/@types/node/LICENSE +0 -21
- package/template-nextjs-ts/node_modules/@types/node/README.md +0 -15
- package/template-nextjs-ts/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/template-nextjs-ts/node_modules/@types/node/assert.d.ts +0 -1040
- package/template-nextjs-ts/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/template-nextjs-ts/node_modules/@types/node/buffer.d.ts +0 -2301
- package/template-nextjs-ts/node_modules/@types/node/child_process.d.ts +0 -1544
- package/template-nextjs-ts/node_modules/@types/node/cluster.d.ts +0 -578
- package/template-nextjs-ts/node_modules/@types/node/console.d.ts +0 -452
- package/template-nextjs-ts/node_modules/@types/node/constants.d.ts +0 -19
- package/template-nextjs-ts/node_modules/@types/node/crypto.d.ts +0 -4524
- package/template-nextjs-ts/node_modules/@types/node/dgram.d.ts +0 -596
- package/template-nextjs-ts/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/template-nextjs-ts/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/template-nextjs-ts/node_modules/@types/node/dns.d.ts +0 -864
- package/template-nextjs-ts/node_modules/@types/node/dom-events.d.ts +0 -124
- package/template-nextjs-ts/node_modules/@types/node/domain.d.ts +0 -170
- package/template-nextjs-ts/node_modules/@types/node/events.d.ts +0 -931
- package/template-nextjs-ts/node_modules/@types/node/fs/promises.d.ts +0 -1245
- package/template-nextjs-ts/node_modules/@types/node/fs.d.ts +0 -4317
- package/template-nextjs-ts/node_modules/@types/node/globals.d.ts +0 -503
- package/template-nextjs-ts/node_modules/@types/node/globals.global.d.ts +0 -1
- package/template-nextjs-ts/node_modules/@types/node/http.d.ts +0 -1908
- package/template-nextjs-ts/node_modules/@types/node/http2.d.ts +0 -2418
- package/template-nextjs-ts/node_modules/@types/node/https.d.ts +0 -550
- package/template-nextjs-ts/node_modules/@types/node/index.d.ts +0 -89
- package/template-nextjs-ts/node_modules/@types/node/inspector.d.ts +0 -3696
- package/template-nextjs-ts/node_modules/@types/node/module.d.ts +0 -315
- package/template-nextjs-ts/node_modules/@types/node/net.d.ts +0 -999
- package/template-nextjs-ts/node_modules/@types/node/os.d.ts +0 -495
- package/template-nextjs-ts/node_modules/@types/node/package.json +0 -217
- package/template-nextjs-ts/node_modules/@types/node/path.d.ts +0 -191
- package/template-nextjs-ts/node_modules/@types/node/perf_hooks.d.ts +0 -934
- package/template-nextjs-ts/node_modules/@types/node/process.d.ts +0 -1879
- package/template-nextjs-ts/node_modules/@types/node/punycode.d.ts +0 -117
- package/template-nextjs-ts/node_modules/@types/node/querystring.d.ts +0 -153
- package/template-nextjs-ts/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/template-nextjs-ts/node_modules/@types/node/readline.d.ts +0 -540
- package/template-nextjs-ts/node_modules/@types/node/repl.d.ts +0 -430
- package/template-nextjs-ts/node_modules/@types/node/sea.d.ts +0 -153
- package/template-nextjs-ts/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/template-nextjs-ts/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/template-nextjs-ts/node_modules/@types/node/stream/web.d.ts +0 -521
- package/template-nextjs-ts/node_modules/@types/node/stream.d.ts +0 -1707
- package/template-nextjs-ts/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/template-nextjs-ts/node_modules/@types/node/test.d.ts +0 -1874
- package/template-nextjs-ts/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/template-nextjs-ts/node_modules/@types/node/timers.d.ts +0 -240
- package/template-nextjs-ts/node_modules/@types/node/tls.d.ts +0 -1217
- package/template-nextjs-ts/node_modules/@types/node/trace_events.d.ts +0 -197
- package/template-nextjs-ts/node_modules/@types/node/tty.d.ts +0 -208
- package/template-nextjs-ts/node_modules/@types/node/url.d.ts +0 -952
- package/template-nextjs-ts/node_modules/@types/node/util.d.ts +0 -2298
- package/template-nextjs-ts/node_modules/@types/node/v8.d.ts +0 -808
- package/template-nextjs-ts/node_modules/@types/node/vm.d.ts +0 -924
- package/template-nextjs-ts/node_modules/@types/node/wasi.d.ts +0 -181
- package/template-nextjs-ts/node_modules/@types/node/worker_threads.d.ts +0 -694
- package/template-nextjs-ts/node_modules/@types/node/zlib.d.ts +0 -539
- package/template-react-ts/node_modules/@types/node/LICENSE +0 -21
- package/template-react-ts/node_modules/@types/node/README.md +0 -15
- package/template-react-ts/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/template-react-ts/node_modules/@types/node/assert.d.ts +0 -1040
- package/template-react-ts/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/template-react-ts/node_modules/@types/node/buffer.d.ts +0 -2301
- package/template-react-ts/node_modules/@types/node/child_process.d.ts +0 -1544
- package/template-react-ts/node_modules/@types/node/cluster.d.ts +0 -578
- package/template-react-ts/node_modules/@types/node/console.d.ts +0 -452
- package/template-react-ts/node_modules/@types/node/constants.d.ts +0 -19
- package/template-react-ts/node_modules/@types/node/crypto.d.ts +0 -4524
- package/template-react-ts/node_modules/@types/node/dgram.d.ts +0 -596
- package/template-react-ts/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/template-react-ts/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/template-react-ts/node_modules/@types/node/dns.d.ts +0 -864
- package/template-react-ts/node_modules/@types/node/dom-events.d.ts +0 -124
- package/template-react-ts/node_modules/@types/node/domain.d.ts +0 -170
- package/template-react-ts/node_modules/@types/node/events.d.ts +0 -931
- package/template-react-ts/node_modules/@types/node/fs/promises.d.ts +0 -1245
- package/template-react-ts/node_modules/@types/node/fs.d.ts +0 -4317
- package/template-react-ts/node_modules/@types/node/globals.d.ts +0 -503
- package/template-react-ts/node_modules/@types/node/globals.global.d.ts +0 -1
- package/template-react-ts/node_modules/@types/node/http.d.ts +0 -1908
- package/template-react-ts/node_modules/@types/node/http2.d.ts +0 -2418
- package/template-react-ts/node_modules/@types/node/https.d.ts +0 -550
- package/template-react-ts/node_modules/@types/node/index.d.ts +0 -89
- package/template-react-ts/node_modules/@types/node/inspector.d.ts +0 -3696
- package/template-react-ts/node_modules/@types/node/module.d.ts +0 -315
- package/template-react-ts/node_modules/@types/node/net.d.ts +0 -999
- package/template-react-ts/node_modules/@types/node/os.d.ts +0 -495
- package/template-react-ts/node_modules/@types/node/package.json +0 -217
- package/template-react-ts/node_modules/@types/node/path.d.ts +0 -191
- package/template-react-ts/node_modules/@types/node/perf_hooks.d.ts +0 -934
- package/template-react-ts/node_modules/@types/node/process.d.ts +0 -1879
- package/template-react-ts/node_modules/@types/node/punycode.d.ts +0 -117
- package/template-react-ts/node_modules/@types/node/querystring.d.ts +0 -153
- package/template-react-ts/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/template-react-ts/node_modules/@types/node/readline.d.ts +0 -540
- package/template-react-ts/node_modules/@types/node/repl.d.ts +0 -430
- package/template-react-ts/node_modules/@types/node/sea.d.ts +0 -153
- package/template-react-ts/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/template-react-ts/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/template-react-ts/node_modules/@types/node/stream/web.d.ts +0 -521
- package/template-react-ts/node_modules/@types/node/stream.d.ts +0 -1707
- package/template-react-ts/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/template-react-ts/node_modules/@types/node/test.d.ts +0 -1874
- package/template-react-ts/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/template-react-ts/node_modules/@types/node/timers.d.ts +0 -240
- package/template-react-ts/node_modules/@types/node/tls.d.ts +0 -1217
- package/template-react-ts/node_modules/@types/node/trace_events.d.ts +0 -197
- package/template-react-ts/node_modules/@types/node/tty.d.ts +0 -208
- package/template-react-ts/node_modules/@types/node/url.d.ts +0 -952
- package/template-react-ts/node_modules/@types/node/util.d.ts +0 -2298
- package/template-react-ts/node_modules/@types/node/v8.d.ts +0 -808
- package/template-react-ts/node_modules/@types/node/vm.d.ts +0 -924
- package/template-react-ts/node_modules/@types/node/wasi.d.ts +0 -181
- package/template-react-ts/node_modules/@types/node/worker_threads.d.ts +0 -694
- package/template-react-ts/node_modules/@types/node/zlib.d.ts +0 -539
- package/template-react-ts/node_modules/diff/CONTRIBUTING.md +0 -39
- package/template-react-ts/node_modules/diff/LICENSE +0 -31
- package/template-react-ts/node_modules/diff/README.md +0 -207
- package/template-react-ts/node_modules/diff/dist/diff.js +0 -1585
- package/template-react-ts/node_modules/diff/dist/diff.min.js +0 -38
- package/template-react-ts/node_modules/diff/lib/convert/dmp.js +0 -32
- package/template-react-ts/node_modules/diff/lib/convert/xml.js +0 -42
- package/template-react-ts/node_modules/diff/lib/diff/array.js +0 -45
- package/template-react-ts/node_modules/diff/lib/diff/base.js +0 -304
- package/template-react-ts/node_modules/diff/lib/diff/character.js +0 -37
- package/template-react-ts/node_modules/diff/lib/diff/css.js +0 -41
- package/template-react-ts/node_modules/diff/lib/diff/json.js +0 -163
- package/template-react-ts/node_modules/diff/lib/diff/line.js +0 -89
- package/template-react-ts/node_modules/diff/lib/diff/sentence.js +0 -41
- package/template-react-ts/node_modules/diff/lib/diff/word.js +0 -107
- package/template-react-ts/node_modules/diff/lib/index.es6.js +0 -1519
- package/template-react-ts/node_modules/diff/lib/index.js +0 -216
- package/template-react-ts/node_modules/diff/lib/patch/apply.js +0 -243
- package/template-react-ts/node_modules/diff/lib/patch/create.js +0 -247
- package/template-react-ts/node_modules/diff/lib/patch/merge.js +0 -609
- package/template-react-ts/node_modules/diff/lib/patch/parse.js +0 -156
- package/template-react-ts/node_modules/diff/lib/util/array.js +0 -32
- package/template-react-ts/node_modules/diff/lib/util/distance-iterator.js +0 -57
- package/template-react-ts/node_modules/diff/lib/util/params.js +0 -24
- package/template-react-ts/node_modules/diff/package.json +0 -73
- package/template-react-ts/node_modules/diff/release-notes.md +0 -261
- package/template-react-ts/node_modules/diff/runtime.js +0 -3
- package/template-react-ts/node_modules/ts-node/LICENSE +0 -21
- package/template-react-ts/node_modules/ts-node/README.md +0 -1442
- package/template-react-ts/node_modules/ts-node/child-loader.mjs +0 -8
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.js +0 -7
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-script.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-script.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-script.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin.d.ts +0 -11
- package/template-react-ts/node_modules/ts-node/dist/bin.js +0 -581
- package/template-react-ts/node_modules/ts-node/dist/bin.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.js +0 -19
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.js +0 -24
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.js +0 -32
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.d.ts +0 -7
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.js +0 -22
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.js +0 -49
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.js +0 -29
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/configuration.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/configuration.js +0 -308
- package/template-react-ts/node_modules/ts-node/dist/configuration.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/esm.d.ts +0 -53
- package/template-react-ts/node_modules/ts-node/dist/esm.js +0 -228
- package/template-react-ts/node_modules/ts-node/dist/esm.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.js +0 -133
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/index.d.ts +0 -332
- package/template-react-ts/node_modules/ts-node/dist/index.js +0 -953
- package/template-react-ts/node_modules/ts-node/dist/index.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.js +0 -64
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.js +0 -39
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/repl.d.ts +0 -78
- package/template-react-ts/node_modules/ts-node/dist/repl.js +0 -561
- package/template-react-ts/node_modules/ts-node/dist/repl.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.js +0 -143
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.d.ts +0 -11
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.js +0 -218
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.d.ts +0 -35
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.js +0 -3
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.d.ts +0 -63
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.js +0 -3
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.d.ts +0 -6
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.js +0 -321
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.js +0 -100
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.d.ts +0 -13
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.js +0 -3
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.js +0 -36
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/util.d.ts +0 -4
- package/template-react-ts/node_modules/ts-node/dist/util.js +0 -175
- package/template-react-ts/node_modules/ts-node/dist/util.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist-raw/NODE-LICENSE.md +0 -24
- package/template-react-ts/node_modules/ts-node/dist-raw/README.md +0 -36
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-constants.js +0 -4
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-errors.js +0 -82
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js +0 -89
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js +0 -593
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js +0 -106
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js +0 -962
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js +0 -44
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-repl-await.js +0 -254
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internalBinding-fs.js +0 -58
- package/template-react-ts/node_modules/ts-node/dist-raw/node-nativemodule.js +0 -9
- package/template-react-ts/node_modules/ts-node/dist-raw/node-options.js +0 -103
- package/template-react-ts/node_modules/ts-node/dist-raw/node-primordials.js +0 -37
- package/template-react-ts/node_modules/ts-node/dist-raw/runmain-hack.js +0 -9
- package/template-react-ts/node_modules/ts-node/esm/transpile-only.mjs +0 -8
- package/template-react-ts/node_modules/ts-node/esm.mjs +0 -8
- package/template-react-ts/node_modules/ts-node/node10/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/node12/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/node14/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/node16/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/package.json +0 -182
- package/template-react-ts/node_modules/ts-node/register/files.js +0 -3
- package/template-react-ts/node_modules/ts-node/register/index.js +0 -1
- package/template-react-ts/node_modules/ts-node/register/transpile-only.js +0 -3
- package/template-react-ts/node_modules/ts-node/register/type-check.js +0 -3
- package/template-react-ts/node_modules/ts-node/transpilers/swc-experimental.js +0 -1
- package/template-react-ts/node_modules/ts-node/transpilers/swc.js +0 -1
- package/template-react-ts/node_modules/ts-node/tsconfig.schema.json +0 -183
- package/template-react-ts/node_modules/ts-node/tsconfig.schemastore-schema.json +0 -1326
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:string_decoder` module provides an API for decoding `Buffer` objects
|
|
3
|
-
* into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
|
|
4
|
-
* characters. It can be accessed using:
|
|
5
|
-
*
|
|
6
|
-
* ```js
|
|
7
|
-
* const { StringDecoder } = require('node:string_decoder');
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* The following example shows the basic use of the `StringDecoder` class.
|
|
11
|
-
*
|
|
12
|
-
* ```js
|
|
13
|
-
* const { StringDecoder } = require('node:string_decoder');
|
|
14
|
-
* const decoder = new StringDecoder('utf8');
|
|
15
|
-
*
|
|
16
|
-
* const cent = Buffer.from([0xC2, 0xA2]);
|
|
17
|
-
* console.log(decoder.write(cent)); // Prints: ¢
|
|
18
|
-
*
|
|
19
|
-
* const euro = Buffer.from([0xE2, 0x82, 0xAC]);
|
|
20
|
-
* console.log(decoder.write(euro)); // Prints: €
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* When a `Buffer` instance is written to the `StringDecoder` instance, an
|
|
24
|
-
* internal buffer is used to ensure that the decoded string does not contain
|
|
25
|
-
* any incomplete multibyte characters. These are held in the buffer until the
|
|
26
|
-
* next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
|
|
27
|
-
*
|
|
28
|
-
* In the following example, the three UTF-8 encoded bytes of the European Euro
|
|
29
|
-
* symbol (`€`) are written over three separate operations:
|
|
30
|
-
*
|
|
31
|
-
* ```js
|
|
32
|
-
* const { StringDecoder } = require('node:string_decoder');
|
|
33
|
-
* const decoder = new StringDecoder('utf8');
|
|
34
|
-
*
|
|
35
|
-
* decoder.write(Buffer.from([0xE2]));
|
|
36
|
-
* decoder.write(Buffer.from([0x82]));
|
|
37
|
-
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
|
|
38
|
-
* ```
|
|
39
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/string_decoder.js)
|
|
40
|
-
*/
|
|
41
|
-
declare module "string_decoder" {
|
|
42
|
-
class StringDecoder {
|
|
43
|
-
constructor(encoding?: BufferEncoding);
|
|
44
|
-
/**
|
|
45
|
-
* Returns a decoded string, ensuring that any incomplete multibyte characters at
|
|
46
|
-
* the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
|
|
47
|
-
* returned string and stored in an internal buffer for the next call to `stringDecoder.write()` or `stringDecoder.end()`.
|
|
48
|
-
* @since v0.1.99
|
|
49
|
-
* @param buffer The bytes to decode.
|
|
50
|
-
*/
|
|
51
|
-
write(buffer: string | Buffer | NodeJS.ArrayBufferView): string;
|
|
52
|
-
/**
|
|
53
|
-
* Returns any remaining input stored in the internal buffer as a string. Bytes
|
|
54
|
-
* representing incomplete UTF-8 and UTF-16 characters will be replaced with
|
|
55
|
-
* substitution characters appropriate for the character encoding.
|
|
56
|
-
*
|
|
57
|
-
* If the `buffer` argument is provided, one final call to `stringDecoder.write()` is performed before returning the remaining input.
|
|
58
|
-
* After `end()` is called, the `stringDecoder` object can be reused for new input.
|
|
59
|
-
* @since v0.9.3
|
|
60
|
-
* @param buffer The bytes to decode.
|
|
61
|
-
*/
|
|
62
|
-
end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
declare module "node:string_decoder" {
|
|
66
|
-
export * from "string_decoder";
|
|
67
|
-
}
|