muhammara 2.0.0 → 2.3.0

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 (111) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +2 -2
  3. package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +10 -0
  4. package/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.json +16 -0
  5. package/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js +1 -1
  6. package/node_modules/@mapbox/node-pre-gyp/package.json +10 -11
  7. package/node_modules/ansi-regex/index.d.ts +37 -0
  8. package/node_modules/ansi-regex/index.js +4 -4
  9. package/node_modules/ansi-regex/package.json +17 -15
  10. package/node_modules/ansi-regex/readme.md +35 -3
  11. package/node_modules/brace-expansion/package.json +2 -1
  12. package/node_modules/debug/LICENSE +10 -9
  13. package/node_modules/debug/README.md +27 -1
  14. package/node_modules/debug/package.json +15 -15
  15. package/node_modules/debug/src/common.js +2 -2
  16. package/node_modules/detect-libc/README.md +124 -42
  17. package/node_modules/detect-libc/index.d.ts +11 -0
  18. package/node_modules/detect-libc/lib/detect-libc.js +166 -80
  19. package/node_modules/detect-libc/lib/process.js +16 -0
  20. package/node_modules/detect-libc/package.json +20 -19
  21. package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
  22. package/node_modules/emoji-regex/README.md +73 -0
  23. package/node_modules/emoji-regex/es2015/index.js +6 -0
  24. package/node_modules/emoji-regex/es2015/text.js +6 -0
  25. package/node_modules/emoji-regex/index.d.ts +23 -0
  26. package/node_modules/emoji-regex/index.js +6 -0
  27. package/node_modules/emoji-regex/package.json +77 -0
  28. package/node_modules/emoji-regex/text.js +6 -0
  29. package/node_modules/gauge/package.json +7 -7
  30. package/node_modules/https-proxy-agent/dist/agent.js +2 -5
  31. package/node_modules/https-proxy-agent/dist/agent.js.map +1 -1
  32. package/node_modules/https-proxy-agent/package.json +5 -5
  33. package/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  34. package/node_modules/is-fullwidth-code-point/index.js +25 -21
  35. package/node_modules/is-fullwidth-code-point/license +4 -16
  36. package/node_modules/is-fullwidth-code-point/package.json +18 -24
  37. package/node_modules/is-fullwidth-code-point/readme.md +6 -6
  38. package/node_modules/minimatch/README.md +22 -1
  39. package/node_modules/minimatch/minimatch.js +93 -69
  40. package/node_modules/minimatch/package.json +11 -10
  41. package/node_modules/minipass/index.js +6 -1
  42. package/node_modules/minipass/package.json +5 -5
  43. package/node_modules/node-fetch/lib/index.es.js +29 -3
  44. package/node_modules/node-fetch/lib/index.js +29 -3
  45. package/node_modules/node-fetch/lib/index.mjs +29 -3
  46. package/node_modules/node-fetch/package.json +18 -10
  47. package/node_modules/semver/README.md +3 -1
  48. package/node_modules/semver/bin/semver.js +19 -9
  49. package/node_modules/semver/classes/comparator.js +3 -2
  50. package/node_modules/semver/classes/index.js +1 -1
  51. package/node_modules/semver/classes/range.js +31 -22
  52. package/node_modules/semver/classes/semver.js +1 -1
  53. package/node_modules/semver/functions/cmp.js +8 -4
  54. package/node_modules/semver/functions/coerce.js +3 -2
  55. package/node_modules/semver/functions/inc.js +4 -1
  56. package/node_modules/semver/functions/parse.js +1 -1
  57. package/node_modules/semver/internal/constants.js +2 -2
  58. package/node_modules/semver/internal/identifiers.js +1 -1
  59. package/node_modules/semver/internal/parse-options.js +3 -3
  60. package/node_modules/semver/internal/re.js +3 -3
  61. package/node_modules/semver/package.json +46 -13
  62. package/node_modules/semver/ranges/min-version.js +2 -1
  63. package/node_modules/semver/ranges/outside.js +1 -1
  64. package/node_modules/semver/ranges/simplify.js +15 -12
  65. package/node_modules/semver/ranges/subset.js +53 -31
  66. package/node_modules/signal-exit/index.js +34 -10
  67. package/node_modules/signal-exit/package.json +11 -9
  68. package/node_modules/string-width/index.d.ts +29 -0
  69. package/node_modules/string-width/index.js +16 -5
  70. package/node_modules/string-width/package.json +20 -20
  71. package/node_modules/string-width/readme.md +15 -7
  72. package/node_modules/strip-ansi/index.d.ts +17 -0
  73. package/node_modules/strip-ansi/index.js +1 -1
  74. package/node_modules/strip-ansi/package.json +19 -17
  75. package/node_modules/strip-ansi/readme.md +12 -5
  76. package/package.json +1 -1
  77. package/src/DocumentCopyingContextDriver.cpp +6 -6
  78. package/src/deps/PDFWriter/CMakeLists.txt +8 -0
  79. package/src/deps/PDFWriter/DecryptionHelper.cpp +10 -8
  80. package/src/deps/PDFWriter/Deletable.h +46 -0
  81. package/src/deps/PDFWriter/DocumentContext.h +3 -3
  82. package/src/deps/PDFWriter/IDeletable.h +6 -0
  83. package/src/deps/PDFWriter/InputLZWDecodeStream.cpp +208 -0
  84. package/src/deps/PDFWriter/InputLZWDecodeStream.h +77 -0
  85. package/src/deps/PDFWriter/InputStreamSkipperStream.cpp +1 -1
  86. package/src/deps/PDFWriter/JPEGImageHandler.h +2 -2
  87. package/src/deps/PDFWriter/ObjectsContext.cpp +5 -0
  88. package/src/deps/PDFWriter/ObjectsContext.h +1 -0
  89. package/src/deps/PDFWriter/PDFDocumentHandler.cpp +19 -3
  90. package/src/deps/PDFWriter/PDFObject.cpp +13 -11
  91. package/src/deps/PDFWriter/PDFObject.h +7 -5
  92. package/src/deps/PDFWriter/PDFObjectParser.cpp +8 -0
  93. package/src/deps/PDFWriter/PDFObjectParser.h +6 -0
  94. package/src/deps/PDFWriter/PDFParser.cpp +25 -13
  95. package/src/deps/PDFWriter/PDFParserTokenizer.cpp +25 -24
  96. package/src/deps/PDFWriter/PDFParserTokenizer.h +1 -0
  97. package/src/deps/PDFWriter/PDFWriter.h +2 -2
  98. package/src/deps/PDFWriter/binding.gyp +2 -0
  99. package/node_modules/detect-libc/.npmignore +0 -7
  100. package/node_modules/detect-libc/bin/detect-libc.js +0 -18
  101. package/node_modules/semver/CHANGELOG.md +0 -111
  102. package/src/deps/PDFWriter/InputPredictorPNGAverageStream.cpp +0 -120
  103. package/src/deps/PDFWriter/InputPredictorPNGAverageStream.h +0 -49
  104. package/src/deps/PDFWriter/InputPredictorPNGNoneStream.cpp +0 -109
  105. package/src/deps/PDFWriter/InputPredictorPNGNoneStream.h +0 -47
  106. package/src/deps/PDFWriter/InputPredictorPNGPaethStream.cpp +0 -136
  107. package/src/deps/PDFWriter/InputPredictorPNGPaethStream.h +0 -51
  108. package/src/deps/PDFWriter/InputPredictorPNGSubStream.cpp +0 -113
  109. package/src/deps/PDFWriter/InputPredictorPNGSubStream.h +0 -47
  110. package/src/deps/PDFWriter/InputPredictorPNGUpStream.cpp +0 -120
  111. package/src/deps/PDFWriter/InputPredictorPNGUpStream.h +0 -49
