@socketsecurity/cli-with-sentry 0.14.94 → 0.14.96

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 (84) hide show
  1. package/dist/constants.js +3 -3
  2. package/dist/constants.js.map +1 -1
  3. package/dist/instrument-with-sentry.js +2 -2
  4. package/dist/instrument-with-sentry.js.map +1 -1
  5. package/dist/module-sync/cli.js +178 -159
  6. package/dist/module-sync/cli.js.map +1 -1
  7. package/dist/module-sync/shadow-bin.js +3 -14
  8. package/dist/module-sync/shadow-bin.js.map +1 -1
  9. package/dist/module-sync/shadow-npm-inject.js +68 -59
  10. package/dist/module-sync/shadow-npm-inject.js.map +1 -1
  11. package/dist/module-sync/shadow-npm-paths.js +16 -29
  12. package/dist/module-sync/shadow-npm-paths.js.map +1 -1
  13. package/dist/module-sync/vendor.d.ts +0 -0
  14. package/dist/module-sync/vendor.js +85829 -12598
  15. package/dist/module-sync/vendor.js.map +1 -1
  16. package/dist/require/cli.js +160 -140
  17. package/dist/require/cli.js.map +1 -1
  18. package/dist/require/shadow-bin.d.ts +5 -0
  19. package/dist/require/shadow-bin.js +108 -1
  20. package/dist/require/shadow-bin.js.map +1 -0
  21. package/dist/require/shadow-npm-inject.d.ts +1 -0
  22. package/dist/require/shadow-npm-inject.js +2335 -1
  23. package/dist/require/shadow-npm-inject.js.map +1 -0
  24. package/dist/require/shadow-npm-paths.d.ts +29 -0
  25. package/dist/require/shadow-npm-paths.js +454 -1
  26. package/dist/require/shadow-npm-paths.js.map +1 -0
  27. package/package.json +29 -29
  28. package/dist/blessed/lib/alias.js +0 -521
  29. package/dist/blessed/lib/blessed.js +0 -34
  30. package/dist/blessed/lib/colors.js +0 -492
  31. package/dist/blessed/lib/events.js +0 -197
  32. package/dist/blessed/lib/gpmclient.js +0 -247
  33. package/dist/blessed/lib/helpers.js +0 -172
  34. package/dist/blessed/lib/keys.js +0 -514
  35. package/dist/blessed/lib/program.js +0 -4532
  36. package/dist/blessed/lib/tput.js +0 -3113
  37. package/dist/blessed/lib/unicode.js +0 -914
  38. package/dist/blessed/lib/widget.js +0 -62
  39. package/dist/blessed/lib/widgets/ansiimage.js +0 -175
  40. package/dist/blessed/lib/widgets/bigtext.js +0 -172
  41. package/dist/blessed/lib/widgets/box.js +0 -36
  42. package/dist/blessed/lib/widgets/button.js +0 -64
  43. package/dist/blessed/lib/widgets/checkbox.js +0 -97
  44. package/dist/blessed/lib/widgets/element.js +0 -2873
  45. package/dist/blessed/lib/widgets/filemanager.js +0 -225
  46. package/dist/blessed/lib/widgets/form.js +0 -303
  47. package/dist/blessed/lib/widgets/image.js +0 -73
  48. package/dist/blessed/lib/widgets/input.js +0 -36
  49. package/dist/blessed/lib/widgets/layout.js +0 -251
  50. package/dist/blessed/lib/widgets/line.js +0 -61
  51. package/dist/blessed/lib/widgets/list.js +0 -654
  52. package/dist/blessed/lib/widgets/listbar.js +0 -454
  53. package/dist/blessed/lib/widgets/listtable.js +0 -267
  54. package/dist/blessed/lib/widgets/loading.js +0 -90
  55. package/dist/blessed/lib/widgets/log.js +0 -84
  56. package/dist/blessed/lib/widgets/message.js +0 -147
  57. package/dist/blessed/lib/widgets/node.js +0 -315
  58. package/dist/blessed/lib/widgets/overlayimage.js +0 -796
  59. package/dist/blessed/lib/widgets/progressbar.js +0 -168
  60. package/dist/blessed/lib/widgets/prompt.js +0 -129
  61. package/dist/blessed/lib/widgets/question.js +0 -131
  62. package/dist/blessed/lib/widgets/radiobutton.js +0 -64
  63. package/dist/blessed/lib/widgets/radioset.js +0 -38
  64. package/dist/blessed/lib/widgets/screen.js +0 -2487
  65. package/dist/blessed/lib/widgets/scrollablebox.js +0 -417
  66. package/dist/blessed/lib/widgets/scrollabletext.js +0 -37
  67. package/dist/blessed/lib/widgets/table.js +0 -385
  68. package/dist/blessed/lib/widgets/terminal.js +0 -454
  69. package/dist/blessed/lib/widgets/text.js +0 -37
  70. package/dist/blessed/lib/widgets/textarea.js +0 -378
  71. package/dist/blessed/lib/widgets/textbox.js +0 -81
  72. package/dist/blessed/lib/widgets/video.js +0 -132
  73. package/dist/blessed/usr/fonts/AUTHORS +0 -1
  74. package/dist/blessed/usr/fonts/LICENSE +0 -94
  75. package/dist/blessed/usr/fonts/README +0 -340
  76. package/dist/blessed/usr/fonts/ter-u14b.json +0 -17826
  77. package/dist/blessed/usr/fonts/ter-u14n.json +0 -17826
  78. package/dist/blessed/usr/linux +0 -0
  79. package/dist/blessed/usr/windows-ansi +0 -0
  80. package/dist/blessed/usr/xterm +0 -0
  81. package/dist/blessed/usr/xterm-256color +0 -0
  82. package/dist/blessed/usr/xterm.termcap +0 -243
  83. package/dist/blessed/usr/xterm.terminfo +0 -1977
  84. package/dist/blessed/vendor/tng.js +0 -1878
