terminal-pilot 0.0.45 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +134 -39
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.js +36 -0
- package/dist/commands/close-session.js.map +3 -3
- package/dist/commands/create-session.js +36 -0
- package/dist/commands/create-session.js.map +3 -3
- package/dist/commands/daemon-runtime.js +36 -0
- package/dist/commands/daemon-runtime.js.map +3 -3
- package/dist/commands/fill.js +36 -0
- package/dist/commands/fill.js.map +3 -3
- package/dist/commands/get-session.js +36 -0
- package/dist/commands/get-session.js.map +3 -3
- package/dist/commands/index.js +36 -0
- package/dist/commands/index.js.map +3 -3
- package/dist/commands/install.js +36 -0
- package/dist/commands/install.js.map +3 -3
- package/dist/commands/installer.js +36 -0
- package/dist/commands/installer.js.map +3 -3
- package/dist/commands/list-sessions.js +36 -0
- package/dist/commands/list-sessions.js.map +3 -3
- package/dist/commands/press-key.js +36 -0
- package/dist/commands/press-key.js.map +3 -3
- package/dist/commands/read-history.js +36 -0
- package/dist/commands/read-history.js.map +3 -3
- package/dist/commands/read-screen.js +36 -0
- package/dist/commands/read-screen.js.map +3 -3
- package/dist/commands/resize.js +36 -0
- package/dist/commands/resize.js.map +3 -3
- package/dist/commands/runtime.js +36 -0
- package/dist/commands/runtime.js.map +3 -3
- package/dist/commands/screenshot.js +36 -0
- package/dist/commands/screenshot.js.map +3 -3
- package/dist/commands/send-signal.js +36 -0
- package/dist/commands/send-signal.js.map +3 -3
- package/dist/commands/type.js +36 -0
- package/dist/commands/type.js.map +3 -3
- package/dist/commands/uninstall.js +36 -0
- package/dist/commands/uninstall.js.map +3 -3
- package/dist/commands/wait-for-exit.js +36 -0
- package/dist/commands/wait-for-exit.js.map +3 -3
- package/dist/commands/wait-for.js +36 -0
- package/dist/commands/wait-for.js.map +3 -3
- package/dist/composition.json +36 -1
- package/dist/testing/cli-repl.js +134 -39
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +134 -39
- package/dist/testing/qa-cli.js.map +4 -4
- package/node_modules/@poe-code/config-mutations/package.json +0 -5
- package/node_modules/@poe-code/frontmatter/package.json +0 -3
- package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/fast-string-width/license +21 -0
- package/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/fast-string-width/readme.md +42 -0
- package/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
- package/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/node_modules/jsonc-parser/README.md +364 -0
- package/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/node_modules/jsonc-parser/package.json +37 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/smol-toml/LICENSE +24 -0
- package/node_modules/smol-toml/README.md +239 -0
- package/node_modules/smol-toml/dist/date.d.ts +41 -0
- package/node_modules/smol-toml/dist/date.js +127 -0
- package/node_modules/smol-toml/dist/error.d.ts +38 -0
- package/node_modules/smol-toml/dist/error.js +63 -0
- package/node_modules/smol-toml/dist/extract.d.ts +30 -0
- package/node_modules/smol-toml/dist/extract.js +100 -0
- package/node_modules/smol-toml/dist/index.cjs +897 -0
- package/node_modules/smol-toml/dist/index.d.ts +43 -0
- package/node_modules/smol-toml/dist/index.js +33 -0
- package/node_modules/smol-toml/dist/parse.d.ts +37 -0
- package/node_modules/smol-toml/dist/parse.js +148 -0
- package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
- package/node_modules/smol-toml/dist/primitive.js +179 -0
- package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
- package/node_modules/smol-toml/dist/stringify.js +167 -0
- package/node_modules/smol-toml/dist/struct.d.ts +32 -0
- package/node_modules/smol-toml/dist/struct.js +184 -0
- package/node_modules/smol-toml/dist/util.d.ts +42 -0
- package/node_modules/smol-toml/dist/util.js +111 -0
- package/node_modules/smol-toml/package.json +54 -0
- package/node_modules/toolcraft-design/package.json +0 -5
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +10 -4
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# sister ANSI [](https://www.npmjs.com/package/sisteransi) [](https://travis-ci.org/terkelg/sisteransi) [](https://www.npmjs.com/package/sisteransi)
|
|
2
|
+
|
|
3
|
+
> Ansi escape codes faster than you can say "[Bam bam](https://www.youtube.com/watch?v=OcaPu9JPenU)".
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install sisteransi
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
const ansi = require('sisteransi');
|
|
16
|
+
// or const { cursor } = require('sisteransi');
|
|
17
|
+
|
|
18
|
+
const p = str => process.stdout.write(str);
|
|
19
|
+
|
|
20
|
+
// move cursor to 2, 1
|
|
21
|
+
p(ansi.cursor.to(2, 1));
|
|
22
|
+
|
|
23
|
+
// to up, one down
|
|
24
|
+
p(ansi.cursor.up(2)+ansi.cursor.down(1));
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
### cursor
|
|
30
|
+
|
|
31
|
+
#### to(x, y)
|
|
32
|
+
Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
|
|
33
|
+
|
|
34
|
+
#### move(x, y)
|
|
35
|
+
Set the position of the cursor relative to its current position.
|
|
36
|
+
|
|
37
|
+
#### up(count = 1)
|
|
38
|
+
Move cursor up a specific amount of rows. Default is `1`.
|
|
39
|
+
|
|
40
|
+
#### down(count = 1)
|
|
41
|
+
Move cursor down a specific amount of rows. Default is `1`.
|
|
42
|
+
|
|
43
|
+
#### forward(count = 1)
|
|
44
|
+
Move cursor forward a specific amount of rows. Default is `1`.
|
|
45
|
+
|
|
46
|
+
#### backward(count = 1)
|
|
47
|
+
Move cursor backward a specific amount of rows. Default is `1`.
|
|
48
|
+
|
|
49
|
+
#### nextLine(count = 1)
|
|
50
|
+
Move cursor to the next line a specific amount of lines. Default is `1`.
|
|
51
|
+
|
|
52
|
+
#### prevLine(count = 1)
|
|
53
|
+
Move cursor to the previous a specific amount of lines. Default is `1`.
|
|
54
|
+
|
|
55
|
+
#### left
|
|
56
|
+
Move cursor to the left side.
|
|
57
|
+
|
|
58
|
+
#### hide
|
|
59
|
+
Hide cursor.
|
|
60
|
+
|
|
61
|
+
#### show
|
|
62
|
+
Show cursor.
|
|
63
|
+
|
|
64
|
+
#### save
|
|
65
|
+
|
|
66
|
+
Save cursor position.
|
|
67
|
+
|
|
68
|
+
#### restore
|
|
69
|
+
|
|
70
|
+
Restore cursor position.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### scroll
|
|
74
|
+
|
|
75
|
+
#### up(count = 1)
|
|
76
|
+
Scroll display up a specific amount of lines. Default to `1`.
|
|
77
|
+
|
|
78
|
+
#### down(count = 1)
|
|
79
|
+
Scroll display down a specific amount of lines. Default to `1`.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### erase
|
|
83
|
+
|
|
84
|
+
#### screen
|
|
85
|
+
Erase the screen and move the cursor the top left position.
|
|
86
|
+
|
|
87
|
+
#### up(count = 1)
|
|
88
|
+
Erase the screen from the current line up to the top of the screen. Default to `1`.
|
|
89
|
+
|
|
90
|
+
#### down(count = 2)
|
|
91
|
+
Erase the screen from the current line down to the bottom of the screen. Default to `1`.
|
|
92
|
+
|
|
93
|
+
#### line
|
|
94
|
+
Erase the entire current line.
|
|
95
|
+
|
|
96
|
+
#### lineEnd
|
|
97
|
+
Erase from the current cursor position to the end of the current line.
|
|
98
|
+
|
|
99
|
+
#### lineStart
|
|
100
|
+
Erase from the current cursor position to the start of the current line.
|
|
101
|
+
|
|
102
|
+
#### lines(count)
|
|
103
|
+
Erase from the current cursor position up the specified amount of rows.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Credit
|
|
107
|
+
|
|
108
|
+
This is a fork of [ansi-escapes](https://github.com/sindresorhus/ansi-escapes).
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT © [Terkel Gjervig](https://terkel.com)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ESC = '\x1B';
|
|
4
|
+
const CSI = `${ESC}[`;
|
|
5
|
+
const beep = '\u0007';
|
|
6
|
+
|
|
7
|
+
const cursor = {
|
|
8
|
+
to(x, y) {
|
|
9
|
+
if (!y) return `${CSI}${x + 1}G`;
|
|
10
|
+
return `${CSI}${y + 1};${x + 1}H`;
|
|
11
|
+
},
|
|
12
|
+
move(x, y) {
|
|
13
|
+
let ret = '';
|
|
14
|
+
|
|
15
|
+
if (x < 0) ret += `${CSI}${-x}D`;
|
|
16
|
+
else if (x > 0) ret += `${CSI}${x}C`;
|
|
17
|
+
|
|
18
|
+
if (y < 0) ret += `${CSI}${-y}A`;
|
|
19
|
+
else if (y > 0) ret += `${CSI}${y}B`;
|
|
20
|
+
|
|
21
|
+
return ret;
|
|
22
|
+
},
|
|
23
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
24
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
25
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
26
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
27
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
28
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
29
|
+
left: `${CSI}G`,
|
|
30
|
+
hide: `${CSI}?25l`,
|
|
31
|
+
show: `${CSI}?25h`,
|
|
32
|
+
save: `${ESC}7`,
|
|
33
|
+
restore: `${ESC}8`
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const scroll = {
|
|
37
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
38
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const erase = {
|
|
42
|
+
screen: `${CSI}2J`,
|
|
43
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
44
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
45
|
+
line: `${CSI}2K`,
|
|
46
|
+
lineEnd: `${CSI}K`,
|
|
47
|
+
lineStart: `${CSI}1K`,
|
|
48
|
+
lines(count) {
|
|
49
|
+
let clear = '';
|
|
50
|
+
for (let i = 0; i < count; i++)
|
|
51
|
+
clear += this.line + (i < count - 1 ? cursor.up() : '');
|
|
52
|
+
if (count)
|
|
53
|
+
clear += cursor.left;
|
|
54
|
+
return clear;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = { cursor, scroll, erase, beep };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const beep: string;
|
|
2
|
+
export const clear: string;
|
|
3
|
+
|
|
4
|
+
export namespace cursor {
|
|
5
|
+
export const left: string;
|
|
6
|
+
export const hide: string;
|
|
7
|
+
export const show: string;
|
|
8
|
+
export const save: string;
|
|
9
|
+
export const restore: string;
|
|
10
|
+
|
|
11
|
+
export function to(x: number, y?: number): string;
|
|
12
|
+
export function move(x: number, y: number): string;
|
|
13
|
+
export function up(count?: number): string;
|
|
14
|
+
export function down(count?: number): string;
|
|
15
|
+
export function forward(count?: number): string;
|
|
16
|
+
export function backward(count?: number): string;
|
|
17
|
+
export function nextLine(count?: number): string;
|
|
18
|
+
export function prevLine(count?: number): string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export namespace scroll {
|
|
22
|
+
export function up(count?: number): string;
|
|
23
|
+
export function down(count?: number): string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export namespace erase {
|
|
27
|
+
export const screen: string;
|
|
28
|
+
export const line: string;
|
|
29
|
+
export const lineEnd: string;
|
|
30
|
+
export const lineStart: string;
|
|
31
|
+
|
|
32
|
+
export function up(count?: number): string;
|
|
33
|
+
export function down(count?: number): string;
|
|
34
|
+
export function lines(count: number): string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
list of conditions and the following disclaimer.
|
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
9
|
+
this list of conditions and the following disclaimer in the
|
|
10
|
+
documentation and/or other materials provided with the distribution.
|
|
11
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
12
|
+
may be used to endorse or promote products derived from this software without
|
|
13
|
+
specific prior written permission.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
16
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
17
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
19
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
20
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
21
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
23
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# smol-toml
|
|
2
|
+
[](https://toml.io/en/v1.1.0)
|
|
3
|
+
[](https://github.com/squirrelchat/smol-toml/blob/mistress/LICENSE)
|
|
4
|
+
[](https://npm.im/smol-toml)
|
|
5
|
+
[](https://github.com/squirrelchat/smol-toml/actions/workflows/build.yaml)
|
|
6
|
+
|
|
7
|
+
[](https://github.com/sponsors/cyyynthia)
|
|
8
|
+
[](https://npm.im/smol-toml)
|
|
9
|
+
[](https://npm.im/smol-toml)
|
|
10
|
+
|
|
11
|
+
A small, fast, and correct TOML parser and serializer. smol-toml is fully(ish) spec-compliant with TOML v1.1.0.
|
|
12
|
+
|
|
13
|
+
Why yet another TOML parser? Well, the ecosystem of TOML parsers in JavaScript is quite underwhelming, most likely due
|
|
14
|
+
to a lack of interest. With most parsers being outdated, unmaintained, non-compliant, or a combination of these, a new
|
|
15
|
+
parser didn't feel too out of place.
|
|
16
|
+
|
|
17
|
+
*[insert xkcd 927]*
|
|
18
|
+
|
|
19
|
+
Nowadays, smol-toml is the most downloaded TOML parser on npm thanks to its quality. From frameworks to tooling, it
|
|
20
|
+
has been battle-tested and is actively used in production systems.
|
|
21
|
+
|
|
22
|
+
smol-toml passes most of the tests from the [`toml-test` suite](https://github.com/toml-lang/toml-test); use the
|
|
23
|
+
`run-toml-test.bash` script to run the tests. Due to the nature of JavaScript and the limits of the language,
|
|
24
|
+
it doesn't pass certain tests, namely:
|
|
25
|
+
- Invalid UTF-8 strings are not rejected
|
|
26
|
+
- Certain invalid UTF-8 codepoints are not rejected
|
|
27
|
+
- Certain invalid dates are not rejected
|
|
28
|
+
- For instance, `2023-02-30` would be accepted and parsed as `2023-03-02`. While additional checks could be performed
|
|
29
|
+
to reject these, they've not been added for performance reasons.
|
|
30
|
+
|
|
31
|
+
Please also note that by default, the behavior regarding integers doesn't preserve type information, nor does it allow
|
|
32
|
+
deserializing integers larger than 53 bits. See [Integers](#integers).
|
|
33
|
+
|
|
34
|
+
You can see a list of all tests smol-toml fails (and the reason why it fails these) in the list of skipped tests in
|
|
35
|
+
`run-toml-test.bash`. Note that some failures are *not* specification violations per-se. For instance, the TOML spec
|
|
36
|
+
does not require 64-bit integer range support or sub-millisecond time precision, but are included in the `toml-test`
|
|
37
|
+
suite. See https://github.com/toml-lang/toml-test/issues/154 and https://github.com/toml-lang/toml-test/issues/155
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
```
|
|
41
|
+
[pnpm | yarn | npm] i smol-toml
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
```js
|
|
46
|
+
import { parse, stringify } from 'smol-toml'
|
|
47
|
+
|
|
48
|
+
const doc = '...'
|
|
49
|
+
const parsed = parse(doc)
|
|
50
|
+
console.log(parsed)
|
|
51
|
+
|
|
52
|
+
const toml = stringify(parsed)
|
|
53
|
+
console.log(toml)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Alternatively, if you prefer something similar to the JSON global, you can import the library as follows
|
|
57
|
+
```js
|
|
58
|
+
import TOML from 'smol-toml'
|
|
59
|
+
|
|
60
|
+
TOML.stringify({ ... })
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
A few notes on the `stringify` function:
|
|
64
|
+
- `undefined` and `null` values on objects are ignored (does not produce a key/value).
|
|
65
|
+
- `undefined` and `null` values in arrays are **rejected**.
|
|
66
|
+
- Functions, classes and symbols are **rejected**.
|
|
67
|
+
- By default, floats will be serialized as integers if they don't have a decimal part. See [Integers](#integers)
|
|
68
|
+
- `stringify(parse('a = 1.0')) === 'a = 1'`
|
|
69
|
+
- JS `Date` will be serialized as Offset Date Time
|
|
70
|
+
- Use the [`TomlDate` object](#dates) for representing other types.
|
|
71
|
+
|
|
72
|
+
### Integers
|
|
73
|
+
When parsing, both integers and floats are read as plain JavaScript numbers, which essentially are floats. This means
|
|
74
|
+
loss of type information, and makes it impossible to safely represent integers beyond 53 bits.
|
|
75
|
+
|
|
76
|
+
When serializing, numbers without a decimal part are serialized as integers. This allows in most cases to preserve
|
|
77
|
+
whether a number is an integer or not, but fails to preserve type information for numbers like `1.0`.
|
|
78
|
+
|
|
79
|
+
#### Enabling BigInt support and type preservation
|
|
80
|
+
To parse integers beyond 53 bits, it's possible to tell the parser to return all integers as BigInt. This will
|
|
81
|
+
therefore preserve the type information at the cost of using a slightly more expensive container.
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
import { parse } from 'smol-toml'
|
|
85
|
+
|
|
86
|
+
const doc = '...'
|
|
87
|
+
const parsed = parse(doc, { integersAsBigInt: true })
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
If you want to keep numbers for integers that can safely be represented as a JavaScript number, you can pass
|
|
91
|
+
`"asNeeded"` instead.
|
|
92
|
+
|
|
93
|
+
To get end-to-end type preservation, you can tell the serializer to always treat numbers as floating point numbers.
|
|
94
|
+
Then, only BigInts will be serialized as integers and numbers without a decimal part will still be serialized as float.
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
import { stringify } from 'smol-toml'
|
|
98
|
+
|
|
99
|
+
const obj = { ... }
|
|
100
|
+
const toml = stringify(obj, { numbersAsFloat: true })
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Dates
|
|
104
|
+
`smol-toml` uses an extended `Date` object to represent all types of TOML Dates. In the future, `smol-toml` will use
|
|
105
|
+
objects from the Temporal proposal, but for now we're stuck with the legacy Date object.
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
import { TomlDate } from 'smol-toml'
|
|
109
|
+
|
|
110
|
+
// Offset Date Time
|
|
111
|
+
const date = new TomlDate('1979-05-27T07:32:00.000-08:00')
|
|
112
|
+
console.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> true, false, false, false
|
|
113
|
+
console.log(date.toISOString()) // ~> 1979-05-27T07:32:00.000-08:00
|
|
114
|
+
|
|
115
|
+
// Local Date Time
|
|
116
|
+
const date = new TomlDate('1979-05-27T07:32:00.000')
|
|
117
|
+
console.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> true, false, false, true
|
|
118
|
+
console.log(date.toISOString()) // ~> 1979-05-27T07:32:00.000
|
|
119
|
+
|
|
120
|
+
// Local Date
|
|
121
|
+
const date = new TomlDate('1979-05-27')
|
|
122
|
+
console.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> false, true, false, true
|
|
123
|
+
console.log(date.toISOString()) // ~> 1979-05-27
|
|
124
|
+
|
|
125
|
+
// Local Time
|
|
126
|
+
const date = new TomlDate('07:32:00')
|
|
127
|
+
console.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> false, false, true, true
|
|
128
|
+
console.log(date.toISOString()) // ~> 07:32:00.000
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
You can also wrap a native `Date` object and specify using different methods depending on the type of date you wish
|
|
132
|
+
to represent:
|
|
133
|
+
|
|
134
|
+
```js
|
|
135
|
+
import { TomlDate } from 'smol-toml'
|
|
136
|
+
|
|
137
|
+
const jsDate = new Date()
|
|
138
|
+
|
|
139
|
+
const offsetDateTime = TomlDate.wrapAsOffsetDateTime(jsDate)
|
|
140
|
+
const localDateTime = TomlDate.wrapAsLocalDateTime(jsDate)
|
|
141
|
+
const localDate = TomlDate.wrapAsLocalDate(jsDate)
|
|
142
|
+
const localTime = TomlDate.wrapAsLocalTime(jsDate)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Performance
|
|
146
|
+
> [!NOTE]
|
|
147
|
+
> These benchmarks are starting to get quite old and were ran prior to the release of TOML 1.1.0 which changed subtle
|
|
148
|
+
> implementation details.
|
|
149
|
+
>
|
|
150
|
+
> They will be updated in the (hopefully near) future to better reflect numbers of the latest version of smol-toml
|
|
151
|
+
> on the latest version of Node.js.
|
|
152
|
+
|
|
153
|
+
A note on these performance numbers: in some highly synthetic tests, other parsers such as `fast-toml` greatly
|
|
154
|
+
outperform other parsers, mostly due to their lack of compliance with the spec. For example, to parse a string,
|
|
155
|
+
`fast-toml` skips the entire string while `smol-toml` does validate the string, costing a fair share of performance.
|
|
156
|
+
|
|
157
|
+
The ~5MB test file used for benchmark here is filled with random data which attempts to be close-ish to reality in
|
|
158
|
+
terms of structure. The idea is to have a file relatively close to a real-world application, with moderately sized
|
|
159
|
+
strings etc.
|
|
160
|
+
|
|
161
|
+
The large TOML generator can be found [here](https://gist.github.com/cyyynthia/e77c744cb6494dabe37d0182506526b9)
|
|
162
|
+
|
|
163
|
+
| **Parse** | smol-toml | @iarna/toml@3.0.0 | @ltd/j-toml | fast-toml |
|
|
164
|
+
|----------------|---------------------|-------------------|-----------------|-----------------|
|
|
165
|
+
| Spec example | **71,356.51 op/s** | 33,629.31 op/s | 16,433.86 op/s | 29,421.60 op/s |
|
|
166
|
+
| ~5MB test file | **3.8091 op/s** | *DNF* | 2.4369 op/s | 2.6078 op/s |
|
|
167
|
+
|
|
168
|
+
| **Stringify** | smol-toml | @iarna/toml@3.0.0 | @ltd/j-toml |
|
|
169
|
+
|----------------|----------------------|-------------------|----------------|
|
|
170
|
+
| Spec example | **195,191.99 op/s** | 46,583.07 op/s | 5,670.12 op/s |
|
|
171
|
+
| ~5MB test file | **14.6709 op/s** | 3.5941 op/s | 0.7856 op/s |
|
|
172
|
+
|
|
173
|
+
<details>
|
|
174
|
+
<summary>Detailed benchmark data</summary>
|
|
175
|
+
|
|
176
|
+
Tests ran using Vitest v0.31.0 on commit f58cb6152e667e9cea09f31c93d90652e3b82bf5
|
|
177
|
+
|
|
178
|
+
CPU: Intel Core i7 7700K (4.2GHz)
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
RUN v0.31.0
|
|
182
|
+
|
|
183
|
+
✓ bench/parseSpecExample.bench.ts (4) 2462ms
|
|
184
|
+
name hz min max mean p75 p99 p995 p999 rme samples
|
|
185
|
+
· smol-toml 71,356.51 0.0132 0.2633 0.0140 0.0137 0.0219 0.0266 0.1135 ±0.37% 35679 fastest
|
|
186
|
+
· @iarna/toml 33,629.31 0.0272 0.2629 0.0297 0.0287 0.0571 0.0650 0.1593 ±0.45% 16815
|
|
187
|
+
· @ltd/j-toml 16,433.86 0.0523 1.3088 0.0608 0.0550 0.1140 0.1525 0.7348 ±1.47% 8217 slowest
|
|
188
|
+
· fast-toml 29,421.60 0.0305 0.2995 0.0340 0.0312 0.0618 0.0640 0.1553 ±0.47% 14711
|
|
189
|
+
✓ bench/parseLargeMixed.bench.ts (3) 16062ms
|
|
190
|
+
name hz min max mean p75 p99 p995 p999 rme samples
|
|
191
|
+
· smol-toml 3.8091 239.60 287.30 262.53 274.17 287.30 287.30 287.30 ±3.66% 10 fastest
|
|
192
|
+
· @ltd/j-toml 2.4369 376.73 493.49 410.35 442.58 493.49 493.49 493.49 ±7.08% 10 slowest
|
|
193
|
+
· fast-toml 2.6078 373.88 412.79 383.47 388.62 412.79 412.79 412.79 ±2.72% 10
|
|
194
|
+
✓ bench/stringifySpecExample.bench.ts (3) 1886ms
|
|
195
|
+
name hz min max mean p75 p99 p995 p999 rme samples
|
|
196
|
+
· smol-toml 195,191.99 0.0047 0.2704 0.0051 0.0050 0.0099 0.0110 0.0152 ±0.41% 97596 fastest
|
|
197
|
+
· @iarna/toml 46,583.07 0.0197 0.2808 0.0215 0.0208 0.0448 0.0470 0.1704 ±0.47% 23292
|
|
198
|
+
· @ltd/j-toml 5,670.12 0.1613 0.5768 0.1764 0.1726 0.3036 0.3129 0.4324 ±0.56% 2836 slowest
|
|
199
|
+
✓ bench/stringifyLargeMixed.bench.ts (3) 24057ms
|
|
200
|
+
name hz min max mean p75 p99 p995 p999 rme samples
|
|
201
|
+
· smol-toml 14.6709 65.1071 79.2199 68.1623 67.1088 79.2199 79.2199 79.2199 ±5.25% 10 fastest
|
|
202
|
+
· @iarna/toml 3.5941 266.48 295.24 278.24 290.10 295.24 295.24 295.24 ±2.83% 10
|
|
203
|
+
· @ltd/j-toml 0.7856 1,254.33 1,322.05 1,272.87 1,286.82 1,322.05 1,322.05 1,322.05 ±1.37% 10 slowest
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
BENCH Summary
|
|
207
|
+
|
|
208
|
+
smol-toml - bench/parseLargeMixed.bench.ts >
|
|
209
|
+
1.46x faster than fast-toml
|
|
210
|
+
1.56x faster than @ltd/j-toml
|
|
211
|
+
|
|
212
|
+
smol-toml - bench/parseSpecExample.bench.ts >
|
|
213
|
+
2.12x faster than @iarna/toml
|
|
214
|
+
2.43x faster than fast-toml
|
|
215
|
+
4.34x faster than @ltd/j-toml
|
|
216
|
+
|
|
217
|
+
smol-toml - bench/stringifyLargeMixed.bench.ts >
|
|
218
|
+
4.00x faster than @iarna/toml
|
|
219
|
+
18.33x faster than @ltd/j-toml
|
|
220
|
+
|
|
221
|
+
smol-toml - bench/stringifySpecExample.bench.ts >
|
|
222
|
+
4.19x faster than @iarna/toml
|
|
223
|
+
34.42x faster than @ltd/j-toml
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
Additional notes:
|
|
228
|
+
|
|
229
|
+
I initially tried to benchmark `toml-nodejs`, but the 0.3.0 package is broken.
|
|
230
|
+
I initially reported this to the library author, but the author decided to
|
|
231
|
+
- a) advise to use a custom loader (via *experimental* flag) to circumvent the invalid imports.
|
|
232
|
+
- Said flag, `--experimental-specifier-resolution`, has been removed in Node v20.
|
|
233
|
+
- b) [delete the issue](https://github.com/huan231/toml-nodejs/issues/12) when pointed out links to the Node.js
|
|
234
|
+
documentation about the flag removal and standard resolution algorithm.
|
|
235
|
+
|
|
236
|
+
For the reference anyway, `toml-nodejs` (with proper imports) is ~8x slower on both parse benchmark with:
|
|
237
|
+
- spec example: 7,543.47 op/s
|
|
238
|
+
- 5mb mixed: 0.7006 op/s
|
|
239
|
+
</details>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
*
|
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
|
6
|
+
* modification, are permitted provided that the following conditions are met:
|
|
7
|
+
*
|
|
8
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
* list of conditions and the following disclaimer.
|
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer in the
|
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
|
13
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
* may be used to endorse or promote products derived from this software without
|
|
15
|
+
* specific prior written permission.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/
|
|
28
|
+
export declare class TomlDate extends Date {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(date: string | Date);
|
|
31
|
+
isDateTime(): boolean;
|
|
32
|
+
isLocal(): boolean;
|
|
33
|
+
isDate(): boolean;
|
|
34
|
+
isTime(): boolean;
|
|
35
|
+
isValid(): boolean;
|
|
36
|
+
toISOString(): string;
|
|
37
|
+
static wrapAsOffsetDateTime(jsDate: Date, offset?: string): TomlDate;
|
|
38
|
+
static wrapAsLocalDateTime(jsDate: Date): TomlDate;
|
|
39
|
+
static wrapAsLocalDate(jsDate: Date): TomlDate;
|
|
40
|
+
static wrapAsLocalTime(jsDate: Date): TomlDate;
|
|
41
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
*
|
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
|
6
|
+
* modification, are permitted provided that the following conditions are met:
|
|
7
|
+
*
|
|
8
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
* list of conditions and the following disclaimer.
|
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer in the
|
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
|
13
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
* may be used to endorse or promote products derived from this software without
|
|
15
|
+
* specific prior written permission.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/
|
|
28
|
+
let DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
29
|
+
export class TomlDate extends Date {
|
|
30
|
+
#hasDate = false;
|
|
31
|
+
#hasTime = false;
|
|
32
|
+
#offset = null;
|
|
33
|
+
constructor(date) {
|
|
34
|
+
let hasDate = true;
|
|
35
|
+
let hasTime = true;
|
|
36
|
+
let offset = 'Z';
|
|
37
|
+
if (typeof date === 'string') {
|
|
38
|
+
let match = date.match(DATE_TIME_RE);
|
|
39
|
+
if (match) {
|
|
40
|
+
if (!match[1]) {
|
|
41
|
+
hasDate = false;
|
|
42
|
+
date = `0000-01-01T${date}`;
|
|
43
|
+
}
|
|
44
|
+
hasTime = !!match[2];
|
|
45
|
+
// Make sure to use T instead of a space. Breaks in case of extreme values otherwise.
|
|
46
|
+
hasTime && date[10] === ' ' && (date = date.replace(' ', 'T'));
|
|
47
|
+
// Do not allow rollover hours.
|
|
48
|
+
if (match[2] && +match[2] > 23) {
|
|
49
|
+
date = '';
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
offset = match[3] || null;
|
|
53
|
+
date = date.toUpperCase();
|
|
54
|
+
if (!offset && hasTime)
|
|
55
|
+
date += 'Z';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
date = '';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
super(date);
|
|
63
|
+
if (!isNaN(this.getTime())) {
|
|
64
|
+
this.#hasDate = hasDate;
|
|
65
|
+
this.#hasTime = hasTime;
|
|
66
|
+
this.#offset = offset;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
isDateTime() {
|
|
70
|
+
return this.#hasDate && this.#hasTime;
|
|
71
|
+
}
|
|
72
|
+
isLocal() {
|
|
73
|
+
return !this.#hasDate || !this.#hasTime || !this.#offset;
|
|
74
|
+
}
|
|
75
|
+
isDate() {
|
|
76
|
+
return this.#hasDate && !this.#hasTime;
|
|
77
|
+
}
|
|
78
|
+
isTime() {
|
|
79
|
+
return this.#hasTime && !this.#hasDate;
|
|
80
|
+
}
|
|
81
|
+
isValid() {
|
|
82
|
+
return this.#hasDate || this.#hasTime;
|
|
83
|
+
}
|
|
84
|
+
toISOString() {
|
|
85
|
+
let iso = super.toISOString();
|
|
86
|
+
// Local Date
|
|
87
|
+
if (this.isDate())
|
|
88
|
+
return iso.slice(0, 10);
|
|
89
|
+
// Local Time
|
|
90
|
+
if (this.isTime())
|
|
91
|
+
return iso.slice(11, 23);
|
|
92
|
+
// Local DateTime
|
|
93
|
+
if (this.#offset === null)
|
|
94
|
+
return iso.slice(0, -1);
|
|
95
|
+
// Offset DateTime
|
|
96
|
+
if (this.#offset === 'Z')
|
|
97
|
+
return iso;
|
|
98
|
+
// This part is quite annoying: JS strips the original timezone from the ISO string representation
|
|
99
|
+
// Instead of using a "modified" date and "Z", we restore the representation "as authored"
|
|
100
|
+
let offset = (+(this.#offset.slice(1, 3)) * 60) + +(this.#offset.slice(4, 6));
|
|
101
|
+
offset = this.#offset[0] === '-' ? offset : -offset;
|
|
102
|
+
let offsetDate = new Date(this.getTime() - (offset * 60e3));
|
|
103
|
+
return offsetDate.toISOString().slice(0, -1) + this.#offset;
|
|
104
|
+
}
|
|
105
|
+
static wrapAsOffsetDateTime(jsDate, offset = 'Z') {
|
|
106
|
+
let date = new TomlDate(jsDate);
|
|
107
|
+
date.#offset = offset;
|
|
108
|
+
return date;
|
|
109
|
+
}
|
|
110
|
+
static wrapAsLocalDateTime(jsDate) {
|
|
111
|
+
let date = new TomlDate(jsDate);
|
|
112
|
+
date.#offset = null;
|
|
113
|
+
return date;
|
|
114
|
+
}
|
|
115
|
+
static wrapAsLocalDate(jsDate) {
|
|
116
|
+
let date = new TomlDate(jsDate);
|
|
117
|
+
date.#hasTime = false;
|
|
118
|
+
date.#offset = null;
|
|
119
|
+
return date;
|
|
120
|
+
}
|
|
121
|
+
static wrapAsLocalTime(jsDate) {
|
|
122
|
+
let date = new TomlDate(jsDate);
|
|
123
|
+
date.#hasDate = false;
|
|
124
|
+
date.#offset = null;
|
|
125
|
+
return date;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
*
|
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
|
6
|
+
* modification, are permitted provided that the following conditions are met:
|
|
7
|
+
*
|
|
8
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
* list of conditions and the following disclaimer.
|
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer in the
|
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
|
13
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
* may be used to endorse or promote products derived from this software without
|
|
15
|
+
* specific prior written permission.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/
|
|
28
|
+
type TomlErrorOptions = ErrorOptions & {
|
|
29
|
+
toml: string;
|
|
30
|
+
ptr: number;
|
|
31
|
+
};
|
|
32
|
+
export declare class TomlError extends Error {
|
|
33
|
+
line: number;
|
|
34
|
+
column: number;
|
|
35
|
+
codeblock: string;
|
|
36
|
+
constructor(message: string, options: TomlErrorOptions);
|
|
37
|
+
}
|
|
38
|
+
export {};
|