@aws-solutions-constructs/core 2.50.0 → 2.52.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 (200) hide show
  1. package/.eslintignore +2 -0
  2. package/.jsii +50 -5
  3. package/node_modules/ansi-regex/index.js +8 -2
  4. package/node_modules/ansi-regex/license +4 -16
  5. package/node_modules/ansi-regex/package.json +53 -62
  6. package/node_modules/ansi-regex/readme.md +48 -9
  7. package/node_modules/aproba/index.js +33 -33
  8. package/node_modules/aproba/package.json +5 -4
  9. package/node_modules/are-we-there-yet/LICENSE.md +18 -0
  10. package/node_modules/are-we-there-yet/README.md +16 -3
  11. package/node_modules/are-we-there-yet/lib/tracker-base.js +13 -0
  12. package/node_modules/are-we-there-yet/lib/tracker-group.js +112 -0
  13. package/node_modules/are-we-there-yet/lib/tracker-stream.js +42 -0
  14. package/node_modules/are-we-there-yet/lib/tracker.js +34 -0
  15. package/node_modules/are-we-there-yet/package.json +38 -20
  16. package/node_modules/color-support/README.md +129 -0
  17. package/node_modules/color-support/bin.js +3 -0
  18. package/node_modules/color-support/browser.js +14 -0
  19. package/node_modules/color-support/index.js +134 -0
  20. package/node_modules/color-support/package.json +36 -0
  21. package/node_modules/gauge/LICENSE.md +20 -0
  22. package/node_modules/gauge/README.md +19 -16
  23. package/node_modules/gauge/{base-theme.js → lib/base-theme.js} +7 -3
  24. package/node_modules/gauge/lib/has-color.js +4 -0
  25. package/node_modules/gauge/{index.js → lib/index.js} +90 -34
  26. package/node_modules/gauge/{plumbing.js → lib/plumbing.js} +3 -1
  27. package/node_modules/gauge/{progress-bar.js → lib/progress-bar.js} +12 -6
  28. package/node_modules/gauge/{render-template.js → lib/render-template.js} +69 -28
  29. package/node_modules/gauge/{template-item.js → lib/template-item.js} +21 -7
  30. package/node_modules/gauge/{theme-set.js → lib/theme-set.js} +31 -24
  31. package/node_modules/gauge/lib/themes.js +56 -0
  32. package/node_modules/gauge/{wide-truncate.js → lib/wide-truncate.js} +9 -3
  33. package/node_modules/gauge/package.json +47 -42
  34. package/node_modules/is-fullwidth-code-point/index.js +40 -36
  35. package/node_modules/is-fullwidth-code-point/license +4 -16
  36. package/node_modules/is-fullwidth-code-point/package.json +40 -43
  37. package/node_modules/is-fullwidth-code-point/readme.md +8 -8
  38. package/node_modules/npmlog/LICENSE.md +20 -0
  39. package/node_modules/npmlog/{log.js → lib/log.js} +149 -58
  40. package/node_modules/npmlog/package.json +36 -12
  41. package/node_modules/signal-exit/LICENSE.txt +1 -1
  42. package/node_modules/signal-exit/README.md +56 -21
  43. package/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
  44. package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
  45. package/node_modules/signal-exit/dist/cjs/browser.js +10 -0
  46. package/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
  47. package/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
  48. package/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
  49. package/node_modules/signal-exit/dist/cjs/index.js +279 -0
  50. package/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
  51. package/node_modules/signal-exit/dist/cjs/package.json +3 -0
  52. package/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
  53. package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
  54. package/node_modules/signal-exit/dist/cjs/signals.js +42 -0
  55. package/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
  56. package/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
  57. package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
  58. package/node_modules/signal-exit/dist/mjs/browser.js +4 -0
  59. package/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
  60. package/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
  61. package/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
  62. package/node_modules/signal-exit/dist/mjs/index.js +275 -0
  63. package/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
  64. package/node_modules/signal-exit/dist/mjs/package.json +3 -0
  65. package/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
  66. package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
  67. package/node_modules/signal-exit/dist/mjs/signals.js +39 -0
  68. package/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
  69. package/node_modules/signal-exit/package.json +87 -19
  70. package/node_modules/string-width/index.js +29 -19
  71. package/node_modules/string-width/license +4 -16
  72. package/node_modules/string-width/package.json +54 -54
  73. package/node_modules/string-width/readme.md +17 -9
  74. package/node_modules/strip-ansi/index.js +2 -4
  75. package/node_modules/strip-ansi/license +4 -16
  76. package/node_modules/strip-ansi/package.json +52 -55
  77. package/node_modules/strip-ansi/readme.md +20 -7
  78. package/package.json +11 -10
  79. package/test/test-helper.d.ts +1 -1
  80. package/test/test-helper.js +5 -5
  81. package/node_modules/are-we-there-yet/CHANGES.md +0 -37
  82. package/node_modules/are-we-there-yet/LICENSE +0 -5
  83. package/node_modules/are-we-there-yet/tracker-base.js +0 -11
  84. package/node_modules/are-we-there-yet/tracker-group.js +0 -107
  85. package/node_modules/are-we-there-yet/tracker-stream.js +0 -36
  86. package/node_modules/are-we-there-yet/tracker.js +0 -30
  87. package/node_modules/code-point-at/index.js +0 -32
  88. package/node_modules/code-point-at/license +0 -21
  89. package/node_modules/code-point-at/package.json +0 -38
  90. package/node_modules/code-point-at/readme.md +0 -32
  91. package/node_modules/core-util-is/LICENSE +0 -19
  92. package/node_modules/core-util-is/README.md +0 -3
  93. package/node_modules/core-util-is/lib/util.js +0 -107
  94. package/node_modules/core-util-is/package.json +0 -38
  95. package/node_modules/delegates/.npmignore +0 -1
  96. package/node_modules/delegates/History.md +0 -22
  97. package/node_modules/delegates/License +0 -20
  98. package/node_modules/delegates/Makefile +0 -8
  99. package/node_modules/delegates/Readme.md +0 -94
  100. package/node_modules/delegates/index.js +0 -121
  101. package/node_modules/delegates/package.json +0 -13
  102. package/node_modules/delegates/test/index.js +0 -94
  103. package/node_modules/gauge/CHANGELOG.md +0 -160
  104. package/node_modules/gauge/LICENSE +0 -13
  105. package/node_modules/gauge/has-color.js +0 -12
  106. package/node_modules/gauge/themes.js +0 -54
  107. package/node_modules/inherits/LICENSE +0 -16
  108. package/node_modules/inherits/README.md +0 -42
  109. package/node_modules/inherits/inherits.js +0 -9
  110. package/node_modules/inherits/inherits_browser.js +0 -27
  111. package/node_modules/inherits/package.json +0 -29
  112. package/node_modules/isarray/.npmignore +0 -1
  113. package/node_modules/isarray/.travis.yml +0 -4
  114. package/node_modules/isarray/Makefile +0 -6
  115. package/node_modules/isarray/README.md +0 -60
  116. package/node_modules/isarray/component.json +0 -19
  117. package/node_modules/isarray/index.js +0 -5
  118. package/node_modules/isarray/package.json +0 -45
  119. package/node_modules/isarray/test.js +0 -20
  120. package/node_modules/number-is-nan/index.js +0 -4
  121. package/node_modules/number-is-nan/license +0 -21
  122. package/node_modules/number-is-nan/package.json +0 -35
  123. package/node_modules/number-is-nan/readme.md +0 -28
  124. package/node_modules/object-assign/index.js +0 -90
  125. package/node_modules/object-assign/license +0 -21
  126. package/node_modules/object-assign/package.json +0 -42
  127. package/node_modules/object-assign/readme.md +0 -61
  128. package/node_modules/process-nextick-args/index.js +0 -45
  129. package/node_modules/process-nextick-args/license.md +0 -19
  130. package/node_modules/process-nextick-args/package.json +0 -25
  131. package/node_modules/process-nextick-args/readme.md +0 -18
  132. package/node_modules/readable-stream/.travis.yml +0 -34
  133. package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
  134. package/node_modules/readable-stream/GOVERNANCE.md +0 -136
  135. package/node_modules/readable-stream/LICENSE +0 -47
  136. package/node_modules/readable-stream/README.md +0 -58
  137. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
  138. package/node_modules/readable-stream/duplex-browser.js +0 -1
  139. package/node_modules/readable-stream/duplex.js +0 -1
  140. package/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
  141. package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
  142. package/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
  143. package/node_modules/readable-stream/lib/_stream_transform.js +0 -214
  144. package/node_modules/readable-stream/lib/_stream_writable.js +0 -685
  145. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -78
  146. package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -84
  147. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
  148. package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
  149. package/node_modules/readable-stream/package.json +0 -52
  150. package/node_modules/readable-stream/passthrough.js +0 -1
  151. package/node_modules/readable-stream/readable-browser.js +0 -7
  152. package/node_modules/readable-stream/readable.js +0 -19
  153. package/node_modules/readable-stream/transform.js +0 -1
  154. package/node_modules/readable-stream/writable-browser.js +0 -1
  155. package/node_modules/readable-stream/writable.js +0 -8
  156. package/node_modules/safe-buffer/LICENSE +0 -21
  157. package/node_modules/safe-buffer/README.md +0 -584
  158. package/node_modules/safe-buffer/index.d.ts +0 -187
  159. package/node_modules/safe-buffer/index.js +0 -62
  160. package/node_modules/safe-buffer/package.json +0 -37
  161. package/node_modules/signal-exit/index.js +0 -202
  162. package/node_modules/signal-exit/signals.js +0 -53
  163. package/node_modules/string_decoder/.travis.yml +0 -50
  164. package/node_modules/string_decoder/LICENSE +0 -48
  165. package/node_modules/string_decoder/README.md +0 -47
  166. package/node_modules/string_decoder/lib/string_decoder.js +0 -296
  167. package/node_modules/string_decoder/package.json +0 -31
  168. package/node_modules/util-deprecate/History.md +0 -16
  169. package/node_modules/util-deprecate/LICENSE +0 -24
  170. package/node_modules/util-deprecate/README.md +0 -53
  171. package/node_modules/util-deprecate/browser.js +0 -67
  172. package/node_modules/util-deprecate/node.js +0 -6
  173. package/node_modules/util-deprecate/package.json +0 -27
  174. package/node_modules/wide-align/node_modules/ansi-regex/index.js +0 -10
  175. package/node_modules/wide-align/node_modules/ansi-regex/license +0 -9
  176. package/node_modules/wide-align/node_modules/ansi-regex/package.json +0 -55
  177. package/node_modules/wide-align/node_modules/ansi-regex/readme.md +0 -78
  178. package/node_modules/wide-align/node_modules/is-fullwidth-code-point/index.js +0 -50
  179. package/node_modules/wide-align/node_modules/is-fullwidth-code-point/license +0 -9
  180. package/node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json +0 -42
  181. package/node_modules/wide-align/node_modules/is-fullwidth-code-point/readme.md +0 -39
  182. package/node_modules/wide-align/node_modules/string-width/index.js +0 -47
  183. package/node_modules/wide-align/node_modules/string-width/license +0 -9
  184. package/node_modules/wide-align/node_modules/string-width/package.json +0 -56
  185. package/node_modules/wide-align/node_modules/string-width/readme.md +0 -50
  186. package/node_modules/wide-align/node_modules/strip-ansi/index.js +0 -4
  187. package/node_modules/wide-align/node_modules/strip-ansi/license +0 -9
  188. package/node_modules/wide-align/node_modules/strip-ansi/package.json +0 -54
  189. package/node_modules/wide-align/node_modules/strip-ansi/readme.md +0 -46
  190. /package/node_modules/{wide-align/node_modules/ansi-regex → ansi-regex}/index.d.ts +0 -0
  191. /package/node_modules/are-we-there-yet/{index.js → lib/index.js} +0 -0
  192. /package/node_modules/{npmlog → color-support}/LICENSE +0 -0
  193. /package/node_modules/gauge/{error.js → lib/error.js} +0 -0
  194. /package/node_modules/gauge/{process.js → lib/process.js} +0 -0
  195. /package/node_modules/gauge/{set-immediate.js → lib/set-immediate.js} +0 -0
  196. /package/node_modules/gauge/{set-interval.js → lib/set-interval.js} +0 -0
  197. /package/node_modules/gauge/{spin.js → lib/spin.js} +0 -0
  198. /package/node_modules/{wide-align/node_modules/is-fullwidth-code-point → is-fullwidth-code-point}/index.d.ts +0 -0
  199. /package/node_modules/{wide-align/node_modules/string-width → string-width}/index.d.ts +0 -0
  200. /package/node_modules/{wide-align/node_modules/strip-ansi → strip-ansi}/index.d.ts +0 -0