@@ -1,914 +0,0 @@
1
- 'use strict'
2
-
3
- /**
4
- * unicode.js - east asian width and surrogate pairs
5
- * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License).
6
- * https://github.com/chjj/blessed
7
- * Borrowed from vangie/east-asian-width, komagata/eastasianwidth,
8
- * and mathiasbynens/String.prototype.codePointAt. Licenses below.
9
- */
10
-
11
- // east-asian-width
12
- //
13
- // Copyright (c) 2015 Vangie Du
14
- // https://github.com/vangie/east-asian-width
15
- //
16
- // Permission is hereby granted, free of charge, to any person
17
- // obtaining a copy of this software and associated documentation
18
- // files (the "Software"), to deal in the Software without
19
- // restriction, including without limitation the rights to use,
20
- // copy, modify, merge, publish, distribute, sublicense, and/or sell
21
- // copies of the Software, and to permit persons to whom the
22
- // Software is furnished to do so, subject to the following
23
- // conditions:
24
- //
25
- // The above copyright notice and this permission notice shall be
26
- // included in all copies or substantial portions of the Software.
27
- //
28
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
30
- // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
32
- // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
33
- // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
34
- // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35
- // OTHER DEALINGS IN THE SOFTWARE.
36
-
37
- // eastasianwidth
38
- //
39
- // Copyright (c) 2013, Masaki Komagata
40
- // https://github.com/komagata/eastasianwidth
41
- //
42
- // Permission is hereby granted, free of charge, to any person obtaining a copy
43
- // of this software and associated documentation files (the "Software"), to deal
44
- // in the Software without restriction, including without limitation the rights
45
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
46
- // copies of the Software, and to permit persons to whom the Software is
47
- // furnished to do so, subject to the following conditions:
48
- //
49
- // The above copyright notice and this permission notice shall be included in
50
- // all copies or substantial portions of the Software.
51
- //
52
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
54
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
56
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
57
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
58
- // THE SOFTWARE.
59
-
60
- // String.prototype.codePointAt
61
- //
62
- // Copyright Mathias Bynens <https://mathiasbynens.be/>
63
- // https://github.com/mathiasbynens/String.prototype.codePointAt
64
- //
65
- // Permission is hereby granted, free of charge, to any person obtaining
66
- // a copy of this software and associated documentation files (the
67
- // "Software"), to deal in the Software without restriction, including
68
- // without limitation the rights to use, copy, modify, merge, publish,
69
- // distribute, sublicense, and/or sell copies of the Software, and to
70
- // permit persons to whom the Software is furnished to do so, subject to
71
- // the following conditions:
72
- //
73
- // The above copyright notice and this permission notice shall be
74
- // included in all copies or substantial portions of the Software.
75
- //
76
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
77
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
79
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
80
- // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
81
- // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
82
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
83
-
84
- // String.fromCodePoint
85
- //
86
- // Copyright Mathias Bynens <https://mathiasbynens.be/>
87
- // https://github.com/mathiasbynens/String.fromCodePoint
88
- //
89
- // Permission is hereby granted, free of charge, to any person obtaining
90
- // a copy of this software and associated documentation files (the
91
- // "Software"), to deal in the Software without restriction, including
92
- // without limitation the rights to use, copy, modify, merge, publish,
93
- // distribute, sublicense, and/or sell copies of the Software, and to
94
- // permit persons to whom the Software is furnished to do so, subject to
95
- // the following conditions:
96
- //
97
- // The above copyright notice and this permission notice shall be
98
- // included in all copies or substantial portions of the Software.
99
- //
100
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
101
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
102
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
103
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
104
- // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
105
- // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
106
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
107
-
108
- const stringFromCharCode = String.fromCharCode
109
- const floor = Math.floor
110
-
111
- /**
112
- * Wide, Surrogates, and Combining
113
- */
114
-
115
- exports.charWidth = function (str, i) {
116
- const point = typeof str !== 'number' ? exports.codePointAt(str, i || 0) : str
117
-
118
- // nul
119
- if (point === 0) {
120
- return 0
121
- }
122
-
123
- // tab
124
- if (point === 0x09) {
125
- if (!exports.blessed) {
126
- exports.blessed = require('../')
127
- }
128
- return exports.blessed.screen.global
129
- ? exports.blessed.screen.global.tabc.length
130
- : 8
131
- }
132
-
133
- // 8-bit control characters (2-width according to unicode??)
134
- if (point < 32 || (point >= 0x7f && point < 0xa0)) {
135
- return 0
136
- }
137
-
138
- // search table of non-spacing characters
139
- // is ucs combining or C0/C1 control character
140
- if (exports.combining[point]) {
141
- return 0
142
- }
143
-
144
- // check for double-wide
145
- // if (point >= 0x1100
146
- // && (point <= 0x115f // Hangul Jamo init. consonants
147
- // || point === 0x2329 || point === 0x232a
148
- // || (point >= 0x2e80 && point <= 0xa4cf
149
- // && point !== 0x303f) // CJK ... Yi
150
- // || (point >= 0xac00 && point <= 0xd7a3) // Hangul Syllables
151
- // || (point >= 0xf900 && point <= 0xfaff) // CJK Compatibility Ideographs
152
- // || (point >= 0xfe10 && point <= 0xfe19) // Vertical forms
153
- // || (point >= 0xfe30 && point <= 0xfe6f) // CJK Compatibility Forms
154
- // || (point >= 0xff00 && point <= 0xff60) // Fullwidth Forms
155
- // || (point >= 0xffe0 && point <= 0xffe6)
156
- // || (point >= 0x20000 && point <= 0x2fffd)
157
- // || (point >= 0x30000 && point <= 0x3fffd))) {
158
- // return 2;
159
- // }
160
-
161
- // check for double-wide
162
- if (
163
- 0x3000 === point ||
164
- (0xff01 <= point && point <= 0xff60) ||
165
- (0xffe0 <= point && point <= 0xffe6)
166
- ) {
167
- return 2
168
- }
169
-
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
211
- }
212
-
213
- // CJK Ambiguous
214
- // http://www.unicode.org/reports/tr11/
215
- // http://www.unicode.org/reports/tr11/#Ambiguous
216
- 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
393
- }
394
- }
395
-
396
- return 1
397
- }
398
-
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
- }
406
- }
407
- return width
408
- }
409
-
410
- exports.isSurrogate = function (str, i) {
411
- const point = typeof str !== 'number' ? exports.codePointAt(str, i || 0) : str
412
- return point > 0x00ffff
413
- }
414
-
415
- 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
563
- }
564
- return out
565
- }, {})
566
-
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
- }
571
-
572
- /**
573
- * Code Point Helpers
574
- */
575
-
576
- exports.codePointAt = function (str, position) {
577
- if (str == null) {
578
- throw TypeError()
579
- }
580
- const string = String(str)
581
- if (string.codePointAt) {
582
- return string.codePointAt(position)
583
- }
584
- const size = string.length
585
- // `ToInteger`
586
- let index = position ? Number(position) : 0
587
- if (index !== index) {
588
- // better `isNaN`
589
- index = 0
590
- }
591
- // Account for out-of-bounds indices:
592
- if (index < 0 || index >= size) {
593
- return undefined
594
- }
595
- // 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
602
- size > index + 1 // there is a next code unit
603
- ) {
604
- second = string.charCodeAt(index + 1)
605
- if (second >= 0xdc00 && second <= 0xdfff) {
606
- // low surrogate
607
- // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
608
- return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000
609
- }
610
- }
611
- return first
612
- }
613
-
614
- // exports.codePointAt = function(str, position) {
615
- // position = +position || 0;
616
- // var x = str.charCodeAt(position);
617
- // var y = str.length > 1 ? str.charCodeAt(position + 1) : 0;
618
- // var point = x;
619
- // if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {
620
- // x &= 0x3FF;
621
- // y &= 0x3FF;
622
- // point = (x << 10) | y;
623
- // point += 0x10000;
624
- // }
625
- // return point;
626
- // };
627
-
628
- exports.fromCodePoint = function () {
629
- if (String.fromCodePoint) {
630
- return String.fromCodePoint.apply(String, arguments)
631
- }
632
- const MAX_SIZE = 0x4000
633
- const codeUnits = []
634
- let highSurrogate
635
- let lowSurrogate
636
- let index = -1
637
- const length = arguments.length
638
- if (!length) {
639
- return ''
640
- }
641
- let result = ''
642
- while (++index < length) {
643
- let codePoint = Number(arguments[index])
644
- 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
648
- floor(codePoint) !== codePoint // not an integer
649
- ) {
650
- throw RangeError('Invalid code point: ' + codePoint)
651
- }
652
- if (codePoint <= 0xffff) {
653
- // BMP code point
654
- codeUnits.push(codePoint)
655
- } else {
656
- // Astral code point; split in surrogate halves
657
- // 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)
662
- }
663
- if (index + 1 === length || codeUnits.length > MAX_SIZE) {
664
- result += stringFromCharCode.apply(null, codeUnits)
665
- codeUnits.length = 0
666
- }
667
- }
668
- return result
669
- }
670
-
671
- /**
672
- * Regexes
673
- */
674
-
675
- exports.chars = {}
676
-
677
- // Double width characters that are _not_ surrogate pairs.
678
- // NOTE: 0x20000 - 0x2fffd and 0x30000 - 0x3fffd are not necessary for this
679
- // regex anyway. This regex is used to put a blank char after wide chars to
680
- // be eaten, however, if this is a surrogate pair, parseContent already adds
681
- // 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
- )
696
-
697
- // 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
- )
708
-
709
- // 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
- )
718
-
719
- // Regex to detect a surrogate pair.
720
- exports.chars.surrogate = /[\ud800-\udbff][\udc00-\udfff]/g
721
-
722
- // Regex to find combining characters.
723
- exports.chars.combining = exports.combiningTable.reduce(function (out, row) {
724
- let low, high, range
725
- 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
747
- } else {
748
- low = hexify(row[0])
749
- high = hexify(row[1])
750
- low = '\\u' + low
751
- high = '\\u' + high
752
- out += low + '-' + high
753
- }
754
- return out
755
- }, '[')
756
-
757
- exports.chars.combining = new RegExp(exports.chars.combining, 'g')
758
-
759
- function hexify(n) {
760
- n = n.toString(16)
761
- while (n.length < 4) {
762
- n = '0' + n
763
- }
764
- return n
765
- }
766
-
767
- /*
768
- exports.chars.combining = new RegExp(
769
- '['
770
- + '\\u0300-\\u036f'
771
- + '\\u0483-\\u0486'
772
- + '\\u0488-\\u0489'
773
- + '\\u0591-\\u05bd'
774
- + '\\u05bf-\\u05bf'
775
- + '\\u05c1-\\u05c2'
776
- + '\\u05c4-\\u05c5'
777
- + '\\u05c7-\\u05c7'
778
- + '\\u0600-\\u0603'
779
- + '\\u0610-\\u0615'
780
- + '\\u064b-\\u065e'
781
- + '\\u0670-\\u0670'
782
- + '\\u06d6-\\u06e4'
783
- + '\\u06e7-\\u06e8'
784
- + '\\u06ea-\\u06ed'
785
- + '\\u070f-\\u070f'
786
- + '\\u0711-\\u0711'
787
- + '\\u0730-\\u074a'
788
- + '\\u07a6-\\u07b0'
789
- + '\\u07eb-\\u07f3'
790
- + '\\u0901-\\u0902'
791
- + '\\u093c-\\u093c'
792
- + '\\u0941-\\u0948'
793
- + '\\u094d-\\u094d'
794
- + '\\u0951-\\u0954'
795
- + '\\u0962-\\u0963'
796
- + '\\u0981-\\u0981'
797
- + '\\u09bc-\\u09bc'
798
- + '\\u09c1-\\u09c4'
799
- + '\\u09cd-\\u09cd'
800
- + '\\u09e2-\\u09e3'
801
- + '\\u0a01-\\u0a02'
802
- + '\\u0a3c-\\u0a3c'
803
- + '\\u0a41-\\u0a42'
804
- + '\\u0a47-\\u0a48'
805
- + '\\u0a4b-\\u0a4d'
806
- + '\\u0a70-\\u0a71'
807
- + '\\u0a81-\\u0a82'
808
- + '\\u0abc-\\u0abc'
809
- + '\\u0ac1-\\u0ac5'
810
- + '\\u0ac7-\\u0ac8'
811
- + '\\u0acd-\\u0acd'
812
- + '\\u0ae2-\\u0ae3'
813
- + '\\u0b01-\\u0b01'
814
- + '\\u0b3c-\\u0b3c'
815
- + '\\u0b3f-\\u0b3f'
816
- + '\\u0b41-\\u0b43'
817
- + '\\u0b4d-\\u0b4d'
818
- + '\\u0b56-\\u0b56'
819
- + '\\u0b82-\\u0b82'
820
- + '\\u0bc0-\\u0bc0'
821
- + '\\u0bcd-\\u0bcd'
822
- + '\\u0c3e-\\u0c40'
823
- + '\\u0c46-\\u0c48'
824
- + '\\u0c4a-\\u0c4d'
825
- + '\\u0c55-\\u0c56'
826
- + '\\u0cbc-\\u0cbc'
827
- + '\\u0cbf-\\u0cbf'
828
- + '\\u0cc6-\\u0cc6'
829
- + '\\u0ccc-\\u0ccd'
830
- + '\\u0ce2-\\u0ce3'
831
- + '\\u0d41-\\u0d43'
832
- + '\\u0d4d-\\u0d4d'
833
- + '\\u0dca-\\u0dca'
834
- + '\\u0dd2-\\u0dd4'
835
- + '\\u0dd6-\\u0dd6'
836
- + '\\u0e31-\\u0e31'
837
- + '\\u0e34-\\u0e3a'
838
- + '\\u0e47-\\u0e4e'
839
- + '\\u0eb1-\\u0eb1'
840
- + '\\u0eb4-\\u0eb9'
841
- + '\\u0ebb-\\u0ebc'
842
- + '\\u0ec8-\\u0ecd'
843
- + '\\u0f18-\\u0f19'
844
- + '\\u0f35-\\u0f35'
845
- + '\\u0f37-\\u0f37'
846
- + '\\u0f39-\\u0f39'
847
- + '\\u0f71-\\u0f7e'
848
- + '\\u0f80-\\u0f84'
849
- + '\\u0f86-\\u0f87'
850
- + '\\u0f90-\\u0f97'
851
- + '\\u0f99-\\u0fbc'
852
- + '\\u0fc6-\\u0fc6'
853
- + '\\u102d-\\u1030'
854
- + '\\u1032-\\u1032'
855
- + '\\u1036-\\u1037'
856
- + '\\u1039-\\u1039'
857
- + '\\u1058-\\u1059'
858
- + '\\u1160-\\u11ff'
859
- + '\\u135f-\\u135f'
860
- + '\\u1712-\\u1714'
861
- + '\\u1732-\\u1734'
862
- + '\\u1752-\\u1753'
863
- + '\\u1772-\\u1773'
864
- + '\\u17b4-\\u17b5'
865
- + '\\u17b7-\\u17bd'
866
- + '\\u17c6-\\u17c6'
867
- + '\\u17c9-\\u17d3'
868
- + '\\u17dd-\\u17dd'
869
- + '\\u180b-\\u180d'
870
- + '\\u18a9-\\u18a9'
871
- + '\\u1920-\\u1922'
872
- + '\\u1927-\\u1928'
873
- + '\\u1932-\\u1932'
874
- + '\\u1939-\\u193b'
875
- + '\\u1a17-\\u1a18'
876
- + '\\u1b00-\\u1b03'
877
- + '\\u1b34-\\u1b34'
878
- + '\\u1b36-\\u1b3a'
879
- + '\\u1b3c-\\u1b3c'
880
- + '\\u1b42-\\u1b42'
881
- + '\\u1b6b-\\u1b73'
882
- + '\\u1dc0-\\u1dca'
883
- + '\\u1dfe-\\u1dff'
884
- + '\\u200b-\\u200f'
885
- + '\\u202a-\\u202e'
886
- + '\\u2060-\\u2063'
887
- + '\\u206a-\\u206f'
888
- + '\\u20d0-\\u20ef'
889
- + '\\u302a-\\u302f'
890
- + '\\u3099-\\u309a'
891
- + '\\ua806-\\ua806'
892
- + '\\ua80b-\\ua80b'
893
- + '\\ua825-\\ua826'
894
- + '\\ufb1e-\\ufb1e'
895
- + '\\ufe00-\\ufe0f'
896
- + '\\ufe20-\\ufe23'
897
- + '\\ufeff-\\ufeff'
898
- + '\\ufff9-\\ufffb'
899
- + ']'
900
- + '|[\\ud802-\\ud802][\\ude01-\\ude03]'
901
- + '|[\\ud802-\\ud802][\\ude05-\\ude06]'
902
- + '|[\\ud802-\\ud802][\\ude0c-\\ude0f]'
903
- + '|[\\ud802-\\ud802][\\ude38-\\ude3a]'
904
- + '|[\\ud802-\\ud802][\\ude3f-\\ude3f]'
905
- + '|[\\ud834-\\ud834][\\udd67-\\udd69]'
906
- + '|[\\ud834-\\ud834][\\udd73-\\udd82]'
907
- + '|[\\ud834-\\ud834][\\udd85-\\udd8b]'
908
- + '|[\\ud834-\\ud834][\\uddaa-\\uddad]'
909
- + '|[\\ud834-\\ud834][\\ude42-\\ude44]'
910
- + '|[\\udb40-\\udb40][\\udc01-\\udc01]'
911
- + '|[\\udb40-\\udb40][\\udc20-\\udc7f]'
912
- + '|[\\udb40-\\udb40][\\udd00-\\uddef]'
913
- , 'g');
914
- */