muhammara 2.1.0 → 2.2.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.
- package/CHANGELOG.md +13 -1
- package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +3 -0
- package/node_modules/@mapbox/node-pre-gyp/package.json +6 -7
- package/node_modules/ansi-regex/package.json +1 -2
- package/node_modules/brace-expansion/package.json +2 -1
- package/node_modules/gauge/CHANGELOG.md +163 -0
- package/node_modules/gauge/LICENSE +13 -0
- package/node_modules/gauge/README.md +1 -1
- package/node_modules/gauge/{lib/base-theme.js → base-theme.js} +3 -7
- package/node_modules/gauge/{lib/error.js → error.js} +0 -0
- package/node_modules/gauge/{lib/has-color.js → has-color.js} +0 -0
- package/node_modules/gauge/{lib/index.js → index.js} +32 -89
- package/node_modules/gauge/package.json +42 -37
- package/node_modules/gauge/{lib/plumbing.js → plumbing.js} +1 -3
- package/node_modules/gauge/{lib/process.js → process.js} +0 -0
- package/node_modules/gauge/{lib/progress-bar.js → progress-bar.js} +5 -11
- package/node_modules/gauge/{lib/render-template.js → render-template.js} +24 -68
- package/node_modules/gauge/{lib/set-immediate.js → set-immediate.js} +0 -0
- package/node_modules/gauge/{lib/set-interval.js → set-interval.js} +0 -0
- package/node_modules/gauge/{lib/spin.js → spin.js} +0 -0
- package/node_modules/gauge/{lib/template-item.js → template-item.js} +6 -21
- package/node_modules/gauge/{lib/theme-set.js → theme-set.js} +23 -31
- package/node_modules/gauge/{lib/themes.js → themes.js} +13 -13
- package/node_modules/gauge/{lib/wide-truncate.js → wide-truncate.js} +3 -9
- package/node_modules/minimatch/README.md +22 -1
- package/node_modules/minimatch/minimatch.js +93 -69
- package/node_modules/minimatch/package.json +11 -10
- package/node_modules/minipass/index.js +6 -1
- package/node_modules/minipass/package.json +5 -5
- package/node_modules/node-fetch/lib/index.es.js +28 -2
- package/node_modules/node-fetch/lib/index.js +28 -2
- package/node_modules/node-fetch/lib/index.mjs +28 -2
- package/node_modules/node-fetch/package.json +13 -5
- package/node_modules/npmlog/LICENSE +15 -0
- package/node_modules/npmlog/{lib/log.js → log.js} +9 -9
- package/node_modules/npmlog/package.json +20 -31
- package/node_modules/object-assign/index.js +90 -0
- package/node_modules/object-assign/license +21 -0
- package/node_modules/object-assign/package.json +74 -0
- package/node_modules/object-assign/readme.md +61 -0
- package/node_modules/signal-exit/index.js +4 -2
- package/node_modules/signal-exit/package.json +5 -5
- package/package.json +1 -1
- package/src/deps/PDFWriter/CMakeLists.txt +8 -0
- package/src/deps/PDFWriter/DecryptionHelper.cpp +10 -8
- package/src/deps/PDFWriter/Deletable.h +46 -0
- package/src/deps/PDFWriter/DocumentContext.h +3 -3
- package/src/deps/PDFWriter/IDeletable.h +6 -0
- package/src/deps/PDFWriter/InputLZWDecodeStream.cpp +208 -0
- package/src/deps/PDFWriter/InputLZWDecodeStream.h +77 -0
- package/src/deps/PDFWriter/InputStreamSkipperStream.cpp +1 -1
- package/src/deps/PDFWriter/JPEGImageHandler.h +2 -2
- package/src/deps/PDFWriter/ObjectsContext.cpp +5 -0
- package/src/deps/PDFWriter/ObjectsContext.h +1 -0
- package/src/deps/PDFWriter/PDFDocumentHandler.cpp +19 -3
- package/src/deps/PDFWriter/PDFObject.cpp +13 -11
- package/src/deps/PDFWriter/PDFObject.h +7 -5
- package/src/deps/PDFWriter/PDFObjectParser.cpp +8 -0
- package/src/deps/PDFWriter/PDFObjectParser.h +6 -0
- package/src/deps/PDFWriter/PDFParser.cpp +25 -13
- package/src/deps/PDFWriter/PDFParserTokenizer.cpp +25 -24
- package/src/deps/PDFWriter/PDFParserTokenizer.h +1 -0
- package/src/deps/PDFWriter/PDFWriter.h +2 -2
- package/src/deps/PDFWriter/binding.gyp +2 -0
- package/node_modules/gauge/LICENSE.md +0 -20
- package/node_modules/gauge/lib/demo.js +0 -45
- package/node_modules/npmlog/LICENSE.md +0 -20
- package/src/deps/PDFWriter/InputPredictorPNGAverageStream.cpp +0 -120
- package/src/deps/PDFWriter/InputPredictorPNGAverageStream.h +0 -49
- package/src/deps/PDFWriter/InputPredictorPNGNoneStream.cpp +0 -109
- package/src/deps/PDFWriter/InputPredictorPNGNoneStream.h +0 -47
- package/src/deps/PDFWriter/InputPredictorPNGPaethStream.cpp +0 -136
- package/src/deps/PDFWriter/InputPredictorPNGPaethStream.h +0 -51
- package/src/deps/PDFWriter/InputPredictorPNGSubStream.cpp +0 -113
- package/src/deps/PDFWriter/InputPredictorPNGSubStream.h +0 -47
- package/src/deps/PDFWriter/InputPredictorPNGUpStream.cpp +0 -120
- package/src/deps/PDFWriter/InputPredictorPNGUpStream.h +0 -49
|
@@ -1,58 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "gauge@^
|
|
3
|
-
"_id": "gauge@
|
|
2
|
+
"_from": "gauge@^3.0.0",
|
|
3
|
+
"_id": "gauge@3.0.2",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512
|
|
5
|
+
"_integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==",
|
|
6
6
|
"_location": "/gauge",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "range",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "gauge@^
|
|
11
|
+
"raw": "gauge@^3.0.0",
|
|
12
12
|
"name": "gauge",
|
|
13
13
|
"escapedName": "gauge",
|
|
14
|
-
"rawSpec": "^
|
|
14
|
+
"rawSpec": "^3.0.0",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^
|
|
16
|
+
"fetchSpec": "^3.0.0"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/npmlog"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/gauge/-/gauge-
|
|
22
|
-
"_shasum": "
|
|
23
|
-
"_spec": "gauge@^
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
|
|
22
|
+
"_shasum": "03bf4441c044383908bcfa0656ad91803259b395",
|
|
23
|
+
"_spec": "gauge@^3.0.0",
|
|
24
24
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/npmlog",
|
|
25
25
|
"author": {
|
|
26
|
-
"name": "
|
|
26
|
+
"name": "Rebecca Turner",
|
|
27
|
+
"email": "me@re-becca.org"
|
|
27
28
|
},
|
|
28
29
|
"bugs": {
|
|
29
30
|
"url": "https://github.com/npm/gauge/issues"
|
|
30
31
|
},
|
|
31
32
|
"bundleDependencies": false,
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"ansi-regex": "^5.0.1",
|
|
34
34
|
"aproba": "^1.0.3 || ^2.0.0",
|
|
35
35
|
"color-support": "^1.1.2",
|
|
36
36
|
"console-control-strings": "^1.0.0",
|
|
37
37
|
"has-unicode": "^2.0.1",
|
|
38
|
+
"object-assign": "^4.1.1",
|
|
38
39
|
"signal-exit": "^3.0.0",
|
|
39
40
|
"string-width": "^4.2.3",
|
|
40
41
|
"strip-ansi": "^6.0.1",
|
|
41
42
|
"wide-align": "^1.1.2"
|
|
42
43
|
},
|
|
43
44
|
"deprecated": false,
|
|
44
|
-
"description": "A terminal based horizontal
|
|
45
|
+
"description": "A terminal based horizontal guage",
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
47
|
+
"readable-stream": "^2.0.6",
|
|
48
|
+
"require-inject": "^1.4.0",
|
|
49
|
+
"standard": "^11.0.1",
|
|
50
|
+
"tap": "^12.0.1",
|
|
51
|
+
"through2": "^2.0.0"
|
|
49
52
|
},
|
|
50
53
|
"engines": {
|
|
51
|
-
"node": "
|
|
54
|
+
"node": ">=10"
|
|
52
55
|
},
|
|
53
56
|
"files": [
|
|
54
|
-
"
|
|
55
|
-
"
|
|
57
|
+
"base-theme.js",
|
|
58
|
+
"CHANGELOG.md",
|
|
59
|
+
"error.js",
|
|
60
|
+
"has-color.js",
|
|
61
|
+
"index.js",
|
|
62
|
+
"LICENSE",
|
|
63
|
+
"package.json",
|
|
64
|
+
"plumbing.js",
|
|
65
|
+
"process.js",
|
|
66
|
+
"progress-bar.js",
|
|
67
|
+
"README.md",
|
|
68
|
+
"render-template.js",
|
|
69
|
+
"set-immediate.js",
|
|
70
|
+
"set-interval.js",
|
|
71
|
+
"spin.js",
|
|
72
|
+
"template-item.js",
|
|
73
|
+
"theme-set.js",
|
|
74
|
+
"themes.js",
|
|
75
|
+
"wide-truncate.js"
|
|
56
76
|
],
|
|
57
77
|
"homepage": "https://github.com/npm/gauge",
|
|
58
78
|
"keywords": [
|
|
@@ -61,29 +81,14 @@
|
|
|
61
81
|
"gauge"
|
|
62
82
|
],
|
|
63
83
|
"license": "ISC",
|
|
64
|
-
"main": "
|
|
84
|
+
"main": "index.js",
|
|
65
85
|
"name": "gauge",
|
|
66
86
|
"repository": {
|
|
67
87
|
"type": "git",
|
|
68
|
-
"url": "git+https://github.com/
|
|
88
|
+
"url": "git+https://github.com/iarna/gauge.git"
|
|
69
89
|
},
|
|
70
90
|
"scripts": {
|
|
71
|
-
"
|
|
72
|
-
"lintfix": "npm run lint -- --fix",
|
|
73
|
-
"postlint": "npm-template-check",
|
|
74
|
-
"posttest": "npm run lint",
|
|
75
|
-
"postversion": "npm publish",
|
|
76
|
-
"prepublishOnly": "git push origin --follow-tags",
|
|
77
|
-
"preversion": "npm test",
|
|
78
|
-
"snap": "tap",
|
|
79
|
-
"test": "tap"
|
|
91
|
+
"test": "standard && tap test/*.js --coverage"
|
|
80
92
|
},
|
|
81
|
-
"
|
|
82
|
-
"branches": 79,
|
|
83
|
-
"statements": 89,
|
|
84
|
-
"functions": 92,
|
|
85
|
-
"lines": 90
|
|
86
|
-
},
|
|
87
|
-
"templateVersion": "2.3.0",
|
|
88
|
-
"version": "4.0.0"
|
|
93
|
+
"version": "3.0.2"
|
|
89
94
|
}
|
|
@@ -4,9 +4,7 @@ var renderTemplate = require('./render-template.js')
|
|
|
4
4
|
var validate = require('aproba')
|
|
5
5
|
|
|
6
6
|
var Plumbing = module.exports = function (theme, template, width) {
|
|
7
|
-
if (!width)
|
|
8
|
-
width = 80
|
|
9
|
-
}
|
|
7
|
+
if (!width) width = 80
|
|
10
8
|
validate('OAN', [theme, template, width])
|
|
11
9
|
this.showing = false
|
|
12
10
|
this.theme = theme
|
|
File without changes
|
|
@@ -6,20 +6,14 @@ var stringWidth = require('string-width')
|
|
|
6
6
|
|
|
7
7
|
module.exports = function (theme, width, completed) {
|
|
8
8
|
validate('ONN', [theme, width, completed])
|
|
9
|
-
if (completed < 0)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (completed > 1) {
|
|
13
|
-
completed = 1
|
|
14
|
-
}
|
|
15
|
-
if (width <= 0) {
|
|
16
|
-
return ''
|
|
17
|
-
}
|
|
9
|
+
if (completed < 0) completed = 0
|
|
10
|
+
if (completed > 1) completed = 1
|
|
11
|
+
if (width <= 0) return ''
|
|
18
12
|
var sofar = Math.round(width * completed)
|
|
19
13
|
var rest = width - sofar
|
|
20
14
|
var template = [
|
|
21
|
-
{
|
|
22
|
-
{
|
|
15
|
+
{type: 'complete', value: repeat(theme.complete, sofar), length: sofar},
|
|
16
|
+
{type: 'remaining', value: repeat(theme.remaining, rest), length: rest}
|
|
23
17
|
]
|
|
24
18
|
return renderTemplate(width, template, theme)
|
|
25
19
|
}
|
|
@@ -28,9 +28,7 @@ function postType (item) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function hasPreOrPost (item, values) {
|
|
31
|
-
if (!item.type)
|
|
32
|
-
return
|
|
33
|
-
}
|
|
31
|
+
if (!item.type) return
|
|
34
32
|
return values[preType(item)] || values[postType(item)]
|
|
35
33
|
}
|
|
36
34
|
|
|
@@ -41,7 +39,7 @@ function generatePreAndPost (baseItem, parentValues) {
|
|
|
41
39
|
var pre = preType(item)
|
|
42
40
|
var post = postType(item)
|
|
43
41
|
if (values[pre]) {
|
|
44
|
-
template.push({
|
|
42
|
+
template.push({value: values[pre]})
|
|
45
43
|
values[pre] = null
|
|
46
44
|
}
|
|
47
45
|
item.minLength = null
|
|
@@ -50,7 +48,7 @@ function generatePreAndPost (baseItem, parentValues) {
|
|
|
50
48
|
template.push(item)
|
|
51
49
|
values[item.type] = values[item.type]
|
|
52
50
|
if (values[post]) {
|
|
53
|
-
template.push({
|
|
51
|
+
template.push({value: values[post]})
|
|
54
52
|
values[post] = null
|
|
55
53
|
}
|
|
56
54
|
return function ($1, $2, length) {
|
|
@@ -73,73 +71,47 @@ function prepareItems (width, template, values) {
|
|
|
73
71
|
cloned.value = values[type]
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
if (cloned.value == null || cloned.value === '')
|
|
77
|
-
return null
|
|
78
|
-
}
|
|
74
|
+
if (cloned.value == null || cloned.value === '') return null
|
|
79
75
|
cloned.index = index
|
|
80
76
|
cloned.first = index === 0
|
|
81
77
|
cloned.last = index === arr.length - 1
|
|
82
|
-
if (hasPreOrPost(cloned, values))
|
|
83
|
-
cloned.value = generatePreAndPost(cloned, values)
|
|
84
|
-
}
|
|
78
|
+
if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values)
|
|
85
79
|
return cloned
|
|
86
80
|
}
|
|
87
81
|
|
|
88
|
-
var output = template.map(cloneAndObjectify).filter(function (item) {
|
|
89
|
-
return item != null
|
|
90
|
-
})
|
|
82
|
+
var output = template.map(cloneAndObjectify).filter(function (item) { return item != null })
|
|
91
83
|
|
|
92
84
|
var remainingSpace = width
|
|
93
85
|
var variableCount = output.length
|
|
94
86
|
|
|
95
87
|
function consumeSpace (length) {
|
|
96
|
-
if (length > remainingSpace)
|
|
97
|
-
length = remainingSpace
|
|
98
|
-
}
|
|
88
|
+
if (length > remainingSpace) length = remainingSpace
|
|
99
89
|
remainingSpace -= length
|
|
100
90
|
}
|
|
101
91
|
|
|
102
92
|
function finishSizing (item, length) {
|
|
103
|
-
if (item.finished)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (length === Infinity) {
|
|
107
|
-
throw new error.Internal('Length of template item cannot be infinity')
|
|
108
|
-
}
|
|
109
|
-
if (length != null) {
|
|
110
|
-
item.length = length
|
|
111
|
-
}
|
|
93
|
+
if (item.finished) throw new error.Internal('Tried to finish template item that was already finished')
|
|
94
|
+
if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity')
|
|
95
|
+
if (length != null) item.length = length
|
|
112
96
|
item.minLength = null
|
|
113
97
|
item.maxLength = null
|
|
114
98
|
--variableCount
|
|
115
99
|
item.finished = true
|
|
116
|
-
if (item.length == null)
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
if (item.length == null) {
|
|
120
|
-
throw new error.Internal('Finished template items must have a length')
|
|
121
|
-
}
|
|
100
|
+
if (item.length == null) item.length = item.getBaseLength()
|
|
101
|
+
if (item.length == null) throw new error.Internal('Finished template items must have a length')
|
|
122
102
|
consumeSpace(item.getLength())
|
|
123
103
|
}
|
|
124
104
|
|
|
125
105
|
output.forEach(function (item) {
|
|
126
|
-
if (!item.kerning)
|
|
127
|
-
return
|
|
128
|
-
}
|
|
106
|
+
if (!item.kerning) return
|
|
129
107
|
var prevPadRight = item.first ? 0 : output[item.index - 1].padRight
|
|
130
|
-
if (!item.first && prevPadRight < item.kerning)
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
if (!item.last) {
|
|
134
|
-
item.padRight = item.kerning
|
|
135
|
-
}
|
|
108
|
+
if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight
|
|
109
|
+
if (!item.last) item.padRight = item.kerning
|
|
136
110
|
})
|
|
137
111
|
|
|
138
112
|
// Finish any that have a fixed (literal or intuited) length
|
|
139
113
|
output.forEach(function (item) {
|
|
140
|
-
if (item.getBaseLength() == null)
|
|
141
|
-
return
|
|
142
|
-
}
|
|
114
|
+
if (item.getBaseLength() == null) return
|
|
143
115
|
finishSizing(item)
|
|
144
116
|
})
|
|
145
117
|
|
|
@@ -150,48 +122,34 @@ function prepareItems (width, template, values) {
|
|
|
150
122
|
resizing = false
|
|
151
123
|
hunkSize = Math.round(remainingSpace / variableCount)
|
|
152
124
|
output.forEach(function (item) {
|
|
153
|
-
if (item.finished)
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
if (!item.maxLength) {
|
|
157
|
-
return
|
|
158
|
-
}
|
|
125
|
+
if (item.finished) return
|
|
126
|
+
if (!item.maxLength) return
|
|
159
127
|
if (item.getMaxLength() < hunkSize) {
|
|
160
128
|
finishSizing(item, item.maxLength)
|
|
161
129
|
resizing = true
|
|
162
130
|
}
|
|
163
131
|
})
|
|
164
132
|
} while (resizing && resized++ < output.length)
|
|
165
|
-
if (resizing)
|
|
166
|
-
throw new error.Internal('Resize loop iterated too many times while determining maxLength')
|
|
167
|
-
}
|
|
133
|
+
if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength')
|
|
168
134
|
|
|
169
135
|
resized = 0
|
|
170
136
|
do {
|
|
171
137
|
resizing = false
|
|
172
138
|
hunkSize = Math.round(remainingSpace / variableCount)
|
|
173
139
|
output.forEach(function (item) {
|
|
174
|
-
if (item.finished)
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
if (!item.minLength) {
|
|
178
|
-
return
|
|
179
|
-
}
|
|
140
|
+
if (item.finished) return
|
|
141
|
+
if (!item.minLength) return
|
|
180
142
|
if (item.getMinLength() >= hunkSize) {
|
|
181
143
|
finishSizing(item, item.minLength)
|
|
182
144
|
resizing = true
|
|
183
145
|
}
|
|
184
146
|
})
|
|
185
147
|
} while (resizing && resized++ < output.length)
|
|
186
|
-
if (resizing)
|
|
187
|
-
throw new error.Internal('Resize loop iterated too many times while determining minLength')
|
|
188
|
-
}
|
|
148
|
+
if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength')
|
|
189
149
|
|
|
190
150
|
hunkSize = Math.round(remainingSpace / variableCount)
|
|
191
151
|
output.forEach(function (item) {
|
|
192
|
-
if (item.finished)
|
|
193
|
-
return
|
|
194
|
-
}
|
|
152
|
+
if (item.finished) return
|
|
195
153
|
finishSizing(item, hunkSize)
|
|
196
154
|
})
|
|
197
155
|
|
|
@@ -210,9 +168,7 @@ function renderFunction (item, values, length) {
|
|
|
210
168
|
function renderValue (item, values) {
|
|
211
169
|
var length = item.getBaseLength()
|
|
212
170
|
var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value
|
|
213
|
-
if (value == null || value === '')
|
|
214
|
-
return ''
|
|
215
|
-
}
|
|
171
|
+
if (value == null || value === '') return ''
|
|
216
172
|
var alignWith = align[item.align] || align.left
|
|
217
173
|
var leftPadding = item.padLeft ? align.left('', item.padLeft) : ''
|
|
218
174
|
var rightPadding = item.padRight ? align.right('', item.padRight) : ''
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,9 +4,7 @@ var stringWidth = require('string-width')
|
|
|
4
4
|
module.exports = TemplateItem
|
|
5
5
|
|
|
6
6
|
function isPercent (num) {
|
|
7
|
-
if (typeof num !== 'string')
|
|
8
|
-
return false
|
|
9
|
-
}
|
|
7
|
+
if (typeof num !== 'string') return false
|
|
10
8
|
return num.slice(-1) === '%'
|
|
11
9
|
}
|
|
12
10
|
|
|
@@ -32,9 +30,7 @@ function TemplateItem (values, outputLength) {
|
|
|
32
30
|
if (typeof values === 'string') {
|
|
33
31
|
this.value = values
|
|
34
32
|
} else {
|
|
35
|
-
for (var prop in values)
|
|
36
|
-
this[prop] = values[prop]
|
|
37
|
-
}
|
|
33
|
+
for (var prop in values) this[prop] = values[prop]
|
|
38
34
|
}
|
|
39
35
|
// Realize percents
|
|
40
36
|
if (isPercent(this.length)) {
|
|
@@ -53,12 +49,7 @@ TemplateItem.prototype = {}
|
|
|
53
49
|
|
|
54
50
|
TemplateItem.prototype.getBaseLength = function () {
|
|
55
51
|
var length = this.length
|
|
56
|
-
if (
|
|
57
|
-
length == null &&
|
|
58
|
-
typeof this.value === 'string' &&
|
|
59
|
-
this.maxLength == null &&
|
|
60
|
-
this.minLength == null
|
|
61
|
-
) {
|
|
52
|
+
if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) {
|
|
62
53
|
length = stringWidth(this.value)
|
|
63
54
|
}
|
|
64
55
|
return length
|
|
@@ -66,22 +57,16 @@ TemplateItem.prototype.getBaseLength = function () {
|
|
|
66
57
|
|
|
67
58
|
TemplateItem.prototype.getLength = function () {
|
|
68
59
|
var length = this.getBaseLength()
|
|
69
|
-
if (length == null)
|
|
70
|
-
return null
|
|
71
|
-
}
|
|
60
|
+
if (length == null) return null
|
|
72
61
|
return length + this.padLeft + this.padRight
|
|
73
62
|
}
|
|
74
63
|
|
|
75
64
|
TemplateItem.prototype.getMaxLength = function () {
|
|
76
|
-
if (this.maxLength == null)
|
|
77
|
-
return null
|
|
78
|
-
}
|
|
65
|
+
if (this.maxLength == null) return null
|
|
79
66
|
return this.maxLength + this.padLeft + this.padRight
|
|
80
67
|
}
|
|
81
68
|
|
|
82
69
|
TemplateItem.prototype.getMinLength = function () {
|
|
83
|
-
if (this.minLength == null)
|
|
84
|
-
return null
|
|
85
|
-
}
|
|
70
|
+
if (this.minLength == null) return null
|
|
86
71
|
return this.minLength + this.padLeft + this.padRight
|
|
87
72
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
+
var objectAssign = require('object-assign')
|
|
2
3
|
|
|
3
4
|
module.exports = function () {
|
|
4
5
|
return ThemeSetProto.newThemeSet()
|
|
@@ -13,7 +14,7 @@ ThemeSetProto.newTheme = function (parent, theme) {
|
|
|
13
14
|
theme = parent
|
|
14
15
|
parent = this.baseTheme
|
|
15
16
|
}
|
|
16
|
-
return
|
|
17
|
+
return objectAssign({}, parent, theme)
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
ThemeSetProto.getThemeNames = function () {
|
|
@@ -27,15 +28,13 @@ ThemeSetProto.addTheme = function (name, parent, theme) {
|
|
|
27
28
|
ThemeSetProto.addToAllThemes = function (theme) {
|
|
28
29
|
var themes = this.themes
|
|
29
30
|
Object.keys(themes).forEach(function (name) {
|
|
30
|
-
|
|
31
|
+
objectAssign(themes[name], theme)
|
|
31
32
|
})
|
|
32
|
-
|
|
33
|
+
objectAssign(this.baseTheme, theme)
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
ThemeSetProto.getTheme = function (name) {
|
|
36
|
-
if (!this.themes[name])
|
|
37
|
-
throw this.newMissingThemeError(name)
|
|
38
|
-
}
|
|
37
|
+
if (!this.themes[name]) throw this.newMissingThemeError(name)
|
|
39
38
|
return this.themes[name]
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -47,23 +46,17 @@ ThemeSetProto.setDefault = function (opts, name) {
|
|
|
47
46
|
var platform = opts.platform == null ? 'fallback' : opts.platform
|
|
48
47
|
var hasUnicode = !!opts.hasUnicode
|
|
49
48
|
var hasColor = !!opts.hasColor
|
|
50
|
-
if (!this.defaults[platform]) {
|
|
51
|
-
this.defaults[platform] = { true: {}, false: {} }
|
|
52
|
-
}
|
|
49
|
+
if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}}
|
|
53
50
|
this.defaults[platform][hasUnicode][hasColor] = name
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
ThemeSetProto.getDefault = function (opts) {
|
|
57
|
-
if (!opts) {
|
|
58
|
-
opts = {}
|
|
59
|
-
}
|
|
54
|
+
if (!opts) opts = {}
|
|
60
55
|
var platformName = opts.platform || process.platform
|
|
61
56
|
var platform = this.defaults[platformName] || this.defaults.fallback
|
|
62
57
|
var hasUnicode = !!opts.hasUnicode
|
|
63
58
|
var hasColor = !!opts.hasColor
|
|
64
|
-
if (!platform)
|
|
65
|
-
throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor)
|
|
66
|
-
}
|
|
59
|
+
if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor)
|
|
67
60
|
if (!platform[hasUnicode][hasColor]) {
|
|
68
61
|
if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) {
|
|
69
62
|
hasUnicode = false
|
|
@@ -83,7 +76,7 @@ ThemeSetProto.getDefault = function (opts) {
|
|
|
83
76
|
if (platform[hasUnicode][hasColor]) {
|
|
84
77
|
return this.getTheme(platform[hasUnicode][hasColor])
|
|
85
78
|
} else {
|
|
86
|
-
return this.getDefault(
|
|
79
|
+
return this.getDefault(objectAssign({}, opts, {platform: 'fallback'}))
|
|
87
80
|
}
|
|
88
81
|
}
|
|
89
82
|
|
|
@@ -95,28 +88,27 @@ ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) {
|
|
|
95
88
|
return err
|
|
96
89
|
}
|
|
97
90
|
|
|
98
|
-
ThemeSetProto.newMissingDefaultThemeError =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
'Could not find a gauge theme for your platform/unicode/color use combo:\n' +
|
|
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' +
|
|
102
94
|
' platform = ' + platformName + '\n' +
|
|
103
95
|
' hasUnicode = ' + hasUnicode + '\n' +
|
|
104
96
|
' hasColor = ' + hasColor)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
+
}
|
|
112
104
|
|
|
113
105
|
ThemeSetProto.newThemeSet = function () {
|
|
114
106
|
var themeset = function (opts) {
|
|
115
107
|
return themeset.getDefault(opts)
|
|
116
108
|
}
|
|
117
|
-
return
|
|
118
|
-
themes:
|
|
119
|
-
baseTheme:
|
|
120
|
-
defaults: JSON.parse(JSON.stringify(this.defaults || {}))
|
|
109
|
+
return objectAssign(themeset, ThemeSetProto, {
|
|
110
|
+
themes: objectAssign({}, this.themes),
|
|
111
|
+
baseTheme: objectAssign({}, this.baseTheme),
|
|
112
|
+
defaults: JSON.parse(JSON.stringify(this.defaults || {}))
|
|
121
113
|
})
|
|
122
114
|
}
|
|
@@ -9,10 +9,10 @@ themes.addTheme('ASCII', {
|
|
|
9
9
|
postProgressbar: ']',
|
|
10
10
|
progressbarTheme: {
|
|
11
11
|
complete: '#',
|
|
12
|
-
remaining: '.'
|
|
12
|
+
remaining: '.'
|
|
13
13
|
},
|
|
14
14
|
activityIndicatorTheme: '-\\|/',
|
|
15
|
-
preSubsection: '>'
|
|
15
|
+
preSubsection: '>'
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
themes.addTheme('colorASCII', themes.getTheme('ASCII'), {
|
|
@@ -22,8 +22,8 @@ themes.addTheme('colorASCII', themes.getTheme('ASCII'), {
|
|
|
22
22
|
postComplete: color('reset'),
|
|
23
23
|
preRemaining: color('bgBrightBlack', 'brightBlack'),
|
|
24
24
|
remaining: '.',
|
|
25
|
-
postRemaining: color('reset')
|
|
26
|
-
}
|
|
25
|
+
postRemaining: color('reset')
|
|
26
|
+
}
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
themes.addTheme('brailleSpinner', {
|
|
@@ -31,10 +31,10 @@ themes.addTheme('brailleSpinner', {
|
|
|
31
31
|
postProgressbar: '⸩',
|
|
32
32
|
progressbarTheme: {
|
|
33
33
|
complete: '#',
|
|
34
|
-
remaining: '⠂'
|
|
34
|
+
remaining: '⠂'
|
|
35
35
|
},
|
|
36
36
|
activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏',
|
|
37
|
-
preSubsection: '>'
|
|
37
|
+
preSubsection: '>'
|
|
38
38
|
})
|
|
39
39
|
|
|
40
40
|
themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), {
|
|
@@ -44,13 +44,13 @@ themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), {
|
|
|
44
44
|
postComplete: color('reset'),
|
|
45
45
|
preRemaining: color('bgBrightBlack', 'brightBlack'),
|
|
46
46
|
remaining: '⠂',
|
|
47
|
-
postRemaining: color('reset')
|
|
48
|
-
}
|
|
47
|
+
postRemaining: color('reset')
|
|
48
|
+
}
|
|
49
49
|
})
|
|
50
50
|
|
|
51
51
|
themes.setDefault({}, 'ASCII')
|
|
52
|
-
themes.setDefault({
|
|
53
|
-
themes.setDefault({
|
|
54
|
-
themes.setDefault({
|
|
55
|
-
themes.setDefault({
|
|
56
|
-
themes.setDefault({
|
|
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,15 +5,9 @@ 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
|
-
|
|
11
|
-
if (target <= 0) {
|
|
12
|
-
return ''
|
|
13
|
-
}
|
|
14
|
-
if (stringWidth(str) <= target) {
|
|
15
|
-
return str
|
|
16
|
-
}
|
|
8
|
+
if (stringWidth(str) === 0) return str
|
|
9
|
+
if (target <= 0) return ''
|
|
10
|
+
if (stringWidth(str) <= target) return str
|
|
17
11
|
|
|
18
12
|
// We compute the number of bytes of ansi sequences here and add
|
|
19
13
|
// that to our initial truncation to ensure that we don't slice one
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A minimal matching utility.
|
|
4
4
|
|
|
5
|
-
[](http://travis-ci.org/isaacs/minimatch)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
This is the matching library used internally by npm.
|
|
@@ -171,6 +171,27 @@ Suppress the behavior of treating a leading `!` character as negation.
|
|
|
171
171
|
Returns from negate expressions the same as if they were not negated.
|
|
172
172
|
(Ie, true on a hit, false on a miss.)
|
|
173
173
|
|
|
174
|
+
### partial
|
|
175
|
+
|
|
176
|
+
Compare a partial path to a pattern. As long as the parts of the path that
|
|
177
|
+
are present are not contradicted by the pattern, it will be treated as a
|
|
178
|
+
match. This is useful in applications where you're walking through a
|
|
179
|
+
folder structure, and don't yet have the full path, but want to ensure that
|
|
180
|
+
you do not walk down paths that can never be a match.
|
|
181
|
+
|
|
182
|
+
For example,
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d
|
|
186
|
+
minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d
|
|
187
|
+
minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### allowWindowsEscape
|
|
191
|
+
|
|
192
|
+
Windows path separator `\` is by default converted to `/`, which
|
|
193
|
+
prohibits the usage of `\` as a escape character. This flag skips that
|
|
194
|
+
behavior and allows using the escape character.
|
|
174
195
|
|
|
175
196
|
## Comparisons to other fnmatch/glob implementations
|
|
176
197
|
|