@@ -1,5 +1,4 @@
1
1
  'use strict'
2
- var objectAssign = require('object-assign')
3
2
 
4
3
  module.exports = function () {
5
4
  return ThemeSetProto.newThemeSet()
@@ -14,7 +13,7 @@ ThemeSetProto.newTheme = function (parent, theme) {
14
13
  theme = parent
15
14
  parent = this.baseTheme
16
15
  }
17
- return objectAssign({}, parent, theme)
16
+ return Object.assign({}, parent, theme)
18
17
  }
19
18
 
20
19
  ThemeSetProto.getThemeNames = function () {
@@ -28,13 +27,15 @@ ThemeSetProto.addTheme = function (name, parent, theme) {
28
27
  ThemeSetProto.addToAllThemes = function (theme) {
29
28
  var themes = this.themes
30
29
  Object.keys(themes).forEach(function (name) {
31
- objectAssign(themes[name], theme)
30
+ Object.assign(themes[name], theme)
32
31
  })
33
- objectAssign(this.baseTheme, theme)
32
+ Object.assign(this.baseTheme, theme)
34
33
  }
35
34
 
36
35
  ThemeSetProto.getTheme = function (name) {
37
- if (!this.themes[name]) throw this.newMissingThemeError(name)
36
+ if (!this.themes[name]) {
37
+ throw this.newMissingThemeError(name)
38
+ }
38
39
  return this.themes[name]
39
40
  }
40
41
 
@@ -46,17 +47,23 @@ ThemeSetProto.setDefault = function (opts, name) {
46
47
  var platform = opts.platform == null ? 'fallback' : opts.platform
47
48
  var hasUnicode = !!opts.hasUnicode
48
49
  var hasColor = !!opts.hasColor
49
- if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}}
50
+ if (!this.defaults[platform]) {
51
+ this.defaults[platform] = { true: {}, false: {} }
52
+ }
50
53
  this.defaults[platform][hasUnicode][hasColor] = name
51
54
  }