@@ -41,8 +41,9 @@ const compare = require('../functions/compare.js')
41
41
  // - Else return true
42
42
 
43
43
  const subset = (sub, dom, options = {}) => {
44
- if (sub === dom)
44
+ if (sub === dom) {
45
45
  return true
46
+ }
46
47
 
47
48
  sub = new Range(sub, options)
48
49
  dom = new Range(dom, options)
@@ -52,73 +53,84 @@ const subset = (sub, dom, options = {}) => {
52
53
  for (const simpleDom of dom.set) {
53
54
  const isSub = simpleSubset(simpleSub, simpleDom, options)
54
55
  sawNonNull = sawNonNull || isSub !== null
55
- if (isSub)
56
+ if (isSub) {
56
57
  continue OUTER
58
+ }
57
59
  }
58
60
  // the null set is a subset of everything, but null simple ranges in
59
61
  // a complex range should be ignored. so if we saw a non-null range,
60
62
  // then we know this isn't a subset, but if EVERY simple range was null,
61
63
  // then it is a subset.
62
- if (sawNonNull)
64
+ if (sawNonNull) {
63
65
  return false
66
+ }
64
67
  }
65
68
  return true
66
69
  }
67
70
 
68
71
  const simpleSubset = (sub, dom, options) => {
69
- if (sub === dom)
72
+ if (sub === dom) {
70
73
  return true
74
+ }
71
75
 
72
76
  if (sub.length === 1 && sub[0].semver === ANY) {
73
- if (dom.length === 1 && dom[0].semver === ANY)
77
+ if (dom.length === 1 && dom[0].semver === ANY) {
74
78
  return true
75
- else if (options.includePrerelease)
76
- sub = [ new Comparator('>=0.0.0-0') ]
77
- else
78
- sub = [ new Comparator('>=0.0.0') ]
79
+ } else if (options.includePrerelease) {
80
+ sub = [new Comparator('>=0.0.0-0')]
81
+ } else {
82
+ sub = [new Comparator('>=0.0.0')]
83
+ }
79
84
  }
80
85
 
81
86
  if (dom.length === 1 && dom[0].semver === ANY) {
82
- if (options.includePrerelease)
87
+ if (options.includePrerelease) {
83
88
  return true
84
- else
85
- dom = [ new Comparator('>=0.0.0') ]
89
+ } else {
90
+ dom = [new Comparator('>=0.0.0')]
91
+ }
86
92
  }
87
93
 
88
94
  const eqSet = new Set()
89
95
  let gt, lt
90
96
  for (const c of sub) {
91
- if (c.operator === '>' || c.operator === '>=')
97
+ if (c.operator === '>' || c.operator === '>=') {
92
98
  gt = higherGT(gt, c, options)
93
- else if (c.operator === '<' || c.operator === '<=')
99
+ } else if (c.operator === '<' || c.operator === '<=') {
94
100
  lt = lowerLT(lt, c, options)
95
- else
101
+ } else {
96
102
  eqSet.add(c.semver)
103
+ }
97
104
  }
98
105
 
99
- if (eqSet.size > 1)
106
+ if (eqSet.size > 1) {
100
107
  return null
108
+ }
101
109
 
102
110
  let gtltComp
103
111
  if (gt && lt) {
104
112
  gtltComp = compare(gt.semver, lt.semver, options)
105
- if (gtltComp > 0)
113
+ if (gtltComp > 0) {
106
114
  return null
107
- else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))
115
+ } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
108
116
  return null
