@dev-sergeev/datalab-kit 0.1.2 → 0.1.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/CHANGELOG.md +14 -0
- package/README.md +23 -5
- package/THIRD_PARTY_NOTICES.md +6 -2
- package/docs/adr/0001-user-settings-priority.md +2 -0
- package/docs/adr/0002-package-delivery.md +8 -0
- package/node_modules/@pi-plugins/elapsed/LICENSE +21 -0
- package/node_modules/@pi-plugins/elapsed/README.md +45 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.d.mts +8 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.d.mts.map +1 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.mjs +47 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.mjs.map +1 -0
- package/node_modules/@pi-plugins/elapsed/package.json +65 -0
- package/node_modules/@tifan/pi-recap/README.md +61 -0
- package/node_modules/@tifan/pi-recap/package.json +43 -0
- package/node_modules/@tifan/pi-recap/src/index.ts +586 -0
- package/node_modules/@tifan/pi-recap/src/model-picker.ts +234 -0
- package/node_modules/@tifan/pi-recap/src/models.ts +180 -0
- package/node_modules/@tifan/pi-recap/src/sanitize.ts +119 -0
- package/node_modules/@tifan/pi-recap/src/tui.ts +155 -0
- package/node_modules/@zigai/pi-extension-internals/README.md +24 -0
- package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.d.ts +21 -0
- package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.js +233 -0
- package/node_modules/@zigai/pi-extension-internals/dist/index.d.ts +6 -0
- package/node_modules/@zigai/pi-extension-internals/dist/index.js +3 -0
- package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.d.ts +34 -0
- package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.js +272 -0
- package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.d.ts +11 -0
- package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.js +139 -0
- package/node_modules/@zigai/pi-extension-internals/package.json +41 -0
- package/node_modules/@zigai/pi-extension-settings/LICENSE +21 -0
- package/node_modules/@zigai/pi-extension-settings/README.md +36 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts +23 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js +75 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts +3 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts +6 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.js +87 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts +159 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.js +248 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.js +115 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.js +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts +18 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.js +56 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts +11 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.js +23 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js +21 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts +106 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.js +122 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.ts +2537 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.ts.map +7 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.js +177 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts +40 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.js +158 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts +158 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts.map +7 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts +19 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js +168 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts +9 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js +242 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts +59 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js +98 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts +80 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js +144 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js +30 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js +16 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts +54 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js +202 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js +9 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/docs/generation.md +71 -0
- package/node_modules/@zigai/pi-extension-settings/docs/manual-setup.md +98 -0
- package/node_modules/@zigai/pi-extension-settings/docs/runtime.md +100 -0
- package/node_modules/@zigai/pi-extension-settings/docs/ui-controls.md +31 -0
- package/node_modules/@zigai/pi-extension-settings/package.json +97 -0
- package/node_modules/@zigai/pi-mention-anything/README.md +113 -0
- package/node_modules/@zigai/pi-mention-anything/config.schema.json +313 -0
- package/node_modules/@zigai/pi-mention-anything/docs/command-protocol.md +106 -0
- package/node_modules/@zigai/pi-mention-anything/docs/providers.md +128 -0
- package/node_modules/@zigai/pi-mention-anything/examples/query-command.mjs +96 -0
- package/node_modules/@zigai/pi-mention-anything/examples/recursive-tree.ts +28 -0
- package/node_modules/@zigai/pi-mention-anything/examples/static.ts +28 -0
- package/node_modules/@zigai/pi-mention-anything/examples/tmux.ts +90 -0
- package/node_modules/@zigai/pi-mention-anything/examples/tree-settings.json +25 -0
- package/node_modules/@zigai/pi-mention-anything/package.json +58 -0
- package/node_modules/@zigai/pi-mention-anything/src/api.ts +75 -0
- package/node_modules/@zigai/pi-mention-anything/src/autocomplete.ts +231 -0
- package/node_modules/@zigai/pi-mention-anything/src/chain-autocomplete.ts +596 -0
- package/node_modules/@zigai/pi-mention-anything/src/chain-syntax.ts +345 -0
- package/node_modules/@zigai/pi-mention-anything/src/command-provider.ts +291 -0
- package/node_modules/@zigai/pi-mention-anything/src/configured-source.ts +66 -0
- package/node_modules/@zigai/pi-mention-anything/src/editor.ts +180 -0
- package/node_modules/@zigai/pi-mention-anything/src/expand-mentions.ts +162 -0
- package/node_modules/@zigai/pi-mention-anything/src/index.ts +54 -0
- package/node_modules/@zigai/pi-mention-anything/src/initial-suggestions.ts +190 -0
- package/node_modules/@zigai/pi-mention-anything/src/list-provider.ts +71 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-hub.ts +307 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-resolution.ts +374 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-syntax.ts +105 -0
- package/node_modules/@zigai/pi-mention-anything/src/register-mention.ts +89 -0
- package/node_modules/@zigai/pi-mention-anything/src/rendering.ts +53 -0
- package/node_modules/@zigai/pi-mention-anything/src/selected-items.ts +21 -0
- package/node_modules/@zigai/pi-mention-anything/src/selection-history.ts +135 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings-input.ts +317 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings.prevalidated.ts +57 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings.ts +52 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-contract.ts +174 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-controller.ts +1070 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-runtime.ts +99 -0
- package/node_modules/@zigai/pi-mention-skill/README.md +60 -0
- package/node_modules/@zigai/pi-mention-skill/config.schema.json +81 -0
- package/node_modules/@zigai/pi-mention-skill/package.json +56 -0
- package/node_modules/@zigai/pi-mention-skill/src/index.ts +60 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings-input.ts +74 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings.prevalidated.ts +18 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings.ts +54 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-commands.ts +18 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-content.ts +60 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-provider.ts +105 -0
- package/node_modules/@zigai/pi-mention-skill/src/slash-skill-filter.ts +29 -0
- package/node_modules/argparse/LICENSE +21 -0
- package/node_modules/argparse/README.md +257 -0
- package/node_modules/argparse/index.js +3 -0
- package/node_modules/argparse/lib/action/append/constant.js +47 -0
- package/node_modules/argparse/lib/action/append.js +53 -0
- package/node_modules/argparse/lib/action/count.js +40 -0
- package/node_modules/argparse/lib/action/help.js +47 -0
- package/node_modules/argparse/lib/action/store/constant.js +43 -0
- package/node_modules/argparse/lib/action/store/false.js +27 -0
- package/node_modules/argparse/lib/action/store/true.js +26 -0
- package/node_modules/argparse/lib/action/store.js +50 -0
- package/node_modules/argparse/lib/action/subparsers.js +149 -0
- package/node_modules/argparse/lib/action/version.js +47 -0
- package/node_modules/argparse/lib/action.js +146 -0
- package/node_modules/argparse/lib/action_container.js +482 -0
- package/node_modules/argparse/lib/argparse.js +14 -0
- package/node_modules/argparse/lib/argument/error.js +50 -0
- package/node_modules/argparse/lib/argument/exclusive.js +54 -0
- package/node_modules/argparse/lib/argument/group.js +75 -0
- package/node_modules/argparse/lib/argument_parser.js +1161 -0
- package/node_modules/argparse/lib/const.js +21 -0
- package/node_modules/argparse/lib/help/added_formatters.js +87 -0
- package/node_modules/argparse/lib/help/formatter.js +795 -0
- package/node_modules/argparse/lib/namespace.js +76 -0
- package/node_modules/argparse/lib/utils.js +57 -0
- package/node_modules/argparse/package.json +34 -0
- package/node_modules/esprima/LICENSE.BSD +21 -0
- package/node_modules/esprima/README.md +46 -0
- package/node_modules/esprima/bin/esparse.js +139 -0
- package/node_modules/esprima/bin/esvalidate.js +236 -0
- package/node_modules/esprima/dist/esprima.js +6709 -0
- package/node_modules/esprima/package.json +112 -0
- package/node_modules/extend-shallow/LICENSE +21 -0
- package/node_modules/extend-shallow/README.md +61 -0
- package/node_modules/extend-shallow/index.js +33 -0
- package/node_modules/extend-shallow/package.json +56 -0
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +143 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +53 -0
- package/node_modules/graceful-fs/polyfills.js +355 -0
- package/node_modules/gray-matter/LICENSE +21 -0
- package/node_modules/gray-matter/README.md +565 -0
- package/node_modules/gray-matter/gray-matter.d.ts +114 -0
- package/node_modules/gray-matter/index.js +228 -0
- package/node_modules/gray-matter/lib/defaults.js +18 -0
- package/node_modules/gray-matter/lib/engine.js +30 -0
- package/node_modules/gray-matter/lib/engines.js +54 -0
- package/node_modules/gray-matter/lib/excerpt.js +32 -0
- package/node_modules/gray-matter/lib/parse.js +13 -0
- package/node_modules/gray-matter/lib/stringify.js +56 -0
- package/node_modules/gray-matter/lib/to-file.js +43 -0
- package/node_modules/gray-matter/lib/utils.js +66 -0
- package/node_modules/gray-matter/package.json +127 -0
- package/node_modules/is-extendable/LICENSE +21 -0
- package/node_modules/is-extendable/README.md +72 -0
- package/node_modules/is-extendable/index.js +13 -0
- package/node_modules/is-extendable/package.json +51 -0
- package/node_modules/js-yaml/LICENSE +21 -0
- package/node_modules/js-yaml/README.md +302 -0
- package/node_modules/js-yaml/bin/js-yaml.js +132 -0
- package/node_modules/js-yaml/dist/js-yaml.js +4024 -0
- package/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
- package/node_modules/js-yaml/index.js +7 -0
- package/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
- package/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
- package/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
- package/node_modules/js-yaml/lib/js-yaml/loader.js +1679 -0
- package/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- package/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
- package/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
- package/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
- package/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
- package/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
- package/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- package/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
- package/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
- package/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
- package/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
- package/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
- package/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- package/node_modules/js-yaml/lib/js-yaml.js +39 -0
- package/node_modules/js-yaml/package.json +52 -0
- package/node_modules/kind-of/LICENSE +21 -0
- package/node_modules/kind-of/README.md +367 -0
- package/node_modules/kind-of/index.js +129 -0
- package/node_modules/kind-of/package.json +88 -0
- package/node_modules/node-addon-api/common 2.gypi +21 -0
- package/node_modules/node-addon-api/except 2.gypi +25 -0
- package/node_modules/node-addon-api/napi 2.h +3463 -0
- package/node_modules/node-addon-api/napi-inl 2.h +7250 -0
- package/node_modules/node-addon-api/napi-inl.deprecated 2.h +186 -0
- package/node_modules/node-addon-api/node_addon_api 2.gyp +42 -0
- package/node_modules/node-addon-api/node_api 2.gyp +9 -0
- package/node_modules/node-addon-api/noexcept 2.gypi +26 -0
- package/node_modules/node-addon-api/nothing 2.c +0 -0
- package/node_modules/pi-toggle-skills/README.md +213 -0
- package/node_modules/pi-toggle-skills/package.json +60 -0
- package/node_modules/pi-toggle-skills/src/index.ts +112 -0
- package/node_modules/pi-toggle-skills/src/skill-discovery.ts +258 -0
- package/node_modules/pi-toggle-skills/src/skill-selector.ts +435 -0
- package/node_modules/pi-toggle-skills/toggle-skills 2.ts +316 -0
- package/node_modules/pi-toggle-skills/toggle-skills.ts +316 -0
- package/node_modules/pi-toggle-skills/vitest.config 2.ts +15 -0
- package/node_modules/pi-toggle-skills/vitest.config.ts +15 -0
- package/node_modules/proper-lockfile/LICENSE +21 -0
- package/node_modules/proper-lockfile/README.md +183 -0
- package/node_modules/proper-lockfile/index.js +40 -0
- package/node_modules/proper-lockfile/lib/adapter.js +85 -0
- package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
- package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
- package/node_modules/proper-lockfile/node_modules/retry/.npmignore +3 -0
- package/node_modules/proper-lockfile/node_modules/retry/.travis.yml +15 -0
- package/node_modules/proper-lockfile/node_modules/retry/License +21 -0
- package/node_modules/proper-lockfile/node_modules/retry/Makefile +18 -0
- package/node_modules/proper-lockfile/node_modules/retry/README.md +227 -0
- package/node_modules/proper-lockfile/node_modules/retry/equation.gif +0 -0
- package/node_modules/proper-lockfile/node_modules/retry/example/dns.js +31 -0
- package/node_modules/proper-lockfile/node_modules/retry/example/stop.js +40 -0
- package/node_modules/proper-lockfile/node_modules/retry/index.js +1 -0
- package/node_modules/proper-lockfile/node_modules/retry/lib/retry.js +100 -0
- package/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js +158 -0
- package/node_modules/proper-lockfile/node_modules/retry/package.json +32 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/common.js +10 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-forever.js +24 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-operation.js +258 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-timeouts.js +69 -0
- package/node_modules/proper-lockfile/package.json +71 -0
- package/node_modules/section-matter/LICENSE +21 -0
- package/node_modules/section-matter/README.md +236 -0
- package/node_modules/section-matter/index.js +136 -0
- package/node_modules/section-matter/package.json +55 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/sprintf-js/.npmignore +1 -0
- package/node_modules/sprintf-js/.npmignore 2 +1 -0
- package/node_modules/sprintf-js/LICENSE +24 -0
- package/node_modules/sprintf-js/LICENSE 2 +24 -0
- package/node_modules/sprintf-js/README 2.md +88 -0
- package/node_modules/sprintf-js/README.md +88 -0
- package/node_modules/sprintf-js/bower 2.json +14 -0
- package/node_modules/sprintf-js/bower.json +14 -0
- package/node_modules/sprintf-js/demo/angular.html +20 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
- package/node_modules/sprintf-js/gruntfile 2.js +36 -0
- package/node_modules/sprintf-js/gruntfile.js +36 -0
- package/node_modules/sprintf-js/package 2.json +22 -0
- package/node_modules/sprintf-js/package.json +22 -0
- package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
- package/node_modules/sprintf-js/src/sprintf.js +208 -0
- package/node_modules/sprintf-js/test/test.js +82 -0
- package/node_modules/strip-bom-string/LICENSE +21 -0
- package/node_modules/strip-bom-string/README.md +66 -0
- package/node_modules/strip-bom-string/index.js +15 -0
- package/node_modules/strip-bom-string/package.json +60 -0
- package/node_modules/tree-sitter-bash/tree-sitter-bash 2.wasm +0 -0
- package/node_modules/typebox/license 2 +23 -0
- package/node_modules/typebox/package 2.json +87 -0
- package/node_modules/typebox/readme 2.md +370 -0
- package/node_modules/zod/compile 2.cjs +96 -0
- package/node_modules/zod/compile 2.js +52 -0
- package/node_modules/zod/index 2.cjs +52 -0
- package/node_modules/zod/index 2.js +7 -0
- package/package.json +13 -4
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var common = require('./common');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function Mark(name, buffer, position, line, column) {
|
|
8
|
+
this.name = name;
|
|
9
|
+
this.buffer = buffer;
|
|
10
|
+
this.position = position;
|
|
11
|
+
this.line = line;
|
|
12
|
+
this.column = column;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
|
|
17
|
+
var head, start, tail, end, snippet;
|
|
18
|
+
|
|
19
|
+
if (!this.buffer) return null;
|
|
20
|
+
|
|
21
|
+
indent = indent || 4;
|
|
22
|
+
maxLength = maxLength || 75;
|
|
23
|
+
|
|
24
|
+
head = '';
|
|
25
|
+
start = this.position;
|
|
26
|
+
|
|
27
|
+
while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
|
|
28
|
+
start -= 1;
|
|
29
|
+
if (this.position - start > (maxLength / 2 - 1)) {
|
|
30
|
+
head = ' ... ';
|
|
31
|
+
start += 5;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
tail = '';
|
|
37
|
+
end = this.position;
|
|
38
|
+
|
|
39
|
+
while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
|
|
40
|
+
end += 1;
|
|
41
|
+
if (end - this.position > (maxLength / 2 - 1)) {
|
|
42
|
+
tail = ' ... ';
|
|
43
|
+
end -= 5;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
snippet = this.buffer.slice(start, end);
|
|
49
|
+
|
|
50
|
+
return common.repeat(' ', indent) + head + snippet + tail + '\n' +
|
|
51
|
+
common.repeat(' ', indent + this.position - start + head.length) + '^';
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Mark.prototype.toString = function toString(compact) {
|
|
56
|
+
var snippet, where = '';
|
|
57
|
+
|
|
58
|
+
if (this.name) {
|
|
59
|
+
where += 'in "' + this.name + '" ';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
|
|
63
|
+
|
|
64
|
+
if (!compact) {
|
|
65
|
+
snippet = this.getSnippet();
|
|
66
|
+
|
|
67
|
+
if (snippet) {
|
|
68
|
+
where += ':\n' + snippet;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return where;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
module.exports = Mark;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Standard YAML's Core schema.
|
|
2
|
+
// http://www.yaml.org/spec/1.2/spec.html#id2804923
|
|
3
|
+
//
|
|
4
|
+
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
|
|
5
|
+
// So, Core schema has no distinctions from JSON schema is JS-YAML.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var Schema = require('../schema');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
module.exports = new Schema({
|
|
15
|
+
include: [
|
|
16
|
+
require('./json')
|
|
17
|
+
]
|
|
18
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// JS-YAML's default schema for `load` function.
|
|
2
|
+
// It is not described in the YAML specification.
|
|
3
|
+
//
|
|
4
|
+
// This schema is based on JS-YAML's default safe schema and includes
|
|
5
|
+
// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
|
|
6
|
+
//
|
|
7
|
+
// Also this schema is used as default base schema at `Schema.create` function.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var Schema = require('../schema');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
module.exports = Schema.DEFAULT = new Schema({
|
|
17
|
+
include: [
|
|
18
|
+
require('./default_safe')
|
|
19
|
+
],
|
|
20
|
+
explicit: [
|
|
21
|
+
require('../type/js/undefined'),
|
|
22
|
+
require('../type/js/regexp'),
|
|
23
|
+
require('../type/js/function')
|
|
24
|
+
]
|
|
25
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// JS-YAML's default schema for `safeLoad` function.
|
|
2
|
+
// It is not described in the YAML specification.
|
|
3
|
+
//
|
|
4
|
+
// This schema is based on standard YAML's Core schema and includes most of
|
|
5
|
+
// extra types described at YAML tag repository. (http://yaml.org/type/)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var Schema = require('../schema');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
module.exports = new Schema({
|
|
15
|
+
include: [
|
|
16
|
+
require('./core')
|
|
17
|
+
],
|
|
18
|
+
implicit: [
|
|
19
|
+
require('../type/timestamp'),
|
|
20
|
+
require('../type/merge')
|
|
21
|
+
],
|
|
22
|
+
explicit: [
|
|
23
|
+
require('../type/binary'),
|
|
24
|
+
require('../type/omap'),
|
|
25
|
+
require('../type/pairs'),
|
|
26
|
+
require('../type/set')
|
|
27
|
+
]
|
|
28
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Standard YAML's Failsafe schema.
|
|
2
|
+
// http://www.yaml.org/spec/1.2/spec.html#id2802346
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var Schema = require('../schema');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
module.exports = new Schema({
|
|
12
|
+
explicit: [
|
|
13
|
+
require('../type/str'),
|
|
14
|
+
require('../type/seq'),
|
|
15
|
+
require('../type/map')
|
|
16
|
+
]
|
|
17
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Standard YAML's JSON schema.
|
|
2
|
+
// http://www.yaml.org/spec/1.2/spec.html#id2803231
|
|
3
|
+
//
|
|
4
|
+
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
|
|
5
|
+
// So, this schema is not such strict as defined in the YAML specification.
|
|
6
|
+
// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var Schema = require('../schema');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
module.exports = new Schema({
|
|
16
|
+
include: [
|
|
17
|
+
require('./failsafe')
|
|
18
|
+
],
|
|
19
|
+
implicit: [
|
|
20
|
+
require('../type/null'),
|
|
21
|
+
require('../type/bool'),
|
|
22
|
+
require('../type/int'),
|
|
23
|
+
require('../type/float')
|
|
24
|
+
]
|
|
25
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*eslint-disable max-len*/
|
|
4
|
+
|
|
5
|
+
var common = require('./common');
|
|
6
|
+
var YAMLException = require('./exception');
|
|
7
|
+
var Type = require('./type');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
function compileList(schema, name, result) {
|
|
11
|
+
var exclude = [];
|
|
12
|
+
|
|
13
|
+
schema.include.forEach(function (includedSchema) {
|
|
14
|
+
result = compileList(includedSchema, name, result);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
schema[name].forEach(function (currentType) {
|
|
18
|
+
result.forEach(function (previousType, previousIndex) {
|
|
19
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
|
20
|
+
exclude.push(previousIndex);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
result.push(currentType);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return result.filter(function (type, index) {
|
|
28
|
+
return exclude.indexOf(index) === -1;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
function compileMap(/* lists... */) {
|
|
34
|
+
var result = {
|
|
35
|
+
scalar: {},
|
|
36
|
+
sequence: {},
|
|
37
|
+
mapping: {},
|
|
38
|
+
fallback: {}
|
|
39
|
+
}, index, length;
|
|
40
|
+
|
|
41
|
+
function collectType(type) {
|
|
42
|
+
result[type.kind][type.tag] = result['fallback'][type.tag] = type;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
46
|
+
arguments[index].forEach(collectType);
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
function Schema(definition) {
|
|
53
|
+
this.include = definition.include || [];
|
|
54
|
+
this.implicit = definition.implicit || [];
|
|
55
|
+
this.explicit = definition.explicit || [];
|
|
56
|
+
|
|
57
|
+
this.implicit.forEach(function (type) {
|
|
58
|
+
if (type.loadKind && type.loadKind !== 'scalar') {
|
|
59
|
+
throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
this.compiledImplicit = compileList(this, 'implicit', []);
|
|
64
|
+
this.compiledExplicit = compileList(this, 'explicit', []);
|
|
65
|
+
this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
Schema.DEFAULT = null;
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
Schema.create = function createSchema() {
|
|
73
|
+
var schemas, types;
|
|
74
|
+
|
|
75
|
+
switch (arguments.length) {
|
|
76
|
+
case 1:
|
|
77
|
+
schemas = Schema.DEFAULT;
|
|
78
|
+
types = arguments[0];
|
|
79
|
+
break;
|
|
80
|
+
|
|
81
|
+
case 2:
|
|
82
|
+
schemas = arguments[0];
|
|
83
|
+
types = arguments[1];
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
default:
|
|
87
|
+
throw new YAMLException('Wrong number of arguments for Schema.create function');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
schemas = common.toArray(schemas);
|
|
91
|
+
types = common.toArray(types);
|
|
92
|
+
|
|
93
|
+
if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
|
|
94
|
+
throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!types.every(function (type) { return type instanceof Type; })) {
|
|
98
|
+
throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return new Schema({
|
|
102
|
+
include: schemas,
|
|
103
|
+
explicit: types
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
module.exports = Schema;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*eslint-disable no-bitwise*/
|
|
4
|
+
|
|
5
|
+
var NodeBuffer;
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
// A trick for browserified version, to not include `Buffer` shim
|
|
9
|
+
var _require = require;
|
|
10
|
+
NodeBuffer = _require('buffer').Buffer;
|
|
11
|
+
} catch (__) {}
|
|
12
|
+
|
|
13
|
+
var Type = require('../type');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// [ 64, 65, 66 ] -> [ padding, CR, LF ]
|
|
17
|
+
var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function resolveYamlBinary(data) {
|
|
21
|
+
if (data === null) return false;
|
|
22
|
+
|
|
23
|
+
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
|
24
|
+
|
|
25
|
+
// Convert one by one.
|
|
26
|
+
for (idx = 0; idx < max; idx++) {
|
|
27
|
+
code = map.indexOf(data.charAt(idx));
|
|
28
|
+
|
|
29
|
+
// Skip CR/LF
|
|
30
|
+
if (code > 64) continue;
|
|
31
|
+
|
|
32
|
+
// Fail on illegal characters
|
|
33
|
+
if (code < 0) return false;
|
|
34
|
+
|
|
35
|
+
bitlen += 6;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// If there are any bits left, source was corrupted
|
|
39
|
+
return (bitlen % 8) === 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function constructYamlBinary(data) {
|
|
43
|
+
var idx, tailbits,
|
|
44
|
+
input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
|
|
45
|
+
max = input.length,
|
|
46
|
+
map = BASE64_MAP,
|
|
47
|
+
bits = 0,
|
|
48
|
+
result = [];
|
|
49
|
+
|
|
50
|
+
// Collect by 6*4 bits (3 bytes)
|
|
51
|
+
|
|
52
|
+
for (idx = 0; idx < max; idx++) {
|
|
53
|
+
if ((idx % 4 === 0) && idx) {
|
|
54
|
+
result.push((bits >> 16) & 0xFF);
|
|
55
|
+
result.push((bits >> 8) & 0xFF);
|
|
56
|
+
result.push(bits & 0xFF);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
bits = (bits << 6) | map.indexOf(input.charAt(idx));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Dump tail
|
|
63
|
+
|
|
64
|
+
tailbits = (max % 4) * 6;
|
|
65
|
+
|
|
66
|
+
if (tailbits === 0) {
|
|
67
|
+
result.push((bits >> 16) & 0xFF);
|
|
68
|
+
result.push((bits >> 8) & 0xFF);
|
|
69
|
+
result.push(bits & 0xFF);
|
|
70
|
+
} else if (tailbits === 18) {
|
|
71
|
+
result.push((bits >> 10) & 0xFF);
|
|
72
|
+
result.push((bits >> 2) & 0xFF);
|
|
73
|
+
} else if (tailbits === 12) {
|
|
74
|
+
result.push((bits >> 4) & 0xFF);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Wrap into Buffer for NodeJS and leave Array for browser
|
|
78
|
+
if (NodeBuffer) {
|
|
79
|
+
// Support node 6.+ Buffer API when available
|
|
80
|
+
return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function representYamlBinary(object /*, style*/) {
|
|
87
|
+
var result = '', bits = 0, idx, tail,
|
|
88
|
+
max = object.length,
|
|
89
|
+
map = BASE64_MAP;
|
|
90
|
+
|
|
91
|
+
// Convert every three bytes to 4 ASCII characters.
|
|
92
|
+
|
|
93
|
+
for (idx = 0; idx < max; idx++) {
|
|
94
|
+
if ((idx % 3 === 0) && idx) {
|
|
95
|
+
result += map[(bits >> 18) & 0x3F];
|
|
96
|
+
result += map[(bits >> 12) & 0x3F];
|
|
97
|
+
result += map[(bits >> 6) & 0x3F];
|
|
98
|
+
result += map[bits & 0x3F];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
bits = (bits << 8) + object[idx];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Dump tail
|
|
105
|
+
|
|
106
|
+
tail = max % 3;
|
|
107
|
+
|
|
108
|
+
if (tail === 0) {
|
|
109
|
+
result += map[(bits >> 18) & 0x3F];
|
|
110
|
+
result += map[(bits >> 12) & 0x3F];
|
|
111
|
+
result += map[(bits >> 6) & 0x3F];
|
|
112
|
+
result += map[bits & 0x3F];
|
|
113
|
+
} else if (tail === 2) {
|
|
114
|
+
result += map[(bits >> 10) & 0x3F];
|
|
115
|
+
result += map[(bits >> 4) & 0x3F];
|
|
116
|
+
result += map[(bits << 2) & 0x3F];
|
|
117
|
+
result += map[64];
|
|
118
|
+
} else if (tail === 1) {
|
|
119
|
+
result += map[(bits >> 2) & 0x3F];
|
|
120
|
+
result += map[(bits << 4) & 0x3F];
|
|
121
|
+
result += map[64];
|
|
122
|
+
result += map[64];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function isBinary(object) {
|
|
129
|
+
return NodeBuffer && NodeBuffer.isBuffer(object);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
module.exports = new Type('tag:yaml.org,2002:binary', {
|
|
133
|
+
kind: 'scalar',
|
|
134
|
+
resolve: resolveYamlBinary,
|
|
135
|
+
construct: constructYamlBinary,
|
|
136
|
+
predicate: isBinary,
|
|
137
|
+
represent: representYamlBinary
|
|
138
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Type = require('../type');
|
|
4
|
+
|
|
5
|
+
function resolveYamlBoolean(data) {
|
|
6
|
+
if (data === null) return false;
|
|
7
|
+
|
|
8
|
+
var max = data.length;
|
|
9
|
+
|
|
10
|
+
return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
|
|
11
|
+
(max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function constructYamlBoolean(data) {
|
|
15
|
+
return data === 'true' ||
|
|
16
|
+
data === 'True' ||
|
|
17
|
+
data === 'TRUE';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function isBoolean(object) {
|
|
21
|
+
return Object.prototype.toString.call(object) === '[object Boolean]';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = new Type('tag:yaml.org,2002:bool', {
|
|
25
|
+
kind: 'scalar',
|
|
26
|
+
resolve: resolveYamlBoolean,
|
|
27
|
+
construct: constructYamlBoolean,
|
|
28
|
+
predicate: isBoolean,
|
|
29
|
+
represent: {
|
|
30
|
+
lowercase: function (object) { return object ? 'true' : 'false'; },
|
|
31
|
+
uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
|
|
32
|
+
camelcase: function (object) { return object ? 'True' : 'False'; }
|
|
33
|
+
},
|
|
34
|
+
defaultStyle: 'lowercase'
|
|
35
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('../common');
|
|
4
|
+
var Type = require('../type');
|
|
5
|
+
|
|
6
|
+
var YAML_FLOAT_PATTERN = new RegExp(
|
|
7
|
+
// 2.5e4, 2.5 and integers
|
|
8
|
+
'^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
|
|
9
|
+
// .2e4, .2
|
|
10
|
+
// special case, seems not from spec
|
|
11
|
+
'|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
|
|
12
|
+
// 20:59
|
|
13
|
+
'|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
|
|
14
|
+
// .inf
|
|
15
|
+
'|[-+]?\\.(?:inf|Inf|INF)' +
|
|
16
|
+
// .nan
|
|
17
|
+
'|\\.(?:nan|NaN|NAN))$');
|
|
18
|
+
|
|
19
|
+
function resolveYamlFloat(data) {
|
|
20
|
+
if (data === null) return false;
|
|
21
|
+
|
|
22
|
+
if (!YAML_FLOAT_PATTERN.test(data) ||
|
|
23
|
+
// Quick hack to not allow integers end with `_`
|
|
24
|
+
// Probably should update regexp & check speed
|
|
25
|
+
data[data.length - 1] === '_') {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function constructYamlFloat(data) {
|
|
33
|
+
var value, sign, base, digits;
|
|
34
|
+
|
|
35
|
+
value = data.replace(/_/g, '').toLowerCase();
|
|
36
|
+
sign = value[0] === '-' ? -1 : 1;
|
|
37
|
+
digits = [];
|
|
38
|
+
|
|
39
|
+
if ('+-'.indexOf(value[0]) >= 0) {
|
|
40
|
+
value = value.slice(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (value === '.inf') {
|
|
44
|
+
return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
45
|
+
|
|
46
|
+
} else if (value === '.nan') {
|
|
47
|
+
return NaN;
|
|
48
|
+
|
|
49
|
+
} else if (value.indexOf(':') >= 0) {
|
|
50
|
+
value.split(':').forEach(function (v) {
|
|
51
|
+
digits.unshift(parseFloat(v, 10));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
value = 0.0;
|
|
55
|
+
base = 1;
|
|
56
|
+
|
|
57
|
+
digits.forEach(function (d) {
|
|
58
|
+
value += d * base;
|
|
59
|
+
base *= 60;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return sign * value;
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
return sign * parseFloat(value, 10);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
70
|
+
|
|
71
|
+
function representYamlFloat(object, style) {
|
|
72
|
+
var res;
|
|
73
|
+
|
|
74
|
+
if (isNaN(object)) {
|
|
75
|
+
switch (style) {
|
|
76
|
+
case 'lowercase': return '.nan';
|
|
77
|
+
case 'uppercase': return '.NAN';
|
|
78
|
+
case 'camelcase': return '.NaN';
|
|
79
|
+
}
|
|
80
|
+
} else if (Number.POSITIVE_INFINITY === object) {
|
|
81
|
+
switch (style) {
|
|
82
|
+
case 'lowercase': return '.inf';
|
|
83
|
+
case 'uppercase': return '.INF';
|
|
84
|
+
case 'camelcase': return '.Inf';
|
|
85
|
+
}
|
|
86
|
+
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
87
|
+
switch (style) {
|
|
88
|
+
case 'lowercase': return '-.inf';
|
|
89
|
+
case 'uppercase': return '-.INF';
|
|
90
|
+
case 'camelcase': return '-.Inf';
|
|
91
|
+
}
|
|
92
|
+
} else if (common.isNegativeZero(object)) {
|
|
93
|
+
return '-0.0';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
res = object.toString(10);
|
|
97
|
+
|
|
98
|
+
// JS stringifier can build scientific format without dots: 5e-100,
|
|
99
|
+
// while YAML requres dot: 5.e-100. Fix it with simple hack
|
|
100
|
+
|
|
101
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function isFloat(object) {
|
|
105
|
+
return (Object.prototype.toString.call(object) === '[object Number]') &&
|
|
106
|
+
(object % 1 !== 0 || common.isNegativeZero(object));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
module.exports = new Type('tag:yaml.org,2002:float', {
|
|
110
|
+
kind: 'scalar',
|
|
111
|
+
resolve: resolveYamlFloat,
|
|
112
|
+
construct: constructYamlFloat,
|
|
113
|
+
predicate: isFloat,
|
|
114
|
+
represent: representYamlFloat,
|
|
115
|
+
defaultStyle: 'lowercase'
|
|
116
|
+
});
|