52
55
 
53
56
  ThemeSetProto.getDefault = function (opts) {
54
- if (!opts) opts = {}
57
+ if (!opts) {
58
+ opts = {}
59
+ }
55
60
  var platformName = opts.platform || process.platform
56
61
  var platform = this.defaults[platformName] || this.defaults.fallback
57
62
  var hasUnicode = !!opts.hasUnicode
58
63
  var hasColor = !!opts.hasColor
59
- if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor)
64
+ if (!platform) {
65
+ throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor)
66
+ }
60
67
  if (!platform[hasUnicode][hasColor]) {
61
68
  if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) {
62
69
  hasUnicode = false
@@ -76,7 +83,7 @@ ThemeSetProto.getDefault = function (opts) {
76
83
  if (platform[hasUnicode][hasColor]) {
77
84
  return this.getTheme(platform[hasUnicode][hasColor])
78
85
  } else {
79
- return this.getDefault(objectAssign({}, opts, {platform: 'fallback'}))
86
+ return this.getDefault(Object.assign({}, opts, { platform: 'fallback' }))
80
87
  }
81
88
  }
82
89
 
@@ -88,28 +95,28 @@ ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) {
88
95
  return err
89
96
  }
90
97
 
91
- ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) {
92
- var err = new Error(
93
- 'Could not find a gauge theme for your platform/unicode/color use combo:\n' +
98
+ ThemeSetProto.newMissingDefaultThemeError =
99
+ function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) {
100
+ var err = new Error(
101
+ 'Could not find a gauge theme for your platform/unicode/color use combo:\n' +
94
102
  ' platform = ' + platformName + '\n' +
95
103
  ' hasUnicode = ' + hasUnicode + '\n' +
96
104
  ' hasColor = ' + hasColor)
97
- Error.captureStackTrace.call(err, newMissingDefaultThemeError)
98
- err.platform = platformName
99
- err.hasUnicode = hasUnicode
100
- err.hasColor = hasColor
101
- err.code = 'EMISSINGTHEME'
102
- return err
103
- }
105
+ Error.captureStackTrace.call(err, newMissingDefaultThemeError)
106
+ err.platform = platformName
107
+ err.hasUnicode = hasUnicode
108
+ err.hasColor = hasColor
109
+ err.code = 'EMISSINGTHEME'
110
+ return err
111
+ }
104
112
 
