@socketsecurity/cli-with-sentry 0.15.11 → 0.15.12
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/bin/cli.js +6 -6
- package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/cli.js +5731 -6607
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +274 -305
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +28 -34
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/shadow-bin.js +96 -123
- package/dist/shadow-bin.js.map +1 -1
- package/dist/shadow-inject.js +470 -580
- package/dist/shadow-inject.js.map +1 -1
- package/dist/socket-completion.bash +221 -0
- package/dist/types/cli.d.mts +2 -2
- package/dist/types/commands/analytics/cmd-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -6
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -7
- package/dist/types/commands/analytics/handle-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -1
- package/dist/types/commands/analytics/output-analytics.d.mts +26 -46
- package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -16
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -47
- package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +9 -15
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/ci/cmd-ci.d.mts +9 -15
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +3 -3
- package/dist/types/commands/ci/handle-ci.d.mts +2 -2
- package/dist/types/commands/config/cmd-config-auto.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-get.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-list.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-set.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-unset.d.mts +9 -15
- package/dist/types/commands/config/cmd-config.d.mts +3 -3
- package/dist/types/commands/config/discover-config-value.d.mts +3 -5
- package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-auto.d.mts +7 -10
- package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-get.d.mts +7 -10
- package/dist/types/commands/config/handle-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-set.d.mts +8 -12
- package/dist/types/commands/config/handle-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-unset.d.mts +7 -10
- package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-auto.d.mts +4 -8
- package/dist/types/commands/config/output-config-get.d.mts +4 -8
- package/dist/types/commands/config/output-config-list.d.mts +6 -9
- package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-set.d.mts +3 -6
- package/dist/types/commands/config/output-config-unset.d.mts +3 -6
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts +9 -15
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -10
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -11
- package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -15
- package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +9 -15
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -3
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts +9 -15
- package/dist/types/commands/fix/git.d.mts +14 -49
- package/dist/types/commands/fix/npm-fix.d.mts +4 -16
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/open-pr.d.mts +20 -46
- package/dist/types/commands/fix/open-pr.d.mts.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts +4 -16
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/run-fix.d.mts +3 -3
- package/dist/types/commands/fix/shared.d.mts +9 -15
- package/dist/types/commands/fix/types.d.mts +16 -16
- package/dist/types/commands/info/cmd-info.d.mts +9 -15
- package/dist/types/commands/info/fetch-package-info.d.mts +3 -7
- package/dist/types/commands/info/handle-package-info.d.mts +15 -22
- package/dist/types/commands/info/handle-package-info.d.mts.map +1 -1
- package/dist/types/commands/info/output-package-info.d.mts +10 -18
- package/dist/types/commands/info/output-package-info.d.mts.map +1 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/cmd-install.d.mts +3 -0
- package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
- package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
- package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/output-install-completion.d.mts +12 -0
- package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/login/apply-login.d.mts +2 -7
- package/dist/types/commands/login/attempt-login.d.mts +2 -5
- package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
- package/dist/types/commands/login/cmd-login.d.mts +9 -15
- package/dist/types/commands/logout/apply-logout.d.mts +2 -2
- package/dist/types/commands/logout/attempt-logout.d.mts +2 -2
- package/dist/types/commands/logout/cmd-logout.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +7 -15
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts +3 -9
- package/dist/types/commands/manifest/output-requirements.d.mts +6 -10
- package/dist/types/commands/{cdxgen → manifest}/run-cdxgen.d.mts +2 -2
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/npm/cmd-npm.d.mts +9 -15
- package/dist/types/commands/npx/cmd-npx.d.mts +9 -15
- package/dist/types/commands/oops/cmd-oops.d.mts +9 -15
- package/dist/types/commands/optimize/add-overrides.d.mts +18 -22
- package/dist/types/commands/optimize/apply-optimization.d.mts +2 -6
- package/dist/types/commands/optimize/cmd-optimize.d.mts +9 -15
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -7
- package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -5
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +8 -11
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -10
- package/dist/types/commands/optimize/ls-by-agent.d.mts +6 -13
- package/dist/types/commands/optimize/shared.d.mts +2 -2
- package/dist/types/commands/optimize/types.d.mts +7 -7
- package/dist/types/commands/optimize/update-lockfile.d.mts +9 -12
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -11
- package/dist/types/commands/organization/cmd-organization-list.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -3
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization.d.mts +3 -3
- package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -6
- package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -6
- package/dist/types/commands/organization/fetch-quota.d.mts +4 -6
- package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -6
- package/dist/types/commands/organization/handle-license-policy.d.mts +3 -6
- package/dist/types/commands/organization/handle-organization-list.d.mts +3 -5
- package/dist/types/commands/organization/handle-quota.d.mts +3 -3
- package/dist/types/commands/organization/handle-security-policy.d.mts +3 -6
- package/dist/types/commands/organization/output-license-policy.d.mts +4 -7
- package/dist/types/commands/organization/output-organization-list.d.mts +4 -7
- package/dist/types/commands/organization/output-quota.d.mts +4 -7
- package/dist/types/commands/organization/output-security-policy.d.mts +4 -7
- package/dist/types/commands/package/cmd-package-score.d.mts +9 -15
- package/dist/types/commands/package/cmd-package-shallow.d.mts +16 -22
- package/dist/types/commands/package/cmd-package.d.mts +3 -3
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts +49 -51
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -6
- package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -6
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -9
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -1
- package/dist/types/commands/package/output-purl-score.d.mts +4 -8
- package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -8
- package/dist/types/commands/package/parse-package-specifiers.d.mts +5 -8
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +9 -15
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -4
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +9 -15
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -4
- package/dist/types/commands/report/cmd-report-create.d.mts +9 -15
- package/dist/types/commands/report/cmd-report-view.d.mts +9 -15
- package/dist/types/commands/report/cmd-report.d.mts +3 -3
- package/dist/types/commands/repos/cmd-repos-create.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-del.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-list.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-update.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-view.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos.d.mts +3 -3
- package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -7
- package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -16
- package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -7
- package/dist/types/commands/repos/handle-create-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -7
- package/dist/types/commands/repos/handle-list-repos.d.mts +10 -17
- package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-update-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-view-repo.d.mts +3 -7
- package/dist/types/commands/repos/output-create-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-delete-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-list-repos.d.mts +4 -7
- package/dist/types/commands/repos/output-update-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-view-repo.d.mts +4 -7
- package/dist/types/commands/scan/cmd-scan-create.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-del.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan.d.mts +3 -3
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -26
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -22
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-report-data.d.mts +8 -14
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -7
- package/dist/types/commands/scan/fetch-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -6
- package/dist/types/commands/scan/generate-report.d.mts +36 -50
- package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts +20 -37
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -7
- package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-list-scans.d.mts +13 -23
- package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -7
- package/dist/types/commands/scan/handle-scan-report.d.mts +12 -21
- package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-view.d.mts +3 -8
- package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -8
- package/dist/types/commands/scan/output-delete-scan.d.mts +4 -7
- package/dist/types/commands/scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-list-scans.d.mts +4 -7
- package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -8
- package/dist/types/commands/scan/output-scan-report.d.mts +20 -38
- package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-view.d.mts +4 -10
- package/dist/types/commands/scan/stream-scan.d.mts +2 -6
- package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -2
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +4 -4
- package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -4
- package/dist/types/commands/scan/suggest_target.d.mts +2 -2
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +9 -15
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -16
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -17
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -7
- package/dist/types/commands/threat-feed/types.d.mts +12 -12
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -2
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +9 -15
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -1
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -2
- package/dist/types/constants.d.mts +125 -135
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/flags.d.mts +14 -17
- package/dist/types/flags.d.mts.map +1 -1
- package/dist/types/instrument-with-sentry.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/index.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +19 -24
- package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts +43 -71
- package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts +3 -8
- package/dist/types/shadow/npm/arborist/lib/edge.d.mts +58 -71
- package/dist/types/shadow/npm/arborist/lib/node.d.mts +55 -91
- package/dist/types/shadow/npm/arborist/lib/override-set.d.mts +26 -32
- package/dist/types/shadow/npm/arborist-helpers.d.mts +33 -66
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
- package/dist/types/shadow/npm/bin.d.mts +2 -5
- package/dist/types/shadow/npm/inject.d.mts +2 -2
- package/dist/types/shadow/npm/install.d.mts +11 -16
- package/dist/types/shadow/npm/link.d.mts +2 -5
- package/dist/types/shadow/npm/paths.d.mts +7 -7
- package/dist/types/shadow/npm/proc-log/index.d.mts +3 -6
- package/dist/types/types.d.mts +15 -17
- package/dist/types/utils/agent.d.mts +11 -14
- package/dist/types/utils/alert/artifact.d.mts +32 -50
- package/dist/types/utils/alert/fix.d.mts +5 -5
- package/dist/types/utils/alert/severity.d.mts +12 -24
- package/dist/types/utils/alerts-map.d.mts +23 -36
- package/dist/types/utils/api.d.mts +11 -34
- package/dist/types/utils/check-input.d.mts +9 -12
- package/dist/types/utils/cmd.d.mts +4 -4
- package/dist/types/utils/color-or-markdown.d.mts +14 -23
- package/dist/types/utils/color-or-markdown.d.mts.map +1 -1
- package/dist/types/utils/completion.d.mts +11 -0
- package/dist/types/utils/completion.d.mts.map +1 -0
- package/dist/types/utils/config.d.mts +22 -31
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/determine-org-slug.d.mts +2 -7
- package/dist/types/utils/errors.d.mts +12 -21
- package/dist/types/utils/fail-msg-with-badge.d.mts +2 -5
- package/dist/types/utils/fs.d.mts +21 -52
- package/dist/types/utils/get-output-kind.d.mts +3 -6
- package/dist/types/utils/glob.d.mts +13 -24
- package/dist/types/utils/map-to-object.d.mts +4 -6
- package/dist/types/utils/markdown.d.mts +4 -15
- package/dist/types/utils/meow-with-subcommands.d.mts +34 -46
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/npm-paths.d.mts +7 -7
- package/dist/types/utils/npm-paths.d.mts.map +1 -1
- package/dist/types/utils/objects.d.mts +3 -8
- package/dist/types/utils/output-formatting.d.mts +14 -24
- package/dist/types/utils/package-environment.d.mts +51 -72
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/types/utils/path-resolve.d.mts +9 -14
- package/dist/types/utils/pnpm.d.mts +9 -7
- package/dist/types/utils/pnpm.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts +8 -12
- package/dist/types/utils/semver.d.mts +5 -17
- package/dist/types/utils/serialize-result-json.d.mts +3 -3
- package/dist/types/utils/socket-package-alert.d.mts +62 -81
- package/dist/types/utils/socket-url.d.mts +9 -15
- package/dist/types/utils/spec.d.mts +4 -7
- package/dist/types/utils/spec.d.mts.map +1 -1
- package/dist/types/utils/strings.d.mts +2 -5
- package/dist/types/utils/translations.d.mts +592 -592
- package/dist/types/utils/walk-nested-map.d.mts +7 -10
- package/dist/utils.js +1531 -1833
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +38333 -51605
- package/dist/vendor.js.map +1 -1
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +5 -8
- package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +2 -4
- package/external/@socketsecurity/registry/external/cacache.js +1 -2
- package/external/@socketsecurity/registry/external/libnpmpack.js +36 -76
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +31 -67
- package/external/@socketsecurity/registry/external/pacote.js +36 -76
- package/external/@socketsecurity/registry/external/tinyglobby.js +3 -6
- package/external/@socketsecurity/registry/external/which.js +2 -4
- package/external/@socketsecurity/registry/lib/logger.d.ts +3 -1
- package/external/@socketsecurity/registry/lib/logger.js +149 -69
- package/external/@socketsecurity/registry/package.json +2 -2
- package/external/blessed/lib/alias.js +475 -468
- package/external/blessed/lib/blessed.js +12 -12
- package/external/blessed/lib/colors.js +234 -194
- package/external/blessed/lib/events.js +64 -70
- package/external/blessed/lib/gpmclient.js +117 -141
- package/external/blessed/lib/helpers.js +89 -94
- package/external/blessed/lib/keys.js +169 -342
- package/external/blessed/lib/program.js +2130 -2365
- package/external/blessed/lib/tput.js +1183 -1276
- package/external/blessed/lib/unicode.js +400 -522
- package/external/blessed/lib/widget.js +14 -14
- package/external/blessed/lib/widgets/ansiimage.js +90 -96
- package/external/blessed/lib/widgets/bigtext.js +91 -102
- package/external/blessed/lib/widgets/box.js +8 -8
- package/external/blessed/lib/widgets/button.js +23 -23
- package/external/blessed/lib/widgets/checkbox.js +50 -54
- package/external/blessed/lib/widgets/element.js +1415 -1716
- package/external/blessed/lib/widgets/filemanager.js +107 -118
- package/external/blessed/lib/widgets/form.js +144 -178
- package/external/blessed/lib/widgets/image.js +26 -36
- package/external/blessed/lib/widgets/input.js +8 -8
- package/external/blessed/lib/widgets/layout.js +103 -119
- package/external/blessed/lib/widgets/line.js +17 -20
- package/external/blessed/lib/widgets/list.js +349 -402
- package/external/blessed/lib/widgets/listbar.js +265 -306
- package/external/blessed/lib/widgets/listtable.js +133 -146
- package/external/blessed/lib/widgets/loading.js +31 -31
- package/external/blessed/lib/widgets/log.js +41 -40
- package/external/blessed/lib/widgets/message.js +64 -86
- package/external/blessed/lib/widgets/node.js +175 -207
- package/external/blessed/lib/widgets/overlayimage.js +360 -437
- package/external/blessed/lib/widgets/progressbar.js +79 -88
- package/external/blessed/lib/widgets/prompt.js +54 -61
- package/external/blessed/lib/widgets/question.js +48 -61
- package/external/blessed/lib/widgets/radiobutton.js +26 -27
- package/external/blessed/lib/widgets/radioset.js +8 -8
- package/external/blessed/lib/widgets/screen.js +1186 -1375
- package/external/blessed/lib/widgets/scrollablebox.js +202 -228
- package/external/blessed/lib/widgets/scrollabletext.js +9 -9
- package/external/blessed/lib/widgets/table.js +187 -216
- package/external/blessed/lib/widgets/terminal.js +258 -298
- package/external/blessed/lib/widgets/text.js +9 -9
- package/external/blessed/lib/widgets/textarea.js +188 -222
- package/external/blessed/lib/widgets/textbox.js +34 -36
- package/external/blessed/lib/widgets/video.js +55 -59
- package/external/blessed/usr/fonts/ter-u14b.json +1 -1
- package/external/blessed/usr/fonts/ter-u14n.json +1 -1
- package/external/blessed/vendor/tng.js +1016 -1144
- package/external/blessed-contrib/lib/layout/grid.js +345 -377
- package/external/blessed-contrib/lib/widget/charts/bar.js +6612 -7139
- package/external/blessed-contrib/lib/widget/charts/line.js +16224 -23941
- package/external/blessed-contrib/lib/widget/table.js +78 -96
- package/package.json +8 -8
- package/dist/types/commands/cdxgen/run-cdxgen.d.mts.map +0 -1
|
@@ -105,40 +105,40 @@
|
|
|
105
105
|
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
106
106
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
var stringFromCharCode = String.fromCharCode;
|
|
109
|
+
var floor = Math.floor;
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* Wide, Surrogates, and Combining
|
|
113
113
|
*/
|
|
114
114
|
|
|
115
|
-
exports.charWidth = function
|
|
116
|
-
|
|
115
|
+
exports.charWidth = function(str, i) {
|
|
116
|
+
var point = typeof str !== 'number'
|
|
117
|
+
? exports.codePointAt(str, i || 0)
|
|
118
|
+
: str;
|
|
117
119
|
|
|
118
120
|
// nul
|
|
119
|
-
if (point === 0)
|
|
120
|
-
return 0
|
|
121
|
-
}
|
|
121
|
+
if (point === 0) return 0;
|
|
122
122
|
|
|
123
123
|
// tab
|
|
124
124
|
if (point === 0x09) {
|
|
125
125
|
if (!exports.blessed) {
|
|
126
|
-
exports.blessed = require('../')
|
|
126
|
+
exports.blessed = require('../');
|
|
127
127
|
}
|
|
128
128
|
return exports.blessed.screen.global
|
|
129
129
|
? exports.blessed.screen.global.tabc.length
|
|
130
|
-
: 8
|
|
130
|
+
: 8;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
// 8-bit control characters (2-width according to unicode??)
|
|
134
134
|
if (point < 32 || (point >= 0x7f && point < 0xa0)) {
|
|
135
|
-
return 0
|
|
135
|
+
return 0;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// search table of non-spacing characters
|
|
139
139
|
// is ucs combining or C0/C1 control character
|
|
140
140
|
if (exports.combining[point]) {
|
|
141
|
-
return 0
|
|
141
|
+
return 0;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// check for double-wide
|
|
@@ -159,457 +159,355 @@ exports.charWidth = function (str, i) {
|
|
|
159
159
|
// }
|
|
160
160
|
|
|
161
161
|
// check for double-wide
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
) {
|
|
167
|
-
return 2
|
|
162
|
+
if ((0x3000 === point)
|
|
163
|
+
|| (0xFF01 <= point && point <= 0xFF60)
|
|
164
|
+
|| (0xFFE0 <= point && point <= 0xFFE6)) {
|
|
165
|
+
return 2;
|
|
168
166
|
}
|
|
169
167
|
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
) {
|
|
210
|
-
return 2
|
|
168
|
+
if ((0x1100 <= point && point <= 0x115F)
|
|
169
|
+
|| (0x11A3 <= point && point <= 0x11A7)
|
|
170
|
+
|| (0x11FA <= point && point <= 0x11FF)
|
|
171
|
+
|| (0x2329 <= point && point <= 0x232A)
|
|
172
|
+
|| (0x2E80 <= point && point <= 0x2E99)
|
|
173
|
+
|| (0x2E9B <= point && point <= 0x2EF3)
|
|
174
|
+
|| (0x2F00 <= point && point <= 0x2FD5)
|
|
175
|
+
|| (0x2FF0 <= point && point <= 0x2FFB)
|
|
176
|
+
|| (0x3001 <= point && point <= 0x303E)
|
|
177
|
+
|| (0x3041 <= point && point <= 0x3096)
|
|
178
|
+
|| (0x3099 <= point && point <= 0x30FF)
|
|
179
|
+
|| (0x3105 <= point && point <= 0x312D)
|
|
180
|
+
|| (0x3131 <= point && point <= 0x318E)
|
|
181
|
+
|| (0x3190 <= point && point <= 0x31BA)
|
|
182
|
+
|| (0x31C0 <= point && point <= 0x31E3)
|
|
183
|
+
|| (0x31F0 <= point && point <= 0x321E)
|
|
184
|
+
|| (0x3220 <= point && point <= 0x3247)
|
|
185
|
+
|| (0x3250 <= point && point <= 0x32FE)
|
|
186
|
+
|| (0x3300 <= point && point <= 0x4DBF)
|
|
187
|
+
|| (0x4E00 <= point && point <= 0xA48C)
|
|
188
|
+
|| (0xA490 <= point && point <= 0xA4C6)
|
|
189
|
+
|| (0xA960 <= point && point <= 0xA97C)
|
|
190
|
+
|| (0xAC00 <= point && point <= 0xD7A3)
|
|
191
|
+
|| (0xD7B0 <= point && point <= 0xD7C6)
|
|
192
|
+
|| (0xD7CB <= point && point <= 0xD7FB)
|
|
193
|
+
|| (0xF900 <= point && point <= 0xFAFF)
|
|
194
|
+
|| (0xFE10 <= point && point <= 0xFE19)
|
|
195
|
+
|| (0xFE30 <= point && point <= 0xFE52)
|
|
196
|
+
|| (0xFE54 <= point && point <= 0xFE66)
|
|
197
|
+
|| (0xFE68 <= point && point <= 0xFE6B)
|
|
198
|
+
|| (0x1B000 <= point && point <= 0x1B001)
|
|
199
|
+
|| (0x1F200 <= point && point <= 0x1F202)
|
|
200
|
+
|| (0x1F210 <= point && point <= 0x1F23A)
|
|
201
|
+
|| (0x1F240 <= point && point <= 0x1F248)
|
|
202
|
+
|| (0x1F250 <= point && point <= 0x1F251)
|
|
203
|
+
|| (0x20000 <= point && point <= 0x2F73F)
|
|
204
|
+
|| (0x2B740 <= point && point <= 0x2FFFD)
|
|
205
|
+
|| (0x30000 <= point && point <= 0x3FFFD)) {
|
|
206
|
+
return 2;
|
|
211
207
|
}
|
|
212
208
|
|
|
213
209
|
// CJK Ambiguous
|
|
214
210
|
// http://www.unicode.org/reports/tr11/
|
|
215
211
|
// http://www.unicode.org/reports/tr11/#Ambiguous
|
|
216
212
|
if (process.env.NCURSES_CJK_WIDTH) {
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
) {
|
|
392
|
-
return +process.env.NCURSES_CJK_WIDTH || 1
|
|
213
|
+
if ((0x00A1 === point)
|
|
214
|
+
|| (0x00A4 === point)
|
|
215
|
+
|| (0x00A7 <= point && point <= 0x00A8)
|
|
216
|
+
|| (0x00AA === point)
|
|
217
|
+
|| (0x00AD <= point && point <= 0x00AE)
|
|
218
|
+
|| (0x00B0 <= point && point <= 0x00B4)
|
|
219
|
+
|| (0x00B6 <= point && point <= 0x00BA)
|
|
220
|
+
|| (0x00BC <= point && point <= 0x00BF)
|
|
221
|
+
|| (0x00C6 === point)
|
|
222
|
+
|| (0x00D0 === point)
|
|
223
|
+
|| (0x00D7 <= point && point <= 0x00D8)
|
|
224
|
+
|| (0x00DE <= point && point <= 0x00E1)
|
|
225
|
+
|| (0x00E6 === point)
|
|
226
|
+
|| (0x00E8 <= point && point <= 0x00EA)
|
|
227
|
+
|| (0x00EC <= point && point <= 0x00ED)
|
|
228
|
+
|| (0x00F0 === point)
|
|
229
|
+
|| (0x00F2 <= point && point <= 0x00F3)
|
|
230
|
+
|| (0x00F7 <= point && point <= 0x00FA)
|
|
231
|
+
|| (0x00FC === point)
|
|
232
|
+
|| (0x00FE === point)
|
|
233
|
+
|| (0x0101 === point)
|
|
234
|
+
|| (0x0111 === point)
|
|
235
|
+
|| (0x0113 === point)
|
|
236
|
+
|| (0x011B === point)
|
|
237
|
+
|| (0x0126 <= point && point <= 0x0127)
|
|
238
|
+
|| (0x012B === point)
|
|
239
|
+
|| (0x0131 <= point && point <= 0x0133)
|
|
240
|
+
|| (0x0138 === point)
|
|
241
|
+
|| (0x013F <= point && point <= 0x0142)
|
|
242
|
+
|| (0x0144 === point)
|
|
243
|
+
|| (0x0148 <= point && point <= 0x014B)
|
|
244
|
+
|| (0x014D === point)
|
|
245
|
+
|| (0x0152 <= point && point <= 0x0153)
|
|
246
|
+
|| (0x0166 <= point && point <= 0x0167)
|
|
247
|
+
|| (0x016B === point)
|
|
248
|
+
|| (0x01CE === point)
|
|
249
|
+
|| (0x01D0 === point)
|
|
250
|
+
|| (0x01D2 === point)
|
|
251
|
+
|| (0x01D4 === point)
|
|
252
|
+
|| (0x01D6 === point)
|
|
253
|
+
|| (0x01D8 === point)
|
|
254
|
+
|| (0x01DA === point)
|
|
255
|
+
|| (0x01DC === point)
|
|
256
|
+
|| (0x0251 === point)
|
|
257
|
+
|| (0x0261 === point)
|
|
258
|
+
|| (0x02C4 === point)
|
|
259
|
+
|| (0x02C7 === point)
|
|
260
|
+
|| (0x02C9 <= point && point <= 0x02CB)
|
|
261
|
+
|| (0x02CD === point)
|
|
262
|
+
|| (0x02D0 === point)
|
|
263
|
+
|| (0x02D8 <= point && point <= 0x02DB)
|
|
264
|
+
|| (0x02DD === point)
|
|
265
|
+
|| (0x02DF === point)
|
|
266
|
+
|| (0x0300 <= point && point <= 0x036F)
|
|
267
|
+
|| (0x0391 <= point && point <= 0x03A1)
|
|
268
|
+
|| (0x03A3 <= point && point <= 0x03A9)
|
|
269
|
+
|| (0x03B1 <= point && point <= 0x03C1)
|
|
270
|
+
|| (0x03C3 <= point && point <= 0x03C9)
|
|
271
|
+
|| (0x0401 === point)
|
|
272
|
+
|| (0x0410 <= point && point <= 0x044F)
|
|
273
|
+
|| (0x0451 === point)
|
|
274
|
+
|| (0x2010 === point)
|
|
275
|
+
|| (0x2013 <= point && point <= 0x2016)
|
|
276
|
+
|| (0x2018 <= point && point <= 0x2019)
|
|
277
|
+
|| (0x201C <= point && point <= 0x201D)
|
|
278
|
+
|| (0x2020 <= point && point <= 0x2022)
|
|
279
|
+
|| (0x2024 <= point && point <= 0x2027)
|
|
280
|
+
|| (0x2030 === point)
|
|
281
|
+
|| (0x2032 <= point && point <= 0x2033)
|
|
282
|
+
|| (0x2035 === point)
|
|
283
|
+
|| (0x203B === point)
|
|
284
|
+
|| (0x203E === point)
|
|
285
|
+
|| (0x2074 === point)
|
|
286
|
+
|| (0x207F === point)
|
|
287
|
+
|| (0x2081 <= point && point <= 0x2084)
|
|
288
|
+
|| (0x20AC === point)
|
|
289
|
+
|| (0x2103 === point)
|
|
290
|
+
|| (0x2105 === point)
|
|
291
|
+
|| (0x2109 === point)
|
|
292
|
+
|| (0x2113 === point)
|
|
293
|
+
|| (0x2116 === point)
|
|
294
|
+
|| (0x2121 <= point && point <= 0x2122)
|
|
295
|
+
|| (0x2126 === point)
|
|
296
|
+
|| (0x212B === point)
|
|
297
|
+
|| (0x2153 <= point && point <= 0x2154)
|
|
298
|
+
|| (0x215B <= point && point <= 0x215E)
|
|
299
|
+
|| (0x2160 <= point && point <= 0x216B)
|
|
300
|
+
|| (0x2170 <= point && point <= 0x2179)
|
|
301
|
+
|| (0x2189 === point)
|
|
302
|
+
|| (0x2190 <= point && point <= 0x2199)
|
|
303
|
+
|| (0x21B8 <= point && point <= 0x21B9)
|
|
304
|
+
|| (0x21D2 === point)
|
|
305
|
+
|| (0x21D4 === point)
|
|
306
|
+
|| (0x21E7 === point)
|
|
307
|
+
|| (0x2200 === point)
|
|
308
|
+
|| (0x2202 <= point && point <= 0x2203)
|
|
309
|
+
|| (0x2207 <= point && point <= 0x2208)
|
|
310
|
+
|| (0x220B === point)
|
|
311
|
+
|| (0x220F === point)
|
|
312
|
+
|| (0x2211 === point)
|
|
313
|
+
|| (0x2215 === point)
|
|
314
|
+
|| (0x221A === point)
|
|
315
|
+
|| (0x221D <= point && point <= 0x2220)
|
|
316
|
+
|| (0x2223 === point)
|
|
317
|
+
|| (0x2225 === point)
|
|
318
|
+
|| (0x2227 <= point && point <= 0x222C)
|
|
319
|
+
|| (0x222E === point)
|
|
320
|
+
|| (0x2234 <= point && point <= 0x2237)
|
|
321
|
+
|| (0x223C <= point && point <= 0x223D)
|
|
322
|
+
|| (0x2248 === point)
|
|
323
|
+
|| (0x224C === point)
|
|
324
|
+
|| (0x2252 === point)
|
|
325
|
+
|| (0x2260 <= point && point <= 0x2261)
|
|
326
|
+
|| (0x2264 <= point && point <= 0x2267)
|
|
327
|
+
|| (0x226A <= point && point <= 0x226B)
|
|
328
|
+
|| (0x226E <= point && point <= 0x226F)
|
|
329
|
+
|| (0x2282 <= point && point <= 0x2283)
|
|
330
|
+
|| (0x2286 <= point && point <= 0x2287)
|
|
331
|
+
|| (0x2295 === point)
|
|
332
|
+
|| (0x2299 === point)
|
|
333
|
+
|| (0x22A5 === point)
|
|
334
|
+
|| (0x22BF === point)
|
|
335
|
+
|| (0x2312 === point)
|
|
336
|
+
|| (0x2460 <= point && point <= 0x24E9)
|
|
337
|
+
|| (0x24EB <= point && point <= 0x254B)
|
|
338
|
+
|| (0x2550 <= point && point <= 0x2573)
|
|
339
|
+
|| (0x2580 <= point && point <= 0x258F)
|
|
340
|
+
|| (0x2592 <= point && point <= 0x2595)
|
|
341
|
+
|| (0x25A0 <= point && point <= 0x25A1)
|
|
342
|
+
|| (0x25A3 <= point && point <= 0x25A9)
|
|
343
|
+
|| (0x25B2 <= point && point <= 0x25B3)
|
|
344
|
+
|| (0x25B6 <= point && point <= 0x25B7)
|
|
345
|
+
|| (0x25BC <= point && point <= 0x25BD)
|
|
346
|
+
|| (0x25C0 <= point && point <= 0x25C1)
|
|
347
|
+
|| (0x25C6 <= point && point <= 0x25C8)
|
|
348
|
+
|| (0x25CB === point)
|
|
349
|
+
|| (0x25CE <= point && point <= 0x25D1)
|
|
350
|
+
|| (0x25E2 <= point && point <= 0x25E5)
|
|
351
|
+
|| (0x25EF === point)
|
|
352
|
+
|| (0x2605 <= point && point <= 0x2606)
|
|
353
|
+
|| (0x2609 === point)
|
|
354
|
+
|| (0x260E <= point && point <= 0x260F)
|
|
355
|
+
|| (0x2614 <= point && point <= 0x2615)
|
|
356
|
+
|| (0x261C === point)
|
|
357
|
+
|| (0x261E === point)
|
|
358
|
+
|| (0x2640 === point)
|
|
359
|
+
|| (0x2642 === point)
|
|
360
|
+
|| (0x2660 <= point && point <= 0x2661)
|
|
361
|
+
|| (0x2663 <= point && point <= 0x2665)
|
|
362
|
+
|| (0x2667 <= point && point <= 0x266A)
|
|
363
|
+
|| (0x266C <= point && point <= 0x266D)
|
|
364
|
+
|| (0x266F === point)
|
|
365
|
+
|| (0x269E <= point && point <= 0x269F)
|
|
366
|
+
|| (0x26BE <= point && point <= 0x26BF)
|
|
367
|
+
|| (0x26C4 <= point && point <= 0x26CD)
|
|
368
|
+
|| (0x26CF <= point && point <= 0x26E1)
|
|
369
|
+
|| (0x26E3 === point)
|
|
370
|
+
|| (0x26E8 <= point && point <= 0x26FF)
|
|
371
|
+
|| (0x273D === point)
|
|
372
|
+
|| (0x2757 === point)
|
|
373
|
+
|| (0x2776 <= point && point <= 0x277F)
|
|
374
|
+
|| (0x2B55 <= point && point <= 0x2B59)
|
|
375
|
+
|| (0x3248 <= point && point <= 0x324F)
|
|
376
|
+
|| (0xE000 <= point && point <= 0xF8FF)
|
|
377
|
+
|| (0xFE00 <= point && point <= 0xFE0F)
|
|
378
|
+
|| (0xFFFD === point)
|
|
379
|
+
|| (0x1F100 <= point && point <= 0x1F10A)
|
|
380
|
+
|| (0x1F110 <= point && point <= 0x1F12D)
|
|
381
|
+
|| (0x1F130 <= point && point <= 0x1F169)
|
|
382
|
+
|| (0x1F170 <= point && point <= 0x1F19A)
|
|
383
|
+
|| (0xE0100 <= point && point <= 0xE01EF)
|
|
384
|
+
|| (0xF0000 <= point && point <= 0xFFFFD)
|
|
385
|
+
|| (0x100000 <= point && point <= 0x10FFFD)) {
|
|
386
|
+
return +process.env.NCURSES_CJK_WIDTH || 1;
|
|
393
387
|
}
|
|
394
388
|
}
|
|
395
389
|
|
|
396
|
-
return 1
|
|
397
|
-
}
|
|
390
|
+
return 1;
|
|
391
|
+
};
|
|
398
392
|
|
|
399
|
-
exports.strWidth = function
|
|
400
|
-
|
|
401
|
-
for (
|
|
402
|
-
width += exports.charWidth(str, i)
|
|
403
|
-
if (exports.isSurrogate(str, i))
|
|
404
|
-
i++
|
|
405
|
-
}
|
|
393
|
+
exports.strWidth = function(str) {
|
|
394
|
+
var width = 0;
|
|
395
|
+
for (var i = 0; i < str.length; i++) {
|
|
396
|
+
width += exports.charWidth(str, i);
|
|
397
|
+
if (exports.isSurrogate(str, i)) i++;
|
|
406
398
|
}
|
|
407
|
-
return width
|
|
408
|
-
}
|
|
399
|
+
return width;
|
|
400
|
+
};
|
|
409
401
|
|
|
410
|
-
exports.isSurrogate = function
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
402
|
+
exports.isSurrogate = function(str, i) {
|
|
403
|
+
var point = typeof str !== 'number'
|
|
404
|
+
? exports.codePointAt(str, i || 0)
|
|
405
|
+
: str;
|
|
406
|
+
return point > 0x00ffff;
|
|
407
|
+
};
|
|
414
408
|
|
|
415
409
|
exports.combiningTable = [
|
|
416
|
-
[0x0300,
|
|
417
|
-
[
|
|
418
|
-
[
|
|
419
|
-
[
|
|
420
|
-
[
|
|
421
|
-
[
|
|
422
|
-
[
|
|
423
|
-
[
|
|
424
|
-
[
|
|
425
|
-
[
|
|
426
|
-
[
|
|
427
|
-
[
|
|
428
|
-
[
|
|
429
|
-
[
|
|
430
|
-
[
|
|
431
|
-
[
|
|
432
|
-
[
|
|
433
|
-
[
|
|
434
|
-
[
|
|
435
|
-
[
|
|
436
|
-
[
|
|
437
|
-
[
|
|
438
|
-
[
|
|
439
|
-
[
|
|
440
|
-
[
|
|
441
|
-
[
|
|
442
|
-
[
|
|
443
|
-
[
|
|
444
|
-
[
|
|
445
|
-
[
|
|
446
|
-
[
|
|
447
|
-
[
|
|
448
|
-
[
|
|
449
|
-
[
|
|
450
|
-
[
|
|
451
|
-
[
|
|
452
|
-
[
|
|
453
|
-
[
|
|
454
|
-
[
|
|
455
|
-
[
|
|
456
|
-
[
|
|
457
|
-
[
|
|
458
|
-
[
|
|
459
|
-
[
|
|
460
|
-
[
|
|
461
|
-
[
|
|
462
|
-
[
|
|
463
|
-
[
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
[
|
|
468
|
-
|
|
469
|
-
[0x0c46, 0x0c48],
|
|
470
|
-
[0x0c4a, 0x0c4d],
|
|
471
|
-
[0x0c55, 0x0c56],
|
|
472
|
-
[0x0cbc, 0x0cbc],
|
|
473
|
-
[0x0cbf, 0x0cbf],
|
|
474
|
-
[0x0cc6, 0x0cc6],
|
|
475
|
-
[0x0ccc, 0x0ccd],
|
|
476
|
-
[0x0ce2, 0x0ce3],
|
|
477
|
-
[0x0d41, 0x0d43],
|
|
478
|
-
[0x0d4d, 0x0d4d],
|
|
479
|
-
[0x0dca, 0x0dca],
|
|
480
|
-
[0x0dd2, 0x0dd4],
|
|
481
|
-
[0x0dd6, 0x0dd6],
|
|
482
|
-
[0x0e31, 0x0e31],
|
|
483
|
-
[0x0e34, 0x0e3a],
|
|
484
|
-
[0x0e47, 0x0e4e],
|
|
485
|
-
[0x0eb1, 0x0eb1],
|
|
486
|
-
[0x0eb4, 0x0eb9],
|
|
487
|
-
[0x0ebb, 0x0ebc],
|
|
488
|
-
[0x0ec8, 0x0ecd],
|
|
489
|
-
[0x0f18, 0x0f19],
|
|
490
|
-
[0x0f35, 0x0f35],
|
|
491
|
-
[0x0f37, 0x0f37],
|
|
492
|
-
[0x0f39, 0x0f39],
|
|
493
|
-
[0x0f71, 0x0f7e],
|
|
494
|
-
[0x0f80, 0x0f84],
|
|
495
|
-
[0x0f86, 0x0f87],
|
|
496
|
-
[0x0f90, 0x0f97],
|
|
497
|
-
[0x0f99, 0x0fbc],
|
|
498
|
-
[0x0fc6, 0x0fc6],
|
|
499
|
-
[0x102d, 0x1030],
|
|
500
|
-
[0x1032, 0x1032],
|
|
501
|
-
[0x1036, 0x1037],
|
|
502
|
-
[0x1039, 0x1039],
|
|
503
|
-
[0x1058, 0x1059],
|
|
504
|
-
[0x1160, 0x11ff],
|
|
505
|
-
[0x135f, 0x135f],
|
|
506
|
-
[0x1712, 0x1714],
|
|
507
|
-
[0x1732, 0x1734],
|
|
508
|
-
[0x1752, 0x1753],
|
|
509
|
-
[0x1772, 0x1773],
|
|
510
|
-
[0x17b4, 0x17b5],
|
|
511
|
-
[0x17b7, 0x17bd],
|
|
512
|
-
[0x17c6, 0x17c6],
|
|
513
|
-
[0x17c9, 0x17d3],
|
|
514
|
-
[0x17dd, 0x17dd],
|
|
515
|
-
[0x180b, 0x180d],
|
|
516
|
-
[0x18a9, 0x18a9],
|
|
517
|
-
[0x1920, 0x1922],
|
|
518
|
-
[0x1927, 0x1928],
|
|
519
|
-
[0x1932, 0x1932],
|
|
520
|
-
[0x1939, 0x193b],
|
|
521
|
-
[0x1a17, 0x1a18],
|
|
522
|
-
[0x1b00, 0x1b03],
|
|
523
|
-
[0x1b34, 0x1b34],
|
|
524
|
-
[0x1b36, 0x1b3a],
|
|
525
|
-
[0x1b3c, 0x1b3c],
|
|
526
|
-
[0x1b42, 0x1b42],
|
|
527
|
-
[0x1b6b, 0x1b73],
|
|
528
|
-
[0x1dc0, 0x1dca],
|
|
529
|
-
[0x1dfe, 0x1dff],
|
|
530
|
-
[0x200b, 0x200f],
|
|
531
|
-
[0x202a, 0x202e],
|
|
532
|
-
[0x2060, 0x2063],
|
|
533
|
-
[0x206a, 0x206f],
|
|
534
|
-
[0x20d0, 0x20ef],
|
|
535
|
-
[0x302a, 0x302f],
|
|
536
|
-
[0x3099, 0x309a],
|
|
537
|
-
[0xa806, 0xa806],
|
|
538
|
-
[0xa80b, 0xa80b],
|
|
539
|
-
[0xa825, 0xa826],
|
|
540
|
-
[0xfb1e, 0xfb1e],
|
|
541
|
-
[0xfe00, 0xfe0f],
|
|
542
|
-
[0xfe20, 0xfe23],
|
|
543
|
-
[0xfeff, 0xfeff],
|
|
544
|
-
[0xfff9, 0xfffb],
|
|
545
|
-
[0x10a01, 0x10a03],
|
|
546
|
-
[0x10a05, 0x10a06],
|
|
547
|
-
[0x10a0c, 0x10a0f],
|
|
548
|
-
[0x10a38, 0x10a3a],
|
|
549
|
-
[0x10a3f, 0x10a3f],
|
|
550
|
-
[0x1d167, 0x1d169],
|
|
551
|
-
[0x1d173, 0x1d182],
|
|
552
|
-
[0x1d185, 0x1d18b],
|
|
553
|
-
[0x1d1aa, 0x1d1ad],
|
|
554
|
-
[0x1d242, 0x1d244],
|
|
555
|
-
[0xe0001, 0xe0001],
|
|
556
|
-
[0xe0020, 0xe007f],
|
|
557
|
-
[0xe0100, 0xe01ef]
|
|
558
|
-
]
|
|
559
|
-
|
|
560
|
-
exports.combining = exports.combiningTable.reduce(function (out, row) {
|
|
561
|
-
for (let i = row[0]; i <= row[1]; i++) {
|
|
562
|
-
out[i] = true
|
|
410
|
+
[0x0300, 0x036F], [0x0483, 0x0486], [0x0488, 0x0489],
|
|
411
|
+
[0x0591, 0x05BD], [0x05BF, 0x05BF], [0x05C1, 0x05C2],
|
|
412
|
+
[0x05C4, 0x05C5], [0x05C7, 0x05C7], [0x0600, 0x0603],
|
|
413
|
+
[0x0610, 0x0615], [0x064B, 0x065E], [0x0670, 0x0670],
|
|
414
|
+
[0x06D6, 0x06E4], [0x06E7, 0x06E8], [0x06EA, 0x06ED],
|
|
415
|
+
[0x070F, 0x070F], [0x0711, 0x0711], [0x0730, 0x074A],
|
|
416
|
+
[0x07A6, 0x07B0], [0x07EB, 0x07F3], [0x0901, 0x0902],
|
|
417
|
+
[0x093C, 0x093C], [0x0941, 0x0948], [0x094D, 0x094D],
|
|
418
|
+
[0x0951, 0x0954], [0x0962, 0x0963], [0x0981, 0x0981],
|
|
419
|
+
[0x09BC, 0x09BC], [0x09C1, 0x09C4], [0x09CD, 0x09CD],
|
|
420
|
+
[0x09E2, 0x09E3], [0x0A01, 0x0A02], [0x0A3C, 0x0A3C],
|
|
421
|
+
[0x0A41, 0x0A42], [0x0A47, 0x0A48], [0x0A4B, 0x0A4D],
|
|
422
|
+
[0x0A70, 0x0A71], [0x0A81, 0x0A82], [0x0ABC, 0x0ABC],
|
|
423
|
+
[0x0AC1, 0x0AC5], [0x0AC7, 0x0AC8], [0x0ACD, 0x0ACD],
|
|
424
|
+
[0x0AE2, 0x0AE3], [0x0B01, 0x0B01], [0x0B3C, 0x0B3C],
|
|
425
|
+
[0x0B3F, 0x0B3F], [0x0B41, 0x0B43], [0x0B4D, 0x0B4D],
|
|
426
|
+
[0x0B56, 0x0B56], [0x0B82, 0x0B82], [0x0BC0, 0x0BC0],
|
|
427
|
+
[0x0BCD, 0x0BCD], [0x0C3E, 0x0C40], [0x0C46, 0x0C48],
|
|
428
|
+
[0x0C4A, 0x0C4D], [0x0C55, 0x0C56], [0x0CBC, 0x0CBC],
|
|
429
|
+
[0x0CBF, 0x0CBF], [0x0CC6, 0x0CC6], [0x0CCC, 0x0CCD],
|
|
430
|
+
[0x0CE2, 0x0CE3], [0x0D41, 0x0D43], [0x0D4D, 0x0D4D],
|
|
431
|
+
[0x0DCA, 0x0DCA], [0x0DD2, 0x0DD4], [0x0DD6, 0x0DD6],
|
|
432
|
+
[0x0E31, 0x0E31], [0x0E34, 0x0E3A], [0x0E47, 0x0E4E],
|
|
433
|
+
[0x0EB1, 0x0EB1], [0x0EB4, 0x0EB9], [0x0EBB, 0x0EBC],
|
|
434
|
+
[0x0EC8, 0x0ECD], [0x0F18, 0x0F19], [0x0F35, 0x0F35],
|
|
435
|
+
[0x0F37, 0x0F37], [0x0F39, 0x0F39], [0x0F71, 0x0F7E],
|
|
436
|
+
[0x0F80, 0x0F84], [0x0F86, 0x0F87], [0x0F90, 0x0F97],
|
|
437
|
+
[0x0F99, 0x0FBC], [0x0FC6, 0x0FC6], [0x102D, 0x1030],
|
|
438
|
+
[0x1032, 0x1032], [0x1036, 0x1037], [0x1039, 0x1039],
|
|
439
|
+
[0x1058, 0x1059], [0x1160, 0x11FF], [0x135F, 0x135F],
|
|
440
|
+
[0x1712, 0x1714], [0x1732, 0x1734], [0x1752, 0x1753],
|
|
441
|
+
[0x1772, 0x1773], [0x17B4, 0x17B5], [0x17B7, 0x17BD],
|
|
442
|
+
[0x17C6, 0x17C6], [0x17C9, 0x17D3], [0x17DD, 0x17DD],
|
|
443
|
+
[0x180B, 0x180D], [0x18A9, 0x18A9], [0x1920, 0x1922],
|
|
444
|
+
[0x1927, 0x1928], [0x1932, 0x1932], [0x1939, 0x193B],
|
|
445
|
+
[0x1A17, 0x1A18], [0x1B00, 0x1B03], [0x1B34, 0x1B34],
|
|
446
|
+
[0x1B36, 0x1B3A], [0x1B3C, 0x1B3C], [0x1B42, 0x1B42],
|
|
447
|
+
[0x1B6B, 0x1B73], [0x1DC0, 0x1DCA], [0x1DFE, 0x1DFF],
|
|
448
|
+
[0x200B, 0x200F], [0x202A, 0x202E], [0x2060, 0x2063],
|
|
449
|
+
[0x206A, 0x206F], [0x20D0, 0x20EF], [0x302A, 0x302F],
|
|
450
|
+
[0x3099, 0x309A], [0xA806, 0xA806], [0xA80B, 0xA80B],
|
|
451
|
+
[0xA825, 0xA826], [0xFB1E, 0xFB1E], [0xFE00, 0xFE0F],
|
|
452
|
+
[0xFE20, 0xFE23], [0xFEFF, 0xFEFF], [0xFFF9, 0xFFFB],
|
|
453
|
+
[0x10A01, 0x10A03], [0x10A05, 0x10A06], [0x10A0C, 0x10A0F],
|
|
454
|
+
[0x10A38, 0x10A3A], [0x10A3F, 0x10A3F], [0x1D167, 0x1D169],
|
|
455
|
+
[0x1D173, 0x1D182], [0x1D185, 0x1D18B], [0x1D1AA, 0x1D1AD],
|
|
456
|
+
[0x1D242, 0x1D244], [0xE0001, 0xE0001], [0xE0020, 0xE007F],
|
|
457
|
+
[0xE0100, 0xE01EF]
|
|
458
|
+
];
|
|
459
|
+
|
|
460
|
+
exports.combining = exports.combiningTable.reduce(function(out, row) {
|
|
461
|
+
for (var i = row[0]; i <= row[1]; i++) {
|
|
462
|
+
out[i] = true;
|
|
563
463
|
}
|
|
564
|
-
return out
|
|
565
|
-
}, {})
|
|
464
|
+
return out;
|
|
465
|
+
}, {});
|
|
566
466
|
|
|
567
|
-
exports.isCombining = function
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
467
|
+
exports.isCombining = function(str, i) {
|
|
468
|
+
var point = typeof str !== 'number'
|
|
469
|
+
? exports.codePointAt(str, i || 0)
|
|
470
|
+
: str;
|
|
471
|
+
return exports.combining[point] === true;
|
|
472
|
+
};
|
|
571
473
|
|
|
572
474
|
/**
|
|
573
475
|
* Code Point Helpers
|
|
574
476
|
*/
|
|
575
477
|
|
|
576
|
-
exports.codePointAt = function
|
|
478
|
+
exports.codePointAt = function(str, position) {
|
|
577
479
|
if (str == null) {
|
|
578
|
-
throw TypeError()
|
|
480
|
+
throw TypeError();
|
|
579
481
|
}
|
|
580
|
-
|
|
482
|
+
var string = String(str);
|
|
581
483
|
if (string.codePointAt) {
|
|
582
|
-
return string.codePointAt(position)
|
|
484
|
+
return string.codePointAt(position);
|
|
583
485
|
}
|
|
584
|
-
|
|
486
|
+
var size = string.length;
|
|
585
487
|
// `ToInteger`
|
|
586
|
-
|
|
587
|
-
if (index !== index) {
|
|
588
|
-
|
|
589
|
-
index = 0
|
|
488
|
+
var index = position ? Number(position) : 0;
|
|
489
|
+
if (index !== index) { // better `isNaN`
|
|
490
|
+
index = 0;
|
|
590
491
|
}
|
|
591
492
|
// Account for out-of-bounds indices:
|
|
592
493
|
if (index < 0 || index >= size) {
|
|
593
|
-
return undefined
|
|
494
|
+
return undefined;
|
|
594
495
|
}
|
|
595
496
|
// Get the first code unit
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
if (
|
|
599
|
-
|
|
600
|
-
first >= 0xd800 &&
|
|
601
|
-
first <= 0xdbff && // high surrogate
|
|
497
|
+
var first = string.charCodeAt(index);
|
|
498
|
+
var second;
|
|
499
|
+
if ( // check if it’s the start of a surrogate pair
|
|
500
|
+
first >= 0xD800 && first <= 0xDBFF && // high surrogate
|
|
602
501
|
size > index + 1 // there is a next code unit
|
|
603
502
|
) {
|
|
604
|
-
second = string.charCodeAt(index + 1)
|
|
605
|
-
if (second >=
|
|
606
|
-
// low surrogate
|
|
503
|
+
second = string.charCodeAt(index + 1);
|
|
504
|
+
if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
|
|
607
505
|
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
608
|
-
return (first -
|
|
506
|
+
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
|
|
609
507
|
}
|
|
610
508
|
}
|
|
611
|
-
return first
|
|
612
|
-
}
|
|
509
|
+
return first;
|
|
510
|
+
};
|
|
613
511
|
|
|
614
512
|
// exports.codePointAt = function(str, position) {
|
|
615
513
|
// position = +position || 0;
|
|
@@ -625,143 +523,123 @@ exports.codePointAt = function (str, position) {
|
|
|
625
523
|
// return point;
|
|
626
524
|
// };
|
|
627
525
|
|
|
628
|
-
exports.fromCodePoint = function
|
|
526
|
+
exports.fromCodePoint = function() {
|
|
629
527
|
if (String.fromCodePoint) {
|
|
630
|
-
return String.fromCodePoint.apply(String, arguments)
|
|
528
|
+
return String.fromCodePoint.apply(String, arguments);
|
|
631
529
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
530
|
+
var MAX_SIZE = 0x4000;
|
|
531
|
+
var codeUnits = [];
|
|
532
|
+
var highSurrogate;
|
|
533
|
+
var lowSurrogate;
|
|
534
|
+
var index = -1;
|
|
535
|
+
var length = arguments.length;
|
|
638
536
|
if (!length) {
|
|
639
|
-
return ''
|
|
537
|
+
return '';
|
|
640
538
|
}
|
|
641
|
-
|
|
539
|
+
var result = '';
|
|
642
540
|
while (++index < length) {
|
|
643
|
-
|
|
541
|
+
var codePoint = Number(arguments[index]);
|
|
644
542
|
if (
|
|
645
|
-
!isFinite(codePoint) ||
|
|
646
|
-
codePoint < 0 ||
|
|
647
|
-
codePoint >
|
|
543
|
+
!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
|
|
544
|
+
codePoint < 0 || // not a valid Unicode code point
|
|
545
|
+
codePoint > 0x10FFFF || // not a valid Unicode code point
|
|
648
546
|
floor(codePoint) !== codePoint // not an integer
|
|
649
547
|
) {
|
|
650
|
-
throw RangeError('Invalid code point: ' + codePoint)
|
|
548
|
+
throw RangeError('Invalid code point: ' + codePoint);
|
|
651
549
|
}
|
|
652
|
-
if (codePoint <=
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
} else {
|
|
656
|
-
// Astral code point; split in surrogate halves
|
|
550
|
+
if (codePoint <= 0xFFFF) { // BMP code point
|
|
551
|
+
codeUnits.push(codePoint);
|
|
552
|
+
} else { // Astral code point; split in surrogate halves
|
|
657
553
|
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
658
|
-
codePoint -= 0x10000
|
|
659
|
-
highSurrogate = (codePoint >> 10) +
|
|
660
|
-
lowSurrogate = (codePoint % 0x400) +
|
|
661
|
-
codeUnits.push(highSurrogate, lowSurrogate)
|
|
554
|
+
codePoint -= 0x10000;
|
|
555
|
+
highSurrogate = (codePoint >> 10) + 0xD800;
|
|
556
|
+
lowSurrogate = (codePoint % 0x400) + 0xDC00;
|
|
557
|
+
codeUnits.push(highSurrogate, lowSurrogate);
|
|
662
558
|
}
|
|
663
559
|
if (index + 1 === length || codeUnits.length > MAX_SIZE) {
|
|
664
|
-
result += stringFromCharCode.apply(null, codeUnits)
|
|
665
|
-
codeUnits.length = 0
|
|
560
|
+
result += stringFromCharCode.apply(null, codeUnits);
|
|
561
|
+
codeUnits.length = 0;
|
|
666
562
|
}
|
|
667
563
|
}
|
|
668
|
-
return result
|
|
669
|
-
}
|
|
564
|
+
return result;
|
|
565
|
+
};
|
|
670
566
|
|
|
671
567
|
/**
|
|
672
568
|
* Regexes
|
|
673
569
|
*/
|
|
674
570
|
|
|
675
|
-
exports.chars = {}
|
|
571
|
+
exports.chars = {};
|
|
676
572
|
|
|
677
573
|
// Double width characters that are _not_ surrogate pairs.
|
|
678
574
|
// NOTE: 0x20000 - 0x2fffd and 0x30000 - 0x3fffd are not necessary for this
|
|
679
575
|
// regex anyway. This regex is used to put a blank char after wide chars to
|
|
680
576
|
// be eaten, however, if this is a surrogate pair, parseContent already adds
|
|
681
577
|
// the extra one char because its length equals 2 instead of 1.
|
|
682
|
-
exports.chars.wide = new RegExp(
|
|
683
|
-
'
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
'])',
|
|
694
|
-
'g'
|
|
695
|
-
)
|
|
578
|
+
exports.chars.wide = new RegExp('(['
|
|
579
|
+
+ '\\u1100-\\u115f' // Hangul Jamo init. consonants
|
|
580
|
+
+ '\\u2329\\u232a'
|
|
581
|
+
+ '\\u2e80-\\u303e\\u3040-\\ua4cf' // CJK ... Yi
|
|
582
|
+
+ '\\uac00-\\ud7a3' // Hangul Syllables
|
|
583
|
+
+ '\\uf900-\\ufaff' // CJK Compatibility Ideographs
|
|
584
|
+
+ '\\ufe10-\\ufe19' // Vertical forms
|
|
585
|
+
+ '\\ufe30-\\ufe6f' // CJK Compatibility Forms
|
|
586
|
+
+ '\\uff00-\\uff60' // Fullwidth Forms
|
|
587
|
+
+ '\\uffe0-\\uffe6'
|
|
588
|
+
+ '])', 'g');
|
|
696
589
|
|
|
697
590
|
// All surrogate pair wide chars.
|
|
698
|
-
exports.chars.swide = new RegExp(
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
')',
|
|
706
|
-
'g'
|
|
707
|
-
)
|
|
591
|
+
exports.chars.swide = new RegExp('('
|
|
592
|
+
// 0x20000 - 0x2fffd:
|
|
593
|
+
+ '[\\ud840-\\ud87f][\\udc00-\\udffd]'
|
|
594
|
+
+ '|'
|
|
595
|
+
// 0x30000 - 0x3fffd:
|
|
596
|
+
+ '[\\ud880-\\ud8bf][\\udc00-\\udffd]'
|
|
597
|
+
+ ')', 'g');
|
|
708
598
|
|
|
709
599
|
// All wide chars including surrogate pairs.
|
|
710
|
-
exports.chars.all = new RegExp(
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
')',
|
|
716
|
-
'g'
|
|
717
|
-
)
|
|
600
|
+
exports.chars.all = new RegExp('('
|
|
601
|
+
+ exports.chars.swide.source.slice(1, -1)
|
|
602
|
+
+ '|'
|
|
603
|
+
+ exports.chars.wide.source.slice(1, -1)
|
|
604
|
+
+ ')', 'g');
|
|
718
605
|
|
|
719
606
|
// Regex to detect a surrogate pair.
|
|
720
|
-
exports.chars.surrogate = /[\ud800-\udbff][\udc00-\udfff]/g
|
|
607
|
+
exports.chars.surrogate = /[\ud800-\udbff][\udc00-\udfff]/g;
|
|
721
608
|
|
|
722
609
|
// Regex to find combining characters.
|
|
723
|
-
exports.chars.combining = exports.combiningTable.reduce(function
|
|
724
|
-
|
|
610
|
+
exports.chars.combining = exports.combiningTable.reduce(function(out, row) {
|
|
611
|
+
var low, high, range;
|
|
725
612
|
if (row[0] > 0x00ffff) {
|
|
726
|
-
low = exports.fromCodePoint(row[0])
|
|
727
|
-
low = [
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
'\\u' +
|
|
741
|
-
high[1] +
|
|
742
|
-
']'
|
|
743
|
-
if (!~out.indexOf('|')) {
|
|
744
|
-
out += ']'
|
|
745
|
-
}
|
|
746
|
-
out += '|' + range
|
|
613
|
+
low = exports.fromCodePoint(row[0]);
|
|
614
|
+
low = [
|
|
615
|
+
hexify(low.charCodeAt(0)),
|
|
616
|
+
hexify(low.charCodeAt(1))
|
|
617
|
+
];
|
|
618
|
+
high = exports.fromCodePoint(row[1]);
|
|
619
|
+
high = [
|
|
620
|
+
hexify(high.charCodeAt(0)),
|
|
621
|
+
hexify(high.charCodeAt(1))
|
|
622
|
+
];
|
|
623
|
+
range = '[\\u' + low[0] + '-' + '\\u' + high[0] + ']'
|
|
624
|
+
+ '[\\u' + low[1] + '-' + '\\u' + high[1] + ']';
|
|
625
|
+
if (!~out.indexOf('|')) out += ']';
|
|
626
|
+
out += '|' + range;
|
|
747
627
|
} else {
|
|
748
|
-
low = hexify(row[0])
|
|
749
|
-
high = hexify(row[1])
|
|
750
|
-
low = '\\u' + low
|
|
751
|
-
high = '\\u' + high
|
|
752
|
-
out += low + '-' + high
|
|
628
|
+
low = hexify(row[0]);
|
|
629
|
+
high = hexify(row[1]);
|
|
630
|
+
low = '\\u' + low;
|
|
631
|
+
high = '\\u' + high;
|
|
632
|
+
out += low + '-' + high;
|
|
753
633
|
}
|
|
754
|
-
return out
|
|
755
|
-
}, '[')
|
|
634
|
+
return out;
|
|
635
|
+
}, '[');
|
|
756
636
|
|
|
757
|
-
exports.chars.combining = new RegExp(exports.chars.combining, 'g')
|
|
637
|
+
exports.chars.combining = new RegExp(exports.chars.combining, 'g');
|
|
758
638
|
|
|
759
639
|
function hexify(n) {
|
|
760
|
-
n = n.toString(16)
|
|
761
|
-
while (n.length < 4)
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
return n
|
|
640
|
+
n = n.toString(16);
|
|
641
|
+
while (n.length < 4) n = '0' + n;
|
|
642
|
+
return n;
|
|
765
643
|
}
|
|
766
644
|
|
|
767
645
|
/*
|