117
+ }
109
118
  }
110
119
 
111
120
  // will iterate one or zero times
112
121
  for (const eq of eqSet) {
113
- if (gt && !satisfies(eq, String(gt), options))
122
+ if (gt && !satisfies(eq, String(gt), options)) {
114
123
  return null
124
+ }
115
125
 
116
- if (lt && !satisfies(eq, String(lt), options))
126
+ if (lt && !satisfies(eq, String(lt), options)) {
117
127
  return null
128
+ }
118
129
 
119
130
  for (const c of dom) {
120
- if (!satisfies(eq, String(c), options))
131
+ if (!satisfies(eq, String(c), options)) {
121
132
  return false
133
+ }
122
134
  }
123
135
 
124
136
  return true
@@ -154,10 +166,12 @@ const simpleSubset = (sub, dom, options) => {
154
166
  }
155
167
  if (c.operator === '>' || c.operator === '>=') {
156
168
  higher = higherGT(gt, c, options)
157
- if (higher === c && higher !== gt)
169
+ if (higher === c && higher !== gt) {
158
170
  return false
159
- } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))
171
+ }
172
+ } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
160
173
  return false
174
+ }
161
175
  }
162
176
  if (lt) {
163
177
  if (needDomLTPre) {
@@ -170,37 +184,44 @@ const simpleSubset = (sub, dom, options) => {
170
184
  }
171
185
  if (c.operator === '<' || c.operator === '<=') {
172
186
  lower = lowerLT(lt, c, options)
173
- if (lower === c && lower !== lt)
187
+ if (lower === c && lower !== lt) {
174
188
  return false
175
- } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))
189
+ }
190
+ } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
176
191
  return false
192
+ }
177
193
  }
178
- if (!c.operator && (lt || gt) && gtltComp !== 0)
194
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
179
195
  return false
196
+ }
180
197
  }
181
198
 
