@aws-solutions-constructs/core 2.51.0 → 2.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.jsii +49 -4
- package/node_modules/ansi-regex/index.js +8 -2
- package/node_modules/ansi-regex/license +4 -16
- package/node_modules/ansi-regex/package.json +53 -62
- package/node_modules/ansi-regex/readme.md +48 -9
- package/node_modules/aproba/index.js +33 -33
- package/node_modules/aproba/package.json +5 -4
- package/node_modules/are-we-there-yet/LICENSE.md +18 -0
- package/node_modules/are-we-there-yet/README.md +16 -3
- package/node_modules/are-we-there-yet/lib/tracker-base.js +13 -0
- package/node_modules/are-we-there-yet/lib/tracker-group.js +112 -0
- package/node_modules/are-we-there-yet/lib/tracker-stream.js +42 -0
- package/node_modules/are-we-there-yet/lib/tracker.js +34 -0
- package/node_modules/are-we-there-yet/package.json +38 -20
- package/node_modules/color-support/README.md +129 -0
- package/node_modules/color-support/bin.js +3 -0
- package/node_modules/color-support/browser.js +14 -0
- package/node_modules/color-support/index.js +134 -0
- package/node_modules/color-support/package.json +36 -0
- package/node_modules/gauge/LICENSE.md +20 -0
- package/node_modules/gauge/README.md +19 -16
- package/node_modules/gauge/{base-theme.js → lib/base-theme.js} +7 -3
- package/node_modules/gauge/lib/has-color.js +4 -0
- package/node_modules/gauge/{index.js → lib/index.js} +90 -34
- package/node_modules/gauge/{plumbing.js → lib/plumbing.js} +3 -1
- package/node_modules/gauge/{progress-bar.js → lib/progress-bar.js} +12 -6
- package/node_modules/gauge/{render-template.js → lib/render-template.js} +69 -28
- package/node_modules/gauge/{template-item.js → lib/template-item.js} +21 -7
- package/node_modules/gauge/{theme-set.js → lib/theme-set.js} +31 -24
- package/node_modules/gauge/lib/themes.js +56 -0
- package/node_modules/gauge/{wide-truncate.js → lib/wide-truncate.js} +9 -3
- package/node_modules/gauge/package.json +47 -42
- package/node_modules/is-fullwidth-code-point/index.js +40 -36
- package/node_modules/is-fullwidth-code-point/license +4 -16
- package/node_modules/is-fullwidth-code-point/package.json +40 -43
- package/node_modules/is-fullwidth-code-point/readme.md +8 -8
- package/node_modules/npmlog/LICENSE.md +20 -0
- package/node_modules/npmlog/{log.js → lib/log.js} +149 -58
- package/node_modules/npmlog/package.json +36 -12
- package/node_modules/signal-exit/LICENSE.txt +1 -1
- package/node_modules/signal-exit/README.md +56 -21
- package/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/browser.js +10 -0
- package/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.js +279 -0
- package/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/package.json +3 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/signals.js +42 -0
- package/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.js +4 -0
- package/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.js +275 -0
- package/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/package.json +3 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/signals.js +39 -0
- package/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
- package/node_modules/signal-exit/package.json +87 -19
- package/node_modules/string-width/index.js +29 -19
- package/node_modules/string-width/license +4 -16
- package/node_modules/string-width/package.json +54 -54
- package/node_modules/string-width/readme.md +17 -9
- package/node_modules/strip-ansi/index.js +2 -4
- package/node_modules/strip-ansi/license +4 -16
- package/node_modules/strip-ansi/package.json +52 -55
- package/node_modules/strip-ansi/readme.md +20 -7
- package/package.json +8 -7
- package/test/test-helper.d.ts +1 -1
- package/test/test-helper.js +5 -5
- package/node_modules/are-we-there-yet/CHANGES.md +0 -37
- package/node_modules/are-we-there-yet/LICENSE +0 -5
- package/node_modules/are-we-there-yet/tracker-base.js +0 -11
- package/node_modules/are-we-there-yet/tracker-group.js +0 -107
- package/node_modules/are-we-there-yet/tracker-stream.js +0 -36
- package/node_modules/are-we-there-yet/tracker.js +0 -30
- package/node_modules/code-point-at/index.js +0 -32
- package/node_modules/code-point-at/license +0 -21
- package/node_modules/code-point-at/package.json +0 -38
- package/node_modules/code-point-at/readme.md +0 -32
- package/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/core-util-is/README.md +0 -3
- package/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/core-util-is/package.json +0 -38
- package/node_modules/delegates/.npmignore +0 -1
- package/node_modules/delegates/History.md +0 -22
- package/node_modules/delegates/License +0 -20
- package/node_modules/delegates/Makefile +0 -8
- package/node_modules/delegates/Readme.md +0 -94
- package/node_modules/delegates/index.js +0 -121
- package/node_modules/delegates/package.json +0 -13
- package/node_modules/delegates/test/index.js +0 -94
- package/node_modules/gauge/CHANGELOG.md +0 -160
- package/node_modules/gauge/LICENSE +0 -13
- package/node_modules/gauge/has-color.js +0 -12
- package/node_modules/gauge/themes.js +0 -54
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -29
- package/node_modules/isarray/.npmignore +0 -1
- package/node_modules/isarray/.travis.yml +0 -4
- package/node_modules/isarray/Makefile +0 -6
- package/node_modules/isarray/README.md +0 -60
- package/node_modules/isarray/component.json +0 -19
- package/node_modules/isarray/index.js +0 -5
- package/node_modules/isarray/package.json +0 -45
- package/node_modules/isarray/test.js +0 -20
- package/node_modules/number-is-nan/index.js +0 -4
- package/node_modules/number-is-nan/license +0 -21
- package/node_modules/number-is-nan/package.json +0 -35
- package/node_modules/number-is-nan/readme.md +0 -28
- package/node_modules/object-assign/index.js +0 -90
- package/node_modules/object-assign/license +0 -21
- package/node_modules/object-assign/package.json +0 -42
- package/node_modules/object-assign/readme.md +0 -61
- package/node_modules/process-nextick-args/index.js +0 -45
- package/node_modules/process-nextick-args/license.md +0 -19
- package/node_modules/process-nextick-args/package.json +0 -25
- package/node_modules/process-nextick-args/readme.md +0 -18
- package/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -58
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -685
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -78
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -84
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/readable-stream/package.json +0 -52
- package/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/safe-buffer/package.json +0 -37
- package/node_modules/signal-exit/index.js +0 -202
- package/node_modules/signal-exit/signals.js +0 -53
- package/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -31
- package/node_modules/util-deprecate/History.md +0 -16
- package/node_modules/util-deprecate/LICENSE +0 -24
- package/node_modules/util-deprecate/README.md +0 -53
- package/node_modules/util-deprecate/browser.js +0 -67
- package/node_modules/util-deprecate/node.js +0 -6
- package/node_modules/util-deprecate/package.json +0 -27
- package/node_modules/wide-align/node_modules/ansi-regex/index.js +0 -10
- package/node_modules/wide-align/node_modules/ansi-regex/license +0 -9
- package/node_modules/wide-align/node_modules/ansi-regex/package.json +0 -55
- package/node_modules/wide-align/node_modules/ansi-regex/readme.md +0 -78
- package/node_modules/wide-align/node_modules/is-fullwidth-code-point/index.js +0 -50
- package/node_modules/wide-align/node_modules/is-fullwidth-code-point/license +0 -9
- package/node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json +0 -42
- package/node_modules/wide-align/node_modules/is-fullwidth-code-point/readme.md +0 -39
- package/node_modules/wide-align/node_modules/string-width/index.js +0 -47
- package/node_modules/wide-align/node_modules/string-width/license +0 -9
- package/node_modules/wide-align/node_modules/string-width/package.json +0 -56
- package/node_modules/wide-align/node_modules/string-width/readme.md +0 -50
- package/node_modules/wide-align/node_modules/strip-ansi/index.js +0 -4
- package/node_modules/wide-align/node_modules/strip-ansi/license +0 -9
- package/node_modules/wide-align/node_modules/strip-ansi/package.json +0 -54
- package/node_modules/wide-align/node_modules/strip-ansi/readme.md +0 -46
- /package/node_modules/{wide-align/node_modules/ansi-regex → ansi-regex}/index.d.ts +0 -0
- /package/node_modules/are-we-there-yet/{index.js → lib/index.js} +0 -0
- /package/node_modules/{npmlog → color-support}/LICENSE +0 -0
- /package/node_modules/gauge/{error.js → lib/error.js} +0 -0
- /package/node_modules/gauge/{process.js → lib/process.js} +0 -0
- /package/node_modules/gauge/{set-immediate.js → lib/set-immediate.js} +0 -0
- /package/node_modules/gauge/{set-interval.js → lib/set-interval.js} +0 -0
- /package/node_modules/gauge/{spin.js → lib/spin.js} +0 -0
- /package/node_modules/{wide-align/node_modules/is-fullwidth-code-point → is-fullwidth-code-point}/index.d.ts +0 -0
- /package/node_modules/{wide-align/node_modules/string-width → string-width}/index.d.ts +0 -0
- /package/node_modules/{wide-align/node_modules/strip-ansi → strip-ansi}/index.d.ts +0 -0
|
@@ -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)
|
|
9
|
-
|
|
10
|
-
|
|
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": "
|
|
4
|
-
"description": "A terminal based horizontal
|
|
5
|
-
"main": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"description": "A terminal based horizontal gauge",
|
|
5
|
+
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "
|
|
8
|
-
"
|
|
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/
|
|
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": "
|
|
24
|
+
"author": "GitHub Inc.",
|
|
20
25
|
"license": "ISC",
|
|
21
26
|
"bugs": {
|
|
22
|
-
"url": "https://github.com/
|
|
27
|
+
"url": "https://github.com/npm/gauge/issues"
|
|
23
28
|
},
|
|
24
|
-
"homepage": "https://github.com/
|
|
29
|
+
"homepage": "https://github.com/npm/gauge",
|
|
25
30
|
"dependencies": {
|
|
26
|
-
"aproba": "^1.0.3",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"signal-exit": "^
|
|
31
|
-
"string-width": "^
|
|
32
|
-
"strip-ansi": "^
|
|
33
|
-
"wide-align": "^1.1.
|
|
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
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"tap": "^
|
|
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
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
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
|
-
|
|
5
|
-
if (
|
|
4
|
+
const isFullwidthCodePoint = codePoint => {
|
|
5
|
+
if (Number.isNaN(codePoint)) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
//
|
|
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 (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
9
|
+
$ npm install is-fullwidth-code-point
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
|
-
|
|
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(
|
|
28
|
+
### isFullwidthCodePoint(codePoint)
|
|
29
29
|
|
|
30
|
-
####
|
|
30
|
+
#### codePoint
|
|
31
31
|
|
|
32
32
|
Type: `number`
|
|
33
33
|
|
|
34
|
-
[
|
|
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](
|
|
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.
|