105
113
  ThemeSetProto.newThemeSet = function () {
106
114
  var themeset = function (opts) {
107
115
  return themeset.getDefault(opts)
108
116
  }
109
- return objectAssign(themeset, ThemeSetProto, {
110
- themes: objectAssign({}, this.themes),
111
- baseTheme: objectAssign({}, this.baseTheme),
112
- defaults: JSON.parse(JSON.stringify(this.defaults || {}))
117
+ return Object.assign(themeset, ThemeSetProto, {
118
+ themes: Object.assign({}, this.themes),
119
+ baseTheme: Object.assign({}, this.baseTheme),
120
+ defaults: JSON.parse(JSON.stringify(this.defaults || {})),
113
121
  })
114
122
  }
115
-
@@ -0,0 +1,56 @@
1
+ 'use strict'
2
+ var color = require('console-control-strings').color
3
+ var ThemeSet = require('./theme-set.js')
4
+
5
+ var themes = module.exports = new ThemeSet()
6
+
7
+ themes.addTheme('ASCII', {
8
+ preProgressbar: '[',
9
+ postProgressbar: ']',
10
+ progressbarTheme: {
11
+ complete: '#',
12
+ remaining: '.',
13
+ },
14
+ activityIndicatorTheme: '-\\|/',
15
+ preSubsection: '>',
16
+ })
17
+
18
+ themes.addTheme('colorASCII', themes.getTheme('ASCII'), {
19
+ progressbarTheme: {
20
+ preComplete: color('bgBrightWhite', 'brightWhite'),
21
+ complete: '#',
22
+ postComplete: color('reset'),
23
+ preRemaining: color('bgBrightBlack', 'brightBlack'),
24
+ remaining: '.',
25
+ postRemaining: color('reset'),
26
+ },
27
+ })
28
+
29
+ themes.addTheme('brailleSpinner', {
30
+ preProgressbar: '(',
31
+ postProgressbar: ')',
32
+ progressbarTheme: {
33
+ complete: '#',
34
+ remaining: '⠂',
35
+ },
36
+ activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏',
37
+ preSubsection: '>',
38
+ })
39
+
40
+ themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), {
41
+ progressbarTheme: {
42
+ preComplete: color('bgBrightWhite', 'brightWhite'),
43
+ complete: '#',
44
+ postComplete: color('reset'),
45
+ preRemaining: color('bgBrightBlack', 'brightBlack'),
46
+ remaining: '⠂',
47
+ postRemaining: color('reset'),
48
+ },
49
+ })
50
+
51
+ themes.setDefault({}, 'ASCII')
52
+ themes.setDefault({ hasColor: true }, 'colorASCII')
53
+ themes.setDefault({ platform: 'darwin', hasUnicode: true }, 'brailleSpinner')
54
+ themes.setDefault({ platform: 'darwin', hasUnicode: true, hasColor: true }, 'colorBrailleSpinner')
55
+ themes.setDefault({ platform: 'linux', hasUnicode: true }, 'brailleSpinner')
56
+ themes.setDefault({ platform: 'linux', hasUnicode: true, hasColor: true }, 'colorBrailleSpinner')
@@ -5,9 +5,15 @@ var stripAnsi = require('strip-ansi')
5
5
  module.exports = wideTruncate
