@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.
Files changed (402) hide show
  1. package/bin/cli.js +6 -6
  2. package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
  3. package/dist/cli.js +5731 -6607
  4. package/dist/cli.js.map +1 -1
  5. package/dist/constants.js +274 -305
  6. package/dist/constants.js.map +1 -1
  7. package/dist/instrument-with-sentry.js +28 -34
  8. package/dist/instrument-with-sentry.js.map +1 -1
  9. package/dist/shadow-bin.js +96 -123
  10. package/dist/shadow-bin.js.map +1 -1
  11. package/dist/shadow-inject.js +470 -580
  12. package/dist/shadow-inject.js.map +1 -1
  13. package/dist/socket-completion.bash +221 -0
  14. package/dist/types/cli.d.mts +2 -2
  15. package/dist/types/commands/analytics/cmd-analytics.d.mts +9 -15
  16. package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -6
  17. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -7
  18. package/dist/types/commands/analytics/handle-analytics.d.mts +9 -15
  19. package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -1
  20. package/dist/types/commands/analytics/output-analytics.d.mts +26 -46
  21. package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
  22. package/dist/types/commands/audit-log/cmd-audit-log.d.mts +9 -15
  23. package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -16
  24. package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
  25. package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -15
  26. package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
  27. package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -47
  28. package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
  29. package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +9 -15
  30. package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -1
  31. package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
  32. package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
  33. package/dist/types/commands/ci/cmd-ci.d.mts +9 -15
  34. package/dist/types/commands/ci/fetch-default-org-slug.d.mts +3 -3
  35. package/dist/types/commands/ci/handle-ci.d.mts +2 -2
  36. package/dist/types/commands/config/cmd-config-auto.d.mts +9 -15
  37. package/dist/types/commands/config/cmd-config-get.d.mts +9 -15
  38. package/dist/types/commands/config/cmd-config-list.d.mts +9 -15
  39. package/dist/types/commands/config/cmd-config-set.d.mts +9 -15
  40. package/dist/types/commands/config/cmd-config-unset.d.mts +9 -15
  41. package/dist/types/commands/config/cmd-config.d.mts +3 -3
  42. package/dist/types/commands/config/discover-config-value.d.mts +3 -5
  43. package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
  44. package/dist/types/commands/config/handle-config-auto.d.mts +7 -10
  45. package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -1
  46. package/dist/types/commands/config/handle-config-get.d.mts +7 -10
  47. package/dist/types/commands/config/handle-config-get.d.mts.map +1 -1
  48. package/dist/types/commands/config/handle-config-set.d.mts +8 -12
  49. package/dist/types/commands/config/handle-config-set.d.mts.map +1 -1
  50. package/dist/types/commands/config/handle-config-unset.d.mts +7 -10
  51. package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -1
  52. package/dist/types/commands/config/output-config-auto.d.mts +4 -8
  53. package/dist/types/commands/config/output-config-get.d.mts +4 -8
  54. package/dist/types/commands/config/output-config-list.d.mts +6 -9
  55. package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
  56. package/dist/types/commands/config/output-config-set.d.mts +3 -6
  57. package/dist/types/commands/config/output-config-unset.d.mts +3 -6
  58. package/dist/types/commands/dependencies/cmd-dependencies.d.mts +9 -15
  59. package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -10
  60. package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -1
  61. package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -11
  62. package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -1
  63. package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -15
  64. package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -1
  65. package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +9 -15
  66. package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -3
  67. package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -12
  68. package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -1
  69. package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -17
  70. package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -1
  71. package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -15
  72. package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -1
  73. package/dist/types/commands/fix/cmd-fix.d.mts +9 -15
  74. package/dist/types/commands/fix/git.d.mts +14 -49
  75. package/dist/types/commands/fix/npm-fix.d.mts +4 -16
  76. package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
  77. package/dist/types/commands/fix/open-pr.d.mts +20 -46
  78. package/dist/types/commands/fix/open-pr.d.mts.map +1 -1
  79. package/dist/types/commands/fix/pnpm-fix.d.mts +4 -16
  80. package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
  81. package/dist/types/commands/fix/run-fix.d.mts +3 -3
  82. package/dist/types/commands/fix/shared.d.mts +9 -15
  83. package/dist/types/commands/fix/types.d.mts +16 -16
  84. package/dist/types/commands/info/cmd-info.d.mts +9 -15
  85. package/dist/types/commands/info/fetch-package-info.d.mts +3 -7
  86. package/dist/types/commands/info/handle-package-info.d.mts +15 -22
  87. package/dist/types/commands/info/handle-package-info.d.mts.map +1 -1
  88. package/dist/types/commands/info/output-package-info.d.mts +10 -18
  89. package/dist/types/commands/info/output-package-info.d.mts.map +1 -1
  90. package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
  91. package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
  92. package/dist/types/commands/install/cmd-install.d.mts +3 -0
  93. package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
  94. package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
  95. package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
  96. package/dist/types/commands/install/output-install-completion.d.mts +12 -0
  97. package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
  98. package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
  99. package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
  100. package/dist/types/commands/login/apply-login.d.mts +2 -7
  101. package/dist/types/commands/login/attempt-login.d.mts +2 -5
  102. package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
  103. package/dist/types/commands/login/cmd-login.d.mts +9 -15
  104. package/dist/types/commands/logout/apply-logout.d.mts +2 -2
  105. package/dist/types/commands/logout/attempt-logout.d.mts +2 -2
  106. package/dist/types/commands/logout/cmd-logout.d.mts +9 -15
  107. package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +9 -15
  108. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
  109. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
  110. package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +9 -15
  111. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +9 -15
  112. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +9 -15
  113. package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +9 -15
  114. package/dist/types/commands/manifest/cmd-manifest.d.mts +9 -15
  115. package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
  116. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +7 -15
  117. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -8
  118. package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +2 -8
  119. package/dist/types/commands/manifest/handle-manifest-conda.d.mts +3 -9
  120. package/dist/types/commands/manifest/output-requirements.d.mts +6 -10
  121. package/dist/types/commands/{cdxgen → manifest}/run-cdxgen.d.mts +2 -2
  122. package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
  123. package/dist/types/commands/npm/cmd-npm.d.mts +9 -15
  124. package/dist/types/commands/npx/cmd-npx.d.mts +9 -15
  125. package/dist/types/commands/oops/cmd-oops.d.mts +9 -15
  126. package/dist/types/commands/optimize/add-overrides.d.mts +18 -22
  127. package/dist/types/commands/optimize/apply-optimization.d.mts +2 -6
  128. package/dist/types/commands/optimize/cmd-optimize.d.mts +9 -15
  129. package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -7
  130. package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -5
  131. package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +8 -11
  132. package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -10
  133. package/dist/types/commands/optimize/ls-by-agent.d.mts +6 -13
  134. package/dist/types/commands/optimize/shared.d.mts +2 -2
  135. package/dist/types/commands/optimize/types.d.mts +7 -7
  136. package/dist/types/commands/optimize/update-lockfile.d.mts +9 -12
  137. package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -11
  138. package/dist/types/commands/organization/cmd-organization-list.d.mts +9 -15
  139. package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +9 -15
  140. package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +9 -15
  141. package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -3
  142. package/dist/types/commands/organization/cmd-organization-quota.d.mts +9 -15
  143. package/dist/types/commands/organization/cmd-organization.d.mts +3 -3
  144. package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -6
  145. package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -6
  146. package/dist/types/commands/organization/fetch-quota.d.mts +4 -6
  147. package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -6
  148. package/dist/types/commands/organization/handle-license-policy.d.mts +3 -6
  149. package/dist/types/commands/organization/handle-organization-list.d.mts +3 -5
  150. package/dist/types/commands/organization/handle-quota.d.mts +3 -3
  151. package/dist/types/commands/organization/handle-security-policy.d.mts +3 -6
  152. package/dist/types/commands/organization/output-license-policy.d.mts +4 -7
  153. package/dist/types/commands/organization/output-organization-list.d.mts +4 -7
  154. package/dist/types/commands/organization/output-quota.d.mts +4 -7
  155. package/dist/types/commands/organization/output-security-policy.d.mts +4 -7
  156. package/dist/types/commands/package/cmd-package-score.d.mts +9 -15
  157. package/dist/types/commands/package/cmd-package-shallow.d.mts +16 -22
  158. package/dist/types/commands/package/cmd-package.d.mts +3 -3
  159. package/dist/types/commands/package/fetch-purl-deep-score.d.mts +49 -51
  160. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -6
  161. package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -6
  162. package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -9
  163. package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -1
  164. package/dist/types/commands/package/output-purl-score.d.mts +4 -8
  165. package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -8
  166. package/dist/types/commands/package/parse-package-specifiers.d.mts +5 -8
  167. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +9 -15
  168. package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -4
  169. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +9 -15
  170. package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -4
  171. package/dist/types/commands/report/cmd-report-create.d.mts +9 -15
  172. package/dist/types/commands/report/cmd-report-view.d.mts +9 -15
  173. package/dist/types/commands/report/cmd-report.d.mts +3 -3
  174. package/dist/types/commands/repos/cmd-repos-create.d.mts +9 -15
  175. package/dist/types/commands/repos/cmd-repos-del.d.mts +9 -15
  176. package/dist/types/commands/repos/cmd-repos-list.d.mts +9 -15
  177. package/dist/types/commands/repos/cmd-repos-update.d.mts +9 -15
  178. package/dist/types/commands/repos/cmd-repos-view.d.mts +9 -15
  179. package/dist/types/commands/repos/cmd-repos.d.mts +3 -3
  180. package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -18
  181. package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -1
  182. package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -7
  183. package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -16
  184. package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -1
  185. package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -18
  186. package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -1
  187. package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -7
  188. package/dist/types/commands/repos/handle-create-repo.d.mts +10 -20
  189. package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -1
  190. package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -7
  191. package/dist/types/commands/repos/handle-list-repos.d.mts +10 -17
  192. package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -1
  193. package/dist/types/commands/repos/handle-update-repo.d.mts +10 -20
  194. package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -1
  195. package/dist/types/commands/repos/handle-view-repo.d.mts +3 -7
  196. package/dist/types/commands/repos/output-create-repo.d.mts +4 -8
  197. package/dist/types/commands/repos/output-delete-repo.d.mts +4 -8
  198. package/dist/types/commands/repos/output-list-repos.d.mts +4 -7
  199. package/dist/types/commands/repos/output-update-repo.d.mts +4 -8
  200. package/dist/types/commands/repos/output-view-repo.d.mts +4 -7
  201. package/dist/types/commands/scan/cmd-scan-create.d.mts +9 -15
  202. package/dist/types/commands/scan/cmd-scan-del.d.mts +9 -15
  203. package/dist/types/commands/scan/cmd-scan-diff.d.mts +9 -15
  204. package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -3
  205. package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -3
  206. package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -3
  207. package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -3
  208. package/dist/types/commands/scan/cmd-scan.d.mts +3 -3
  209. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -26
  210. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
  211. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -7
  212. package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -12
  213. package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
  214. package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -22
  215. package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
  216. package/dist/types/commands/scan/fetch-report-data.d.mts +8 -14
  217. package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -7
  218. package/dist/types/commands/scan/fetch-scan.d.mts +4 -7
  219. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -6
  220. package/dist/types/commands/scan/generate-report.d.mts +36 -50
  221. package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
  222. package/dist/types/commands/scan/handle-create-new-scan.d.mts +20 -37
  223. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
  224. package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -7
  225. package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -17
  226. package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -1
  227. package/dist/types/commands/scan/handle-list-scans.d.mts +13 -23
  228. package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
  229. package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -7
  230. package/dist/types/commands/scan/handle-scan-report.d.mts +12 -21
  231. package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
  232. package/dist/types/commands/scan/handle-scan-view.d.mts +3 -8
  233. package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -8
  234. package/dist/types/commands/scan/output-delete-scan.d.mts +4 -7
  235. package/dist/types/commands/scan/output-diff-scan.d.mts +8 -15
  236. package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
  237. package/dist/types/commands/scan/output-list-scans.d.mts +4 -7
  238. package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -8
  239. package/dist/types/commands/scan/output-scan-report.d.mts +20 -38
  240. package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
  241. package/dist/types/commands/scan/output-scan-view.d.mts +4 -10
  242. package/dist/types/commands/scan/stream-scan.d.mts +2 -6
  243. package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -2
  244. package/dist/types/commands/scan/suggest-repo-slug.d.mts +4 -4
  245. package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -4
  246. package/dist/types/commands/scan/suggest_target.d.mts +2 -2
  247. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +9 -15
  248. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -16
  249. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
  250. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -17
  251. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
  252. package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -7
  253. package/dist/types/commands/threat-feed/types.d.mts +12 -12
  254. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
  255. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
  256. package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
  257. package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
  258. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
  259. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
  260. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
  261. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
  262. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
  263. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
  264. package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -2
  265. package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -2
  266. package/dist/types/commands/wrapper/cmd-wrapper.d.mts +9 -15
  267. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -2
  268. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -1
  269. package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -2
  270. package/dist/types/constants.d.mts +125 -135
  271. package/dist/types/constants.d.mts.map +1 -1
  272. package/dist/types/flags.d.mts +14 -17
  273. package/dist/types/flags.d.mts.map +1 -1
  274. package/dist/types/instrument-with-sentry.d.mts +2 -2
  275. package/dist/types/shadow/npm/arborist/index.d.mts +2 -2
  276. package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +19 -24
  277. package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts +43 -71
  278. package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts +3 -8
  279. package/dist/types/shadow/npm/arborist/lib/edge.d.mts +58 -71
  280. package/dist/types/shadow/npm/arborist/lib/node.d.mts +55 -91
  281. package/dist/types/shadow/npm/arborist/lib/override-set.d.mts +26 -32
  282. package/dist/types/shadow/npm/arborist-helpers.d.mts +33 -66
  283. package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
  284. package/dist/types/shadow/npm/bin.d.mts +2 -5
  285. package/dist/types/shadow/npm/inject.d.mts +2 -2
  286. package/dist/types/shadow/npm/install.d.mts +11 -16
  287. package/dist/types/shadow/npm/link.d.mts +2 -5
  288. package/dist/types/shadow/npm/paths.d.mts +7 -7
  289. package/dist/types/shadow/npm/proc-log/index.d.mts +3 -6
  290. package/dist/types/types.d.mts +15 -17
  291. package/dist/types/utils/agent.d.mts +11 -14
  292. package/dist/types/utils/alert/artifact.d.mts +32 -50
  293. package/dist/types/utils/alert/fix.d.mts +5 -5
  294. package/dist/types/utils/alert/severity.d.mts +12 -24
  295. package/dist/types/utils/alerts-map.d.mts +23 -36
  296. package/dist/types/utils/api.d.mts +11 -34
  297. package/dist/types/utils/check-input.d.mts +9 -12
  298. package/dist/types/utils/cmd.d.mts +4 -4
  299. package/dist/types/utils/color-or-markdown.d.mts +14 -23
  300. package/dist/types/utils/color-or-markdown.d.mts.map +1 -1
  301. package/dist/types/utils/completion.d.mts +11 -0
  302. package/dist/types/utils/completion.d.mts.map +1 -0
  303. package/dist/types/utils/config.d.mts +22 -31
  304. package/dist/types/utils/config.d.mts.map +1 -1
  305. package/dist/types/utils/determine-org-slug.d.mts +2 -7
  306. package/dist/types/utils/errors.d.mts +12 -21
  307. package/dist/types/utils/fail-msg-with-badge.d.mts +2 -5
  308. package/dist/types/utils/fs.d.mts +21 -52
  309. package/dist/types/utils/get-output-kind.d.mts +3 -6
  310. package/dist/types/utils/glob.d.mts +13 -24
  311. package/dist/types/utils/map-to-object.d.mts +4 -6
  312. package/dist/types/utils/markdown.d.mts +4 -15
  313. package/dist/types/utils/meow-with-subcommands.d.mts +34 -46
  314. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
  315. package/dist/types/utils/npm-paths.d.mts +7 -7
  316. package/dist/types/utils/npm-paths.d.mts.map +1 -1
  317. package/dist/types/utils/objects.d.mts +3 -8
  318. package/dist/types/utils/output-formatting.d.mts +14 -24
  319. package/dist/types/utils/package-environment.d.mts +51 -72
  320. package/dist/types/utils/package-environment.d.mts.map +1 -1
  321. package/dist/types/utils/path-resolve.d.mts +9 -14
  322. package/dist/types/utils/pnpm.d.mts +9 -7
  323. package/dist/types/utils/pnpm.d.mts.map +1 -1
  324. package/dist/types/utils/sdk.d.mts +8 -12
  325. package/dist/types/utils/semver.d.mts +5 -17
  326. package/dist/types/utils/serialize-result-json.d.mts +3 -3
  327. package/dist/types/utils/socket-package-alert.d.mts +62 -81
  328. package/dist/types/utils/socket-url.d.mts +9 -15
  329. package/dist/types/utils/spec.d.mts +4 -7
  330. package/dist/types/utils/spec.d.mts.map +1 -1
  331. package/dist/types/utils/strings.d.mts +2 -5
  332. package/dist/types/utils/translations.d.mts +592 -592
  333. package/dist/types/utils/walk-nested-map.d.mts +7 -10
  334. package/dist/utils.js +1531 -1833
  335. package/dist/utils.js.map +1 -1
  336. package/dist/vendor.js +38333 -51605
  337. package/dist/vendor.js.map +1 -1
  338. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +5 -8
  339. package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +2 -4
  340. package/external/@socketsecurity/registry/external/cacache.js +1 -2
  341. package/external/@socketsecurity/registry/external/libnpmpack.js +36 -76
  342. package/external/@socketsecurity/registry/external/make-fetch-happen.js +31 -67
  343. package/external/@socketsecurity/registry/external/pacote.js +36 -76
  344. package/external/@socketsecurity/registry/external/tinyglobby.js +3 -6
  345. package/external/@socketsecurity/registry/external/which.js +2 -4
  346. package/external/@socketsecurity/registry/lib/logger.d.ts +3 -1
  347. package/external/@socketsecurity/registry/lib/logger.js +149 -69
  348. package/external/@socketsecurity/registry/package.json +2 -2
  349. package/external/blessed/lib/alias.js +475 -468
  350. package/external/blessed/lib/blessed.js +12 -12
  351. package/external/blessed/lib/colors.js +234 -194
  352. package/external/blessed/lib/events.js +64 -70
  353. package/external/blessed/lib/gpmclient.js +117 -141
  354. package/external/blessed/lib/helpers.js +89 -94
  355. package/external/blessed/lib/keys.js +169 -342
  356. package/external/blessed/lib/program.js +2130 -2365
  357. package/external/blessed/lib/tput.js +1183 -1276
  358. package/external/blessed/lib/unicode.js +400 -522
  359. package/external/blessed/lib/widget.js +14 -14
  360. package/external/blessed/lib/widgets/ansiimage.js +90 -96
  361. package/external/blessed/lib/widgets/bigtext.js +91 -102
  362. package/external/blessed/lib/widgets/box.js +8 -8
  363. package/external/blessed/lib/widgets/button.js +23 -23
  364. package/external/blessed/lib/widgets/checkbox.js +50 -54
  365. package/external/blessed/lib/widgets/element.js +1415 -1716
  366. package/external/blessed/lib/widgets/filemanager.js +107 -118
  367. package/external/blessed/lib/widgets/form.js +144 -178
  368. package/external/blessed/lib/widgets/image.js +26 -36
  369. package/external/blessed/lib/widgets/input.js +8 -8
  370. package/external/blessed/lib/widgets/layout.js +103 -119
  371. package/external/blessed/lib/widgets/line.js +17 -20
  372. package/external/blessed/lib/widgets/list.js +349 -402
  373. package/external/blessed/lib/widgets/listbar.js +265 -306
  374. package/external/blessed/lib/widgets/listtable.js +133 -146
  375. package/external/blessed/lib/widgets/loading.js +31 -31
  376. package/external/blessed/lib/widgets/log.js +41 -40
  377. package/external/blessed/lib/widgets/message.js +64 -86
  378. package/external/blessed/lib/widgets/node.js +175 -207
  379. package/external/blessed/lib/widgets/overlayimage.js +360 -437
  380. package/external/blessed/lib/widgets/progressbar.js +79 -88
  381. package/external/blessed/lib/widgets/prompt.js +54 -61
  382. package/external/blessed/lib/widgets/question.js +48 -61
  383. package/external/blessed/lib/widgets/radiobutton.js +26 -27
  384. package/external/blessed/lib/widgets/radioset.js +8 -8
  385. package/external/blessed/lib/widgets/screen.js +1186 -1375
  386. package/external/blessed/lib/widgets/scrollablebox.js +202 -228
  387. package/external/blessed/lib/widgets/scrollabletext.js +9 -9
  388. package/external/blessed/lib/widgets/table.js +187 -216
  389. package/external/blessed/lib/widgets/terminal.js +258 -298
  390. package/external/blessed/lib/widgets/text.js +9 -9
  391. package/external/blessed/lib/widgets/textarea.js +188 -222
  392. package/external/blessed/lib/widgets/textbox.js +34 -36
  393. package/external/blessed/lib/widgets/video.js +55 -59
  394. package/external/blessed/usr/fonts/ter-u14b.json +1 -1
  395. package/external/blessed/usr/fonts/ter-u14n.json +1 -1
  396. package/external/blessed/vendor/tng.js +1016 -1144
  397. package/external/blessed-contrib/lib/layout/grid.js +345 -377
  398. package/external/blessed-contrib/lib/widget/charts/bar.js +6612 -7139
  399. package/external/blessed-contrib/lib/widget/charts/line.js +16224 -23941
  400. package/external/blessed-contrib/lib/widget/table.js +78 -96
  401. package/package.json +8 -8
  402. 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