182
199
  // if there was a < or >, and nothing in the dom, then must be false
183
200
  // UNLESS it was limited by another range in the other direction.
184
201
  // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
185
- if (gt && hasDomLT && !lt && gtltComp !== 0)
202
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
186
203
  return false
204
+ }
187
205
 
188
- if (lt && hasDomGT && !gt && gtltComp !== 0)
206
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
189
207
  return false
208
+ }
190
209
 
191
210
  // we needed a prerelease range in a specific tuple, but didn't get one
192
211
  // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
193
212
  // because it includes prereleases in the 1.2.3 tuple
194
- if (needDomGTPre || needDomLTPre)
213
+ if (needDomGTPre || needDomLTPre) {
195
214
  return false
215
+ }
196
216
 
197
217
  return true
198
218
  }
199
219
 
200
220
  // >=1.2.3 is lower than >1.2.3
201
221
  const higherGT = (a, b, options) => {
202
- if (!a)
222
+ if (!a) {
203
223
  return b
224
+ }
204
225
  const comp = compare(a.semver, b.semver, options)
205
226
  return comp > 0 ? a
206
227
  : comp < 0 ? b
@@ -210,8 +231,9 @@ const higherGT = (a, b, options) => {
210
231
 
211
232
  // <=1.2.3 is higher than <1.2.3
212
233
  const lowerLT = (a, b, options) => {
213
- if (!a)
234
+ if (!a) {
214
235
  return b
236
+ }
215
237
  const comp = compare(a.semver, b.semver, options)
216
238
  return comp < 0 ? a
217
239
  : comp > 0 ? b
@@ -3,9 +3,25 @@
3
3
  // ignored, since we can never get coverage for them.
4
4
  // grab a reference to node's real process object right away
5
5
  var process = global.process
6
+
7
+ const processOk = function (process) {
8
+ return process &&
9
+ typeof process === 'object' &&
10
+ typeof process.removeListener === 'function' &&
11
+ typeof process.emit === 'function' &&
12
+ typeof process.reallyExit === 'function' &&
13
+ typeof process.listeners === 'function' &&
14
+ typeof process.kill === 'function' &&
15
+ typeof process.pid === 'number' &&
16
+ typeof process.on === 'function'
17
+ }
18
+
6
19
  // some kind of non-node environment, just no-op
7
- if (typeof process !== 'object' || !process) {
8
- module.exports = function () {}
20
+ /* istanbul ignore if */
21
+ if (!processOk(process)) {
22
+ module.exports = function () {
23
+ return function () {}
24
+ }
9
25
  } else {
10
26
  var assert = require('assert')
11
27
  var signals = require('./signals.js')
@@ -36,8 +52,9 @@ if (typeof process !== 'object' || !process) {
36
52
  }
37
53
 
38
54
  module.exports = function (cb, opts) {
39
- if (global.process !== process) {
40
- return
55
+ /* istanbul ignore if */
56
+ if (!processOk(global.process)) {
57
+ return function () {}
41
58
  }
42
59
  assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
43
60
 
@@ -63,7 +80,7 @@ if (typeof process !== 'object' || !process) {
63
80
  }
64
81
 
65
82
  var unload = function unload () {
66
- if (!loaded || global.process !== process) {
83
+ if (!loaded || !processOk(global.process)) {
67
84
  return
68
85
  }
69
86
  loaded = false
@@ -80,6 +97,7 @@ if (typeof process !== 'object' || !process) {
80
97
  module.exports.unload = unload
81
98
 
82
99
  var emit = function emit (event, code, signal) {
100
+ /* istanbul ignore if */
83
101
  if (emitter.emitted[event]) {
84
102
  return
85
103
  }
@@ -91,7 +109,8 @@ if (typeof process !== 'object' || !process) {
91
109
  var sigListeners = {}
92
110
  signals.forEach(function (sig) {
93
111
  sigListeners[sig] = function listener () {
94
- if (process !== global.process) {
112
+ /* istanbul ignore if */
113
+ if (!processOk(global.process)) {
95
114
  return
96
115
  }
97
116
  // If there are no other listeners, an exit is coming!
@@ -110,6 +129,7 @@ if (typeof process !== 'object' || !process) {
110
129
  // so use a supported signal instead
111
130
  sig = 'SIGINT'
112
131
  }
132
+ /* istanbul ignore next */
113
133
  process.kill(process.pid, sig)
114
134
  }
115
135
  }
@@ -122,7 +142,7 @@ if (typeof process !== 'object' || !process) {
122
142
  var loaded = false
123
143
 
124
144
  var load = function load () {
125
- if (loaded || process !== global.process) {
145
+ if (loaded || !processOk(global.process)) {
126
146
  return
127
147
  }
128
148
  loaded = true
@@ -149,10 +169,11 @@ if (typeof process !== 'object' || !process) {
149
169
 
150
170
  var originalProcessReallyExit = process.reallyExit
151
171
  var processReallyExit = function processReallyExit (code) {
152
- if (process !== global.process) {
172
+ /* istanbul ignore if */
173
+ if (!processOk(global.process)) {
153
174
  return
154
175
  }
155
- process.exitCode = code || 0
176
+ process.exitCode = code || /* istanbul ignore next */ 0
156
177
  emit('exit', process.exitCode, null)
157
178
  /* istanbul ignore next */
158
179
  emit('afterexit', process.exitCode, null)
@@ -162,14 +183,17 @@ if (typeof process !== 'object' || !process) {
162
183
 
163
184
  var originalProcessEmit = process.emit
164
185
  var processEmit = function processEmit (ev, arg) {
165
- if (ev === 'exit' && process === global.process) {
186
+ if (ev === 'exit' && processOk(global.process)) {
187
+ /* istanbul ignore else */
166
188
  if (arg !== undefined) {
167
189
  process.exitCode = arg
168
190
  }
169
191
  var ret = originalProcessEmit.apply(this, arguments)
192
+ /* istanbul ignore next */
170
193
  emit('exit', process.exitCode, null)
171
194
  /* istanbul ignore next */
172
195
  emit('afterexit', process.exitCode, null)
196
+ /* istanbul ignore next */
173
197
  return ret
174
198
  } else {
175
199
  return originalProcessEmit.apply(this, arguments)
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "signal-exit@^3.0.0",
3
- "_id": "signal-exit@3.0.5",
3
+ "_id": "signal-exit@3.0.7",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==",
5
+ "_integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
6
6
  "_location": "/signal-exit",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,8 +18,8 @@
18
18
  "_requiredBy": [
19
19
  "/gauge"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz",
22
- "_shasum": "9e3e8cc0c75a99472b44321033a7702e7738252f",
21
+ "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
22
+ "_shasum": "a9a1767f8af84155114eaabd73f99273c8f59ad9",
23
23
  "_spec": "signal-exit@^3.0.0",
24
24
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/gauge",
25
25
  "author": {
@@ -37,7 +37,7 @@
37
37
  "coveralls": "^3.1.1",
38
38
  "nyc": "^15.1.0",
39
39
  "standard-version": "^9.3.1",
40
- "tap": "^15.0.10"
40
+ "tap": "^15.1.1"
41
41
  },
42
42
  "files": [
43
43
  "index.js",
@@ -56,9 +56,11 @@
56
56
  "url": "git+https://github.com/tapjs/signal-exit.git"
57
57
  },
58
58
  "scripts": {
59
- "coverage": "nyc report --reporter=text-lcov | coveralls",
60
- "release": "standard-version",
61
- "test": "tap --timeout=240 ./test/*.js --cov"
59
+ "postversion": "npm publish",
60
+ "prepublishOnly": "git push origin --follow-tags",
61
+ "preversion": "npm test",
62
+ "snap": "tap",
63
+ "test": "tap"
62
64
  },
63
- "version": "3.0.5"
65
+ "version": "3.0.7"
64
66
  }
@@ -0,0 +1,29 @@
1
+ declare const stringWidth: {
2
+ /**
3
+ Get the visual width of a string - the number of columns required to display it.
4
+
5
+ Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
6
+
7
+ @example
8
+ ```
9
+ import stringWidth = require('string-width');
10
+
11
+ stringWidth('a');
12
+ //=> 1
13
+
14
+ stringWidth('古');
15
+ //=> 2
16
+
17
+ stringWidth('\u001B[1m古\u001B[22m');
18
+ //=> 2
19
+ ```
20
+ */
21
+ (string: string): number;
22
+
23
+ // TODO: remove this in the next major version, refactor the whole definition to:
24
+ // declare function stringWidth(string: string): number;
25
+ // export = stringWidth;
26
+ default: typeof stringWidth;
27
+ }
28
+
29
+ export = stringWidth;
@@ -1,18 +1,25 @@
1
1
  'use strict';
2
2
  const stripAnsi = require('strip-ansi');
3
3
  const isFullwidthCodePoint = require('is-fullwidth-code-point');
4
+ const emojiRegex = require('emoji-regex');
4
5
 
5
- module.exports = str => {
6
- if (typeof str !== 'string' || str.length === 0) {
6
+ const stringWidth = string => {
7
+ if (typeof string !== 'string' || string.length === 0) {
7
8
  return 0;
8
9
  }
9
10
 
10
- str = stripAnsi(str);
11
+ string = stripAnsi(string);
12
+
13
+ if (string.length === 0) {
14
+ return 0;
15
+ }
16
+
17
+ string = string.replace(emojiRegex(), ' ');
11
18
 
12
19
  let width = 0;
13
20
 
14
- for (let i = 0; i < str.length; i++) {
15
- const code = str.codePointAt(i);
21
+ for (let i = 0; i < string.length; i++) {
22
+ const code = string.codePointAt(i);
16
23
 
17
24
  // Ignore control characters
18
25
  if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
@@ -34,3 +41,7 @@ module.exports = str => {
34
41
 
35
42
  return width;
36
43
  };
44
+
45
+ module.exports = stringWidth;
46
+ // TODO: remove this in the next major version
47
+ module.exports.default = stringWidth;
@@ -1,28 +1,27 @@
1
1
  {
2
- "_from": "string-width@^1.0.1 || ^2.0.0",
3
- "_id": "string-width@2.1.1",
2
+ "_from": "string-width@^4.2.3",
3
+ "_id": "string-width@4.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
5
+ "_integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
6
6
  "_location": "/string-width",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "string-width@^1.0.1 || ^2.0.0",
11
+ "raw": "string-width@^4.2.3",
12
12
  "name": "string-width",
13
13
  "escapedName": "string-width",
14
- "rawSpec": "^1.0.1 || ^2.0.0",
14
+ "rawSpec": "^4.2.3",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^1.0.1 || ^2.0.0"
16
+ "fetchSpec": "^4.2.3"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/gauge",
20
- "/mocha/wide-align",
21
20
  "/wide-align"
22
21
  ],
23
- "_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
24
- "_shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e",
25
- "_spec": "string-width@^1.0.1 || ^2.0.0",
22
+ "_resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
23
+ "_shasum": "269c7117d27b05ad2e536830a8ec895ef9c6d010",
24
+ "_spec": "string-width@^4.2.3",
26
25
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/gauge",
27
26
  "author": {
28
27
  "name": "Sindre Sorhus",
@@ -34,27 +33,28 @@
34
33
  },
35
34
  "bundleDependencies": false,
36
35
  "dependencies": {
37
- "is-fullwidth-code-point": "^2.0.0",
38
- "strip-ansi": "^4.0.0"
36
+ "emoji-regex": "^8.0.0",
37
+ "is-fullwidth-code-point": "^3.0.0",
38
+ "strip-ansi": "^6.0.1"
39
39
  },
40
40
  "deprecated": false,
41
41
  "description": "Get the visual width of a string - the number of columns required to display it",
42
42
  "devDependencies": {
43
- "ava": "*",
44
- "xo": "*"
43
+ "ava": "^1.4.1",
44
+ "tsd": "^0.7.1",
45
+ "xo": "^0.24.0"
45
46
  },
46
47
  "engines": {
47
- "node": ">=4"
48
+ "node": ">=8"
48
49
  },
49
50
  "files": [
50
- "index.js"
51
+ "index.js",
52
+ "index.d.ts"
51
53
  ],
52
54
  "homepage": "https://github.com/sindresorhus/string-width#readme",
53
55
  "keywords": [
54
56
  "string",
55
- "str",
56
57
  "character",
57
- "char",
58
58
  "unicode",
59
59
  "width",
60
60
  "visual",
@@ -83,7 +83,7 @@
83
83
  "url": "git+https://github.com/sindresorhus/string-width.git"
84
84
  },
85
85
  "scripts": {
86
- "test": "xo && ava"
86
+ "test": "xo && ava && tsd"
87
87
  },
88
- "version": "2.1.1"
88
+ "version": "4.2.3"
89
89
  }
@@ -1,4 +1,4 @@
1
- # string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width)
1
+ # string-width
2
2
 
3
3
  > Get the visual width of a string - the number of columns required to display it
4
4
 
@@ -19,14 +19,14 @@ $ npm install string-width
19
19
  ```js
20
20
  const stringWidth = require('string-width');
21
21
 
22
+ stringWidth('a');
23
+ //=> 1
24
+
22
25
  stringWidth('古');
23
26
  //=> 2
24
27
 
25
- stringWidth('\u001b[1m古\u001b[22m');
28
+ stringWidth('\u001B[1m古\u001B[22m');
26
29
  //=> 2
27
-
28
- stringWidth('a');
29
- //=> 1
30
30
  ```
31
31
 
32
32
 
@@ -37,6 +37,14 @@ stringWidth('a');
37
37
  - [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
38
38
 
39
39
 
40
- ## License
40
+ ---
41
41
 
42
- MIT © [Sindre Sorhus](https://sindresorhus.com)
42
+ <div align="center">
43
+ <b>
44
+ <a href="https://tidelift.com/subscription/pkg/npm-string-width?utm_source=npm-string-width&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
45
+ </b>
46
+ <br>
47
+ <sub>
48
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
49
+ </sub>
50
+ </div>
@@ -0,0 +1,17 @@
1
+ /**
2
+ Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
3
+
4
+ @example
5
+ ```
6
+ import stripAnsi = require('strip-ansi');
7
+
8
+ stripAnsi('\u001B[4mUnicorn\u001B[0m');
9
+ //=> 'Unicorn'
10
+
11
+ stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
12
+ //=> 'Click'
13
+ ```
14
+ */
15
+ declare function stripAnsi(string: string): string;
16
+
17
+ export = stripAnsi;
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
  const ansiRegex = require('ansi-regex');
3
3
 
4
- module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
4
+ module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
@@ -1,27 +1,27 @@
1
1
  {
2
- "_from": "strip-ansi@^3.0.1 || ^4.0.0",
3
- "_id": "strip-ansi@4.0.0",
2
+ "_from": "strip-ansi@^6.0.1",
3
+ "_id": "strip-ansi@6.0.1",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
5
+ "_integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
6
6
  "_location": "/strip-ansi",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "strip-ansi@^3.0.1 || ^4.0.0",
11
+ "raw": "strip-ansi@^6.0.1",
12
12
  "name": "strip-ansi",
13
13
  "escapedName": "strip-ansi",
14
- "rawSpec": "^3.0.1 || ^4.0.0",
14
+ "rawSpec": "^6.0.1",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^3.0.1 || ^4.0.0"
16
+ "fetchSpec": "^6.0.1"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/gauge",
20
20
  "/string-width"
21
21
  ],
22
- "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
23
- "_shasum": "a8479022eb1ac368a871389b635262c505ee368f",
24
- "_spec": "strip-ansi@^3.0.1 || ^4.0.0",
22
+ "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
23
+ "_shasum": "9e26c63d30f53443e9489495b2105d37b67a85d9",
24
+ "_spec": "strip-ansi@^6.0.1",
25
25
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/gauge",
26
26
  "author": {
27
27
  "name": "Sindre Sorhus",
@@ -33,19 +33,21 @@
33
33
  },
34
34
  "bundleDependencies": false,
35
35
  "dependencies": {
36
- "ansi-regex": "^3.0.0"
36
+ "ansi-regex": "^5.0.1"
37
37
  },
38
38
  "deprecated": false,
39
- "description": "Strip ANSI escape codes",
39
+ "description": "Strip ANSI escape codes from a string",
40
40
  "devDependencies": {
41
- "ava": "*",
42
- "xo": "*"
41
+ "ava": "^2.4.0",
42
+ "tsd": "^0.10.0",
43
+ "xo": "^0.25.3"
43
44
  },
44
45
  "engines": {
45
- "node": ">=4"
46
+ "node": ">=8"
46
47
  },
47
48
  "files": [
48
- "index.js"
49
+ "index.js",
50
+ "index.d.ts"
49
51
  ],
50
52
  "homepage": "https://github.com/chalk/strip-ansi#readme",
51
53
  "keywords": [
@@ -79,7 +81,7 @@
79
81
  "url": "git+https://github.com/chalk/strip-ansi.git"
80
82
  },
81
83
  "scripts": {
82
- "test": "xo && ava"
84
+ "test": "xo && ava && tsd"
83
85
  },
84
- "version": "4.0.0"
86
+ "version": "6.0.1"
85
87
  }