6
6
 
7
7
  function wideTruncate (str, target) {
8
- if (stringWidth(str) === 0) return str
9
- if (target <= 0) return ''
10
- if (stringWidth(str) <= target) return str
8
+ if (stringWidth(str) === 0) {
9
+ return str
10
+ }
11
+ if (target <= 0) {
12
+ return ''
13
+ }
14
+ if (stringWidth(str) <= target) {
15
+ return str
16
+ }
11
17
 
12
18
  // We compute the number of bytes of ansi sequences here and add
13
19
  // that to our initial truncation to ensure that we don't slice one
@@ -1,63 +1,68 @@
1
1
  {
2
2
  "name": "gauge",
3
- "version": "2.7.4",
4
- "description": "A terminal based horizontal guage",
5
- "main": "index.js",
3
+ "version": "5.0.1",
4
+ "description": "A terminal based horizontal gauge",
5
+ "main": "lib",
6
6
  "scripts": {
7
- "test": "standard && tap test/*.js --coverage",
8
- "prepublish": "rm -f *~"
7
+ "test": "tap",
8
+ "lint": "eslint \"**/*.js\"",
9
+ "postlint": "template-oss-check",
10
+ "lintfix": "npm run lint -- --fix",
11
+ "snap": "tap",
12
+ "posttest": "npm run lint",
13
+ "template-oss-apply": "template-oss-apply --force"
9
14
  },
10
15
  "repository": {
11
16
  "type": "git",
12
- "url": "https://github.com/iarna/gauge"
17
+ "url": "https://github.com/npm/gauge.git"
13
18
  },
14
19
  "keywords": [
15
20
  "progressbar",
16
21
  "progress",
17
22
  "gauge"
18
23
  ],
19
- "author": "Rebecca Turner <me@re-becca.org>",
24
+ "author": "GitHub Inc.",
20
25
  "license": "ISC",
21
26
  "bugs": {
22
- "url": "https://github.com/iarna/gauge/issues"
27
+ "url": "https://github.com/npm/gauge/issues"
23
28
  },
24
- "homepage": "https://github.com/iarna/gauge",
29
+ "homepage": "https://github.com/npm/gauge",
25
30
  "dependencies": {
26
- "aproba": "^1.0.3",
27
- "console-control-strings": "^1.0.0",
28
- "has-unicode": "^2.0.0",
29
- "object-assign": "^4.1.0",
30
- "signal-exit": "^3.0.0",
31
- "string-width": "^1.0.1",
32
- "strip-ansi": "^3.0.1",
33
- "wide-align": "^1.1.0"
31
+ "aproba": "^1.0.3 || ^2.0.0",
32
+ "color-support": "^1.1.3",
33
+ "console-control-strings": "^1.1.0",
34
+ "has-unicode": "^2.0.1",
35
+ "signal-exit": "^4.0.1",
36
+ "string-width": "^4.2.3",
37
+ "strip-ansi": "^6.0.1",
38
+ "wide-align": "^1.1.5"
34
39
  },
35
40
  "devDependencies": {
36
- "readable-stream": "^2.0.6",
37
- "require-inject": "^1.4.0",
38
- "standard": "^7.1.2",
39
- "tap": "^5.7.2",
40
- "through2": "^2.0.0"
41
+ "@npmcli/eslint-config": "^4.0.0",
42
+ "@npmcli/template-oss": "4.14.1",
43
+ "readable-stream": "^4.0.0",
44
+ "tap": "^16.0.1"
41
45
  },
42
46
  "files": [
43
- "base-theme.js",
44
- "CHANGELOG.md",
45
- "error.js",
46
- "has-color.js",
47
- "index.js",
48
- "LICENSE",
49
- "package.json",
50
- "plumbing.js",
51
- "process.js",
52
- "progress-bar.js",
53
- "README.md",
54
- "render-template.js",
55
- "set-immediate.js",
56
- "set-interval.js",
57
- "spin.js",
58
- "template-item.js",
59
- "theme-set.js",
60
- "themes.js",
61
- "wide-truncate.js"
62
- ]
47
+ "bin/",
48
+ "lib/"
49
+ ],
50
+ "engines": {
51
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
52
+ },
53
+ "tap": {
54
+ "branches": 79,
55
+ "statements": 89,
56
+ "functions": 92,
57
+ "lines": 90,
58
+ "nyc-arg": [
59
+ "--exclude",
60
+ "tap-snapshots/**"
61
+ ]
62
+ },
63
+ "templateOSS": {
64
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
65
+ "version": "4.14.1",
66
+ "publish": "true"
67
+ }
63
68
  }