- const stringFromCharCode = String.fromCharCode
109
- const floor = Math.floor
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 (str, i) {
116
- const point = typeof str !== 'number' ? exports.codePointAt(str, i || 0) : str
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
- 0x3000 === point ||
164
- (0xff01 <= point && point <= 0xff60) ||
165
- (0xffe0 <= point && point <= 0xffe6)
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
- (0x1100 <= point && point <= 0x115f) ||
172
- (0x11a3 <= point && point <= 0x11a7) ||
173
- (0x11fa <= point && point <= 0x11ff) ||
174
- (0x2329 <= point && point <= 0x232a) ||
175
- (0x2e80 <= point && point <= 0x2e99) ||
176
- (0x2e9b <= point && point <= 0x2ef3) ||
177
- (0x2f00 <= point && point <= 0x2fd5) ||
178
- (0x2ff0 <= point && point <= 0x2ffb) ||
179
- (0x3001 <= point && point <= 0x303e) ||
180
- (0x3041 <= point && point <= 0x3096) ||
181
- (0x3099 <= point && point <= 0x30ff) ||
182
- (0x3105 <= point && point <= 0x312d) ||
183
- (0x3131 <= point && point <= 0x318e) ||
184
- (0x3190 <= point && point <= 0x31ba) ||
185
- (0x31c0 <= point && point <= 0x31e3) ||
186
- (0x31f0 <= point && point <= 0x321e) ||
187
- (0x3220 <= point && point <= 0x3247) ||
188
- (0x3250 <= point && point <= 0x32fe) ||
189
- (0x3300 <= point && point <= 0x4dbf) ||
190
- (0x4e00 <= point && point <= 0xa48c) ||
191
- (0xa490 <= point && point <= 0xa4c6) ||
192
- (0xa960 <= point && point <= 0xa97c) ||
193
- (0xac00 <= point && point <= 0xd7a3) ||
194
- (0xd7b0 <= point && point <= 0xd7c6) ||
195
- (0xd7cb <= point && point <= 0xd7fb) ||
196
- (0xf900 <= point && point <= 0xfaff) ||
197
- (0xfe10 <= point && point <= 0xfe19) ||
198
- (0xfe30 <= point && point <= 0xfe52) ||
199
- (0xfe54 <= point && point <= 0xfe66) ||
200
- (0xfe68 <= point && point <= 0xfe6b) ||
201
- (0x1b000 <= point && point <= 0x1b001) ||
202
- (0x1f200 <= point && point <= 0x1f202) ||
203
- (0x1f210 <= point && point <= 0x1f23a) ||
204
- (0x1f240 <= point && point <= 0x1f248) ||
205
- (0x1f250 <= point && point <= 0x1f251) ||
206
- (0x20000 <= point && point <= 0x2f73f) ||
207
- (0x2b740 <= point && point <= 0x2fffd) ||
208
- (0x30000 <= point && point <= 0x3fffd)
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
- 0x00a1 === point ||
219
- 0x00a4 === point ||
220
- (0x00a7 <= point && point <= 0x00a8) ||
221
- 0x00aa === point ||
222
- (0x00ad <= point && point <= 0x00ae) ||
223
- (0x00b0 <= point && point <= 0x00b4) ||
224
- (0x00b6 <= point && point <= 0x00ba) ||
225
- (0x00bc <= point && point <= 0x00bf) ||
226
- 0x00c6 === point ||
227
- 0x00d0 === point ||
228
- (0x00d7 <= point && point <= 0x00d8) ||
229
- (0x00de <= point && point <= 0x00e1) ||
230
- 0x00e6 === point ||
231
- (0x00e8 <= point && point <= 0x00ea) ||
232
- (0x00ec <= point && point <= 0x00ed) ||
233
- 0x00f0 === point ||
234
- (0x00f2 <= point && point <= 0x00f3) ||
235
- (0x00f7 <= point && point <= 0x00fa) ||
236
- 0x00fc === point ||
237
- 0x00fe === point ||
238
- 0x0101 === point ||
239
- 0x0111 === point ||
240
- 0x0113 === point ||
241
- 0x011b === point ||
242
- (0x0126 <= point && point <= 0x0127) ||
243
- 0x012b === point ||
244
- (0x0131 <= point && point <= 0x0133) ||
245
- 0x0138 === point ||
246
- (0x013f <= point && point <= 0x0142) ||
247
- 0x0144 === point ||
248
- (0x0148 <= point && point <= 0x014b) ||
249
- 0x014d === point ||
250
- (0x0152 <= point && point <= 0x0153) ||
251
- (0x0166 <= point && point <= 0x0167) ||
252
- 0x016b === point ||
253
- 0x01ce === point ||
254
- 0x01d0 === point ||
255
- 0x01d2 === point ||
256
- 0x01d4 === point ||
257
- 0x01d6 === point ||
258
- 0x01d8 === point ||
259
- 0x01da === point ||
260
- 0x01dc === point ||
261
- 0x0251 === point ||
262
- 0x0261 === point ||
263
- 0x02c4 === point ||
264
- 0x02c7 === point ||
265
- (0x02c9 <= point && point <= 0x02cb) ||
266
- 0x02cd === point ||
267
- 0x02d0 === point ||
268
- (0x02d8 <= point && point <= 0x02db) ||
269
- 0x02dd === point ||
270
- 0x02df === point ||
271
- (0x0300 <= point && point <= 0x036f) ||
272
- (0x0391 <= point && point <= 0x03a1) ||
273
- (0x03a3 <= point && point <= 0x03a9) ||
274
- (0x03b1 <= point && point <= 0x03c1) ||
275
- (0x03c3 <= point && point <= 0x03c9) ||
276
- 0x0401 === point ||
277
- (0x0410 <= point && point <= 0x044f) ||
278
- 0x0451 === point ||
279
- 0x2010 === point ||
280
- (0x2013 <= point && point <= 0x2016) ||
281
- (0x2018 <= point && point <= 0x2019) ||
282
- (0x201c <= point && point <= 0x201d) ||
283
- (0x2020 <= point && point <= 0x2022) ||
284
- (0x2024 <= point && point <= 0x2027) ||
285
- 0x2030 === point ||
286
- (0x2032 <= point && point <= 0x2033) ||
287
- 0x2035 === point ||
288
- 0x203b === point ||
289
- 0x203e === point ||
290
- 0x2074 === point ||
291
- 0x207f === point ||
292
- (0x2081 <= point && point <= 0x2084) ||
293
- 0x20ac === point ||
294
- 0x2103 === point ||
295
- 0x2105 === point ||
296
- 0x2109 === point ||
297
- 0x2113 === point ||
298
- 0x2116 === point ||
299
- (0x2121 <= point && point <= 0x2122) ||
300
- 0x2126 === point ||
301
- 0x212b === point ||
302
- (0x2153 <= point && point <= 0x2154) ||
303
- (0x215b <= point && point <= 0x215e) ||
304
- (0x2160 <= point && point <= 0x216b) ||
305
- (0x2170 <= point && point <= 0x2179) ||
306
- 0x2189 === point ||
307
- (0x2190 <= point && point <= 0x2199) ||
308
- (0x21b8 <= point && point <= 0x21b9) ||
309
- 0x21d2 === point ||
310
- 0x21d4 === point ||
311
- 0x21e7 === point ||
312
- 0x2200 === point ||
313
- (0x2202 <= point && point <= 0x2203) ||
314
- (0x2207 <= point && point <= 0x2208) ||
315
- 0x220b === point ||
316
- 0x220f === point ||
317
- 0x2211 === point ||
318
- 0x2215 === point ||
319
- 0x221a === point ||
320
- (0x221d <= point && point <= 0x2220) ||
321
- 0x2223 === point ||
322
- 0x2225 === point ||
323
- (0x2227 <= point && point <= 0x222c) ||
324
- 0x222e === point ||
325
- (0x2234 <= point && point <= 0x2237) ||
326
- (0x223c <= point && point <= 0x223d) ||
327
- 0x2248 === point ||
328
- 0x224c === point ||
329
- 0x2252 === point ||
330
- (0x2260 <= point && point <= 0x2261) ||
331
- (0x2264 <= point && point <= 0x2267) ||
332
- (0x226a <= point && point <= 0x226b) ||
333
- (0x226e <= point && point <= 0x226f) ||
334
- (0x2282 <= point && point <= 0x2283) ||
335
- (0x2286 <= point && point <= 0x2287) ||
336
- 0x2295 === point ||
337
- 0x2299 === point ||
338
- 0x22a5 === point ||
339
- 0x22bf === point ||
340
- 0x2312 === point ||
341
- (0x2460 <= point && point <= 0x24e9) ||
342
- (0x24eb <= point && point <= 0x254b) ||
343
- (0x2550 <= point && point <= 0x2573) ||
344
- (0x2580 <= point && point <= 0x258f) ||
345
- (0x2592 <= point && point <= 0x2595) ||
346
- (0x25a0 <= point && point <= 0x25a1) ||
347
- (0x25a3 <= point && point <= 0x25a9) ||
348
- (0x25b2 <= point && point <= 0x25b3) ||
349
- (0x25b6 <= point && point <= 0x25b7) ||
350
- (0x25bc <= point && point <= 0x25bd) ||
351
- (0x25c0 <= point && point <= 0x25c1) ||
352
- (0x25c6 <= point && point <= 0x25c8) ||
353
- 0x25cb === point ||
354
- (0x25ce <= point && point <= 0x25d1) ||
355
- (0x25e2 <= point && point <= 0x25e5) ||
356
- 0x25ef === point ||
357
- (0x2605 <= point && point <= 0x2606) ||
358
- 0x2609 === point ||
359
- (0x260e <= point && point <= 0x260f) ||
360
- (0x2614 <= point && point <= 0x2615) ||
361
- 0x261c === point ||
362
- 0x261e === point ||
363
- 0x2640 === point ||
364
- 0x2642 === point ||
365
- (0x2660 <= point && point <= 0x2661) ||
366
- (0x2663 <= point && point <= 0x2665) ||
367
- (0x2667 <= point && point <= 0x266a) ||
368
- (0x266c <= point && point <= 0x266d) ||
369
- 0x266f === point ||
370
- (0x269e <= point && point <= 0x269f) ||
371
- (0x26be <= point && point <= 0x26bf) ||
372
- (0x26c4 <= point && point <= 0x26cd) ||
373
- (0x26cf <= point && point <= 0x26e1) ||
374
- 0x26e3 === point ||
375
- (0x26e8 <= point && point <= 0x26ff) ||
376
- 0x273d === point ||
377
- 0x2757 === point ||
378
- (0x2776 <= point && point <= 0x277f) ||
379
- (0x2b55 <= point && point <= 0x2b59) ||
380
- (0x3248 <= point && point <= 0x324f) ||
381
- (0xe000 <= point && point <= 0xf8ff) ||
382
- (0xfe00 <= point && point <= 0xfe0f) ||
383
- 0xfffd === point ||
384
- (0x1f100 <= point && point <= 0x1f10a) ||
385
- (0x1f110 <= point && point <= 0x1f12d) ||
386
- (0x1f130 <= point && point <= 0x1f169) ||
387
- (0x1f170 <= point && point <= 0x1f19a) ||
388
- (0xe0100 <= point && point <= 0xe01ef) ||
389
- (0xf0000 <= point && point <= 0xffffd) ||
390
- (0x100000 <= point && point <= 0x10fffd)
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 (str) {
400
- let width = 0
401
- for (let i = 0; i < str.length; i++) {
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 (str, i) {
411
- const point = typeof str !== 'number' ? exports.codePointAt(str, i || 0) : str
412
- return point > 0x00ffff
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, 0x036f],
417
- [0x0483, 0x0486],
418
- [0x0488, 0x0489],
419
- [0x0591, 0x05bd],
420
- [0x05bf, 0x05bf],
421
- [0x05c1, 0x05c2],
422
- [0x05c4, 0x05c5],
423
- [0x05c7, 0x05c7],
424
- [0x0600, 0x0603],
425
- [0x0610, 0x0615],
426
- [0x064b, 0x065e],
427
- [0x0670, 0x0670],
428
- [0x06d6, 0x06e4],
429
- [0x06e7, 0x06e8],
430
- [0x06ea, 0x06ed],
431
- [0x070f, 0x070f],
432
- [0x0711, 0x0711],
433
- [0x0730, 0x074a],
434
- [0x07a6, 0x07b0],
435
- [0x07eb, 0x07f3],
436
- [0x0901, 0x0902],
437
- [0x093c, 0x093c],
438
- [0x0941, 0x0948],
439
- [0x094d, 0x094d],
440
- [0x0951, 0x0954],
441
- [0x0962, 0x0963],
442
- [0x0981, 0x0981],
443
- [0x09bc, 0x09bc],
444
- [0x09c1, 0x09c4],
445
- [0x09cd, 0x09cd],
446
- [0x09e2, 0x09e3],
447
- [0x0a01, 0x0a02],
448
- [0x0a3c, 0x0a3c],
449
- [0x0a41, 0x0a42],
450
- [0x0a47, 0x0a48],
451
- [0x0a4b, 0x0a4d],
452
- [0x0a70, 0x0a71],
453
- [0x0a81, 0x0a82],
454
- [0x0abc, 0x0abc],
455
- [0x0ac1, 0x0ac5],
456
- [0x0ac7, 0x0ac8],
457
- [0x0acd, 0x0acd],
458
- [0x0ae2, 0x0ae3],
459
- [0x0b01, 0x0b01],
460
- [0x0b3c, 0x0b3c],
461
- [0x0b3f, 0x0b3f],
462
- [0x0b41, 0x0b43],
463
- [0x0b4d, 0x0b4d],
464
- [0x0b56, 0x0b56],
465
- [0x0b82, 0x0b82],
466
- [0x0bc0, 0x0bc0],
467
- [0x0bcd, 0x0bcd],
468
- [0x0c3e, 0x0c40],
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 (str, i) {
568
- const point = typeof str !== 'number' ? exports.codePointAt(str, i || 0) : str
569
- return exports.combining[point] === true
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 (str, position) {
478
+ exports.codePointAt = function(str, position) {
577
479
  if (str == null) {
578
- throw TypeError()
480
+ throw TypeError();
579
481
  }
580
- const string = String(str)
482
+ var string = String(str);
581
483
  if (string.codePointAt) {
582
- return string.codePointAt(position)
484
+ return string.codePointAt(position);
583
485
  }
584
- const size = string.length
486
+ var size = string.length;
585
487
  // `ToInteger`
586
- let index = position ? Number(position) : 0
587
- if (index !== index) {
588
- // better `isNaN`
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
- const first = string.charCodeAt(index)
597
- let second
598
- if (
599
- // check if it’s the start of a surrogate pair
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 >= 0xdc00 && second <= 0xdfff) {
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 - 0xd800) * 0x400 + second - 0xdc00 + 0x10000
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
- const MAX_SIZE = 0x4000
633
- const codeUnits = []
634
- let highSurrogate
635
- let lowSurrogate
636
- let index = -1
637
- const length = arguments.length
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
- let result = ''
539
+ var result = '';
642
540
  while (++index < length) {
643
- let codePoint = Number(arguments[index])
541
+ var codePoint = Number(arguments[index]);
644
542
  if (
645
- !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
646
- codePoint < 0 || // not a valid Unicode code point
647
- codePoint > 0x10ffff || // not a valid Unicode code point
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 <= 0xffff) {
653
- // BMP code point
654
- codeUnits.push(codePoint)
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) + 0xd800
660
- lowSurrogate = (codePoint % 0x400) + 0xdc00
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
- '\\u1100-\\u115f' + // Hangul Jamo init. consonants
685
- '\\u2329\\u232a' +
686
- '\\u2e80-\\u303e\\u3040-\\ua4cf' + // CJK ... Yi
687
- '\\uac00-\\ud7a3' + // Hangul Syllables
688
- '\\uf900-\\ufaff' + // CJK Compatibility Ideographs
689
- '\\ufe10-\\ufe19' + // Vertical forms
690
- '\\ufe30-\\ufe6f' + // CJK Compatibility Forms
691
- '\\uff00-\\uff60' + // Fullwidth Forms
692
- '\\uffe0-\\uffe6' +
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
- // 0x20000 - 0x2fffd:
701
- '[\\ud840-\\ud87f][\\udc00-\\udffd]' +
702
- '|' +
703
- // 0x30000 - 0x3fffd:
704
- '[\\ud880-\\ud8bf][\\udc00-\\udffd]' +
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
- exports.chars.swide.source.slice(1, -1) +
713
- '|' +
714
- exports.chars.wide.source.slice(1, -1) +
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 (out, row) {
724
- let low, high, range
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 = [hexify(low.charCodeAt(0)), hexify(low.charCodeAt(1))]
728
- high = exports.fromCodePoint(row[1])
729
- high = [hexify(high.charCodeAt(0)), hexify(high.charCodeAt(1))]
730
- range =
731
- '[\\u' +
732
- low[0] +
733
- '-' +
734
- '\\u' +
735
- high[0] +
736
- ']' +
737
- '[\\u' +
738
- low[1] +
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
- n = '0' + n
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
  /*