@@ -1,46 +1,50 @@
1
+ /* eslint-disable yoda */
1
2
  'use strict';
2
- var numberIsNan = require('number-is-nan');
3
3
 
4
- module.exports = function (x) {
5
- if (numberIsNan(x)) {
4
+ const isFullwidthCodePoint = codePoint => {
5
+ if (Number.isNaN(codePoint)) {
6
6
  return false;
7
7
  }
8
8
 
9
- // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
10
-
11
- // code points are derived from:
9
+ // Code points are derived from:
12
10
  // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
13
- if (x >= 0x1100 && (
14
- x <= 0x115f || // Hangul Jamo
15
- 0x2329 === x || // LEFT-POINTING ANGLE BRACKET
16
- 0x232a === x || // RIGHT-POINTING ANGLE BRACKET
17
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
18
- (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
19
- // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
20
- 0x3250 <= x && x <= 0x4dbf ||
21
- // CJK Unified Ideographs .. Yi Radicals
22
- 0x4e00 <= x && x <= 0xa4c6 ||
23
- // Hangul Jamo Extended-A
24
- 0xa960 <= x && x <= 0xa97c ||
25
- // Hangul Syllables
26
- 0xac00 <= x && x <= 0xd7a3 ||
27
- // CJK Compatibility Ideographs
28
- 0xf900 <= x && x <= 0xfaff ||
29
- // Vertical Forms
30
- 0xfe10 <= x && x <= 0xfe19 ||
31
- // CJK Compatibility Forms .. Small Form Variants
32
- 0xfe30 <= x && x <= 0xfe6b ||
33
- // Halfwidth and Fullwidth Forms
34
- 0xff01 <= x && x <= 0xff60 ||
35
- 0xffe0 <= x && x <= 0xffe6 ||
36
- // Kana Supplement
37
- 0x1b000 <= x && x <= 0x1b001 ||
38
- // Enclosed Ideographic Supplement
39
- 0x1f200 <= x && x <= 0x1f251 ||
40
- // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
41
- 0x20000 <= x && x <= 0x3fffd)) {
11
+ if (
12
+ codePoint >= 0x1100 && (
13
+ codePoint <= 0x115F || // Hangul Jamo
14
+ codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
15
+ codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
16
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
17
+ (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||
18
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
19
+ (0x3250 <= codePoint && codePoint <= 0x4DBF) ||
20
+ // CJK Unified Ideographs .. Yi Radicals
21
+ (0x4E00 <= codePoint && codePoint <= 0xA4C6) ||
22
+ // Hangul Jamo Extended-A
23
+ (0xA960 <= codePoint && codePoint <= 0xA97C) ||
24
+ // Hangul Syllables
25
+ (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
26
+ // CJK Compatibility Ideographs
27
+ (0xF900 <= codePoint && codePoint <= 0xFAFF) ||
28
+ // Vertical Forms
29
+ (0xFE10 <= codePoint && codePoint <= 0xFE19) ||
30
+ // CJK Compatibility Forms .. Small Form Variants
31
+ (0xFE30 <= codePoint && codePoint <= 0xFE6B) ||
32
+ // Halfwidth and Fullwidth Forms
33
+ (0xFF01 <= codePoint && codePoint <= 0xFF60) ||
34
+ (0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||
35
+ // Kana Supplement
36
+ (0x1B000 <= codePoint && codePoint <= 0x1B001) ||
37
+ // Enclosed Ideographic Supplement
38
+ (0x1F200 <= codePoint && codePoint <= 0x1F251) ||
39
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
40
+ (0x20000 <= codePoint && codePoint <= 0x3FFFD)
41
+ )
42
+ ) {
42
43
  return true;
43
44
  }
44
45
 
45
46
  return false;
46
- }
47
+ };
48
+
49
+ module.exports = isFullwidthCodePoint;
50
+ module.exports.default = isFullwidthCodePoint;
@@ -1,21 +1,9 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
3
  Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
6
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
8
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,45 +1,42 @@
1
1
  {
2
- "name": "is-fullwidth-code-point",
3
- "version": "1.0.0",
4
- "description": "Check if the character represented by a given Unicode code point is fullwidth",
5
- "license": "MIT",
6
- "repository": "sindresorhus/is-fullwidth-code-point",
7
- "author": {
8
- "name": "Sindre Sorhus",
9
- "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
- },
12
- "engines": {
13
- "node": ">=0.10.0"
14
- },
15
- "scripts": {
16
- "test": "node test.js"
17
- },
18
- "files": [
19
- "index.js"
20
- ],
21
- "keywords": [
22
- "fullwidth",
23
- "full-width",
24
- "full",
25
- "width",
26
- "unicode",
27
- "character",
28
- "char",
29
- "string",
30
- "str",
31
- "codepoint",
32
- "code",
33
- "point",
34
- "is",
35
- "detect",
36
- "check"
37
- ],
38
- "dependencies": {
39
- "number-is-nan": "^1.0.0"
40
- },
41
- "devDependencies": {
42
- "ava": "0.0.4",
43
- "code-point-at": "^1.0.0"
44
- }
2
+ "name": "is-fullwidth-code-point",
3
+ "version": "3.0.0",
4
+ "description": "Check if the character represented by a given Unicode code point is fullwidth",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/is-fullwidth-code-point",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=8"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && ava && tsd-check"
17
+ },
18
+ "files": [
19
+ "index.js",
20
+ "index.d.ts"
21
+ ],
22
+ "keywords": [
23
+ "fullwidth",
24
+ "full-width",
25
+ "full",
26
+ "width",
27
+ "unicode",
28
+ "character",
29
+ "string",
30
+ "codepoint",
31
+ "code",
32
+ "point",
33
+ "is",
34
+ "detect",
35
+ "check"
36
+ ],
37
+ "devDependencies": {
38
+ "ava": "^1.3.1",
39
+ "tsd-check": "^0.5.0",
40
+ "xo": "^0.24.0"
41
+ }
45
42
  }
@@ -6,34 +6,34 @@
6
6
  ## Install
7
7
 
8
8
  ```
9
- $ npm install --save is-fullwidth-code-point
9
+ $ npm install is-fullwidth-code-point
10
10
  ```
11
11
 
12
12
 
13
13
  ## Usage
14
14
 
15
15
  ```js
16
- var isFullwidthCodePoint = require('is-fullwidth-code-point');
16
+ const isFullwidthCodePoint = require('is-fullwidth-code-point');
17
17
 
18
- isFullwidthCodePoint('谢'.codePointAt());
18
+ isFullwidthCodePoint('谢'.codePointAt(0));
19
19
  //=> true
20
20
 
21
- isFullwidthCodePoint('a'.codePointAt());
21
+ isFullwidthCodePoint('a'.codePointAt(0));
22
22
  //=> false
23
23
  ```
24
24
 
25
25
 
26
26
  ## API
27
27
 
28
- ### isFullwidthCodePoint(input)
28
+ ### isFullwidthCodePoint(codePoint)
29
29
 
30
- #### input
30
+ #### codePoint
31
31
 
32
32
  Type: `number`
33
33
 
34
- [Code point](https://en.wikipedia.org/wiki/Code_point) of a character.
34
+ The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
35
35
 
36
36
 
37
37
  ## License
38
38
 
39
- MIT © [Sindre Sorhus](http://sindresorhus.com)
39
+ MIT © [Sindre Sorhus](https://sindresorhus.com)
@@ -0,0 +1,20 @@
1
+ <!-- This file is automatically added by @npmcli/template-oss. Do not edit. -->
2
+
3
+ ISC License
4
+
5
+ Copyright npm, Inc.
6
+
7
+ Permission to use, copy, modify, and/or distribute this
8
+ software for any purpose with or without fee is hereby
9
+ granted, provided that the above copyright notice and this
10
+ permission notice appear in all copies.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL
13
+ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
15
+ EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
20
+ USE OR PERFORMANCE OF THIS SOFTWARE.