pnpm 6.22.2 → 6.23.3

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 (116) hide show
  1. package/dist/node_modules/ansi-regex/index.js +8 -2
  2. package/dist/node_modules/ansi-regex/license +4 -16
  3. package/dist/node_modules/ansi-regex/package.json +53 -62
  4. package/dist/node_modules/aproba/index.js +33 -33
  5. package/dist/node_modules/aproba/package.json +5 -4
  6. package/dist/node_modules/are-we-there-yet/{index.js → lib/index.js} +0 -0
  7. package/dist/node_modules/are-we-there-yet/{tracker-base.js → lib/tracker-base.js} +0 -0
  8. package/dist/node_modules/are-we-there-yet/{tracker-group.js → lib/tracker-group.js} +14 -5
  9. package/dist/node_modules/are-we-there-yet/{tracker-stream.js → lib/tracker-stream.js} +0 -0
  10. package/dist/node_modules/are-we-there-yet/{tracker.js → lib/tracker.js} +3 -1
  11. package/dist/node_modules/are-we-there-yet/package.json +35 -17
  12. package/dist/node_modules/{npmlog → color-support}/LICENSE +0 -0
  13. package/dist/node_modules/color-support/bin.js +3 -0
  14. package/dist/node_modules/color-support/browser.js +14 -0
  15. package/dist/node_modules/color-support/index.js +134 -0
  16. package/dist/node_modules/color-support/package.json +36 -0
  17. package/dist/node_modules/debug/LICENSE +10 -9
  18. package/dist/node_modules/debug/package.json +6 -6
  19. package/dist/node_modules/debug/src/common.js +1 -1
  20. package/dist/node_modules/gauge/{base-theme.js → lib/base-theme.js} +7 -3
  21. package/dist/node_modules/gauge/lib/demo.js +45 -0
  22. package/dist/node_modules/gauge/{error.js → lib/error.js} +0 -0
  23. package/dist/node_modules/gauge/lib/has-color.js +4 -0
  24. package/dist/node_modules/gauge/{index.js → lib/index.js} +90 -33
  25. package/dist/node_modules/gauge/{plumbing.js → lib/plumbing.js} +3 -1
  26. package/dist/node_modules/gauge/{process.js → lib/process.js} +0 -0
  27. package/dist/node_modules/gauge/{progress-bar.js → lib/progress-bar.js} +12 -6
  28. package/dist/node_modules/gauge/{render-template.js → lib/render-template.js} +69 -28
  29. package/dist/node_modules/gauge/{set-immediate.js → lib/set-immediate.js} +0 -0
  30. package/dist/node_modules/gauge/{set-interval.js → lib/set-interval.js} +0 -0
  31. package/dist/node_modules/gauge/{spin.js → lib/spin.js} +0 -0
  32. package/dist/node_modules/gauge/{template-item.js → lib/template-item.js} +21 -7
  33. package/dist/node_modules/gauge/{theme-set.js → lib/theme-set.js} +31 -24
  34. package/dist/node_modules/gauge/lib/themes.js +56 -0
  35. package/dist/node_modules/gauge/{wide-truncate.js → lib/wide-truncate.js} +9 -3
  36. package/dist/node_modules/gauge/package.json +39 -40
  37. package/dist/node_modules/is-fullwidth-code-point/index.js +40 -36
  38. package/dist/node_modules/is-fullwidth-code-point/license +4 -16
  39. package/dist/node_modules/is-fullwidth-code-point/package.json +40 -43
  40. package/dist/node_modules/node-gyp/package.json +2 -2
  41. package/dist/node_modules/npmlog/{log.js → lib/log.js} +148 -54
  42. package/dist/node_modules/npmlog/package.json +30 -12
  43. package/dist/node_modules/readable-stream/errors-browser.js +127 -0
  44. package/dist/node_modules/readable-stream/errors.js +116 -0
  45. package/dist/node_modules/readable-stream/experimentalWarning.js +17 -0
  46. package/dist/node_modules/readable-stream/lib/_stream_duplex.js +52 -44
  47. package/dist/node_modules/readable-stream/lib/_stream_passthrough.js +1 -9
  48. package/dist/node_modules/readable-stream/lib/_stream_readable.js +446 -341
  49. package/dist/node_modules/readable-stream/lib/_stream_transform.js +29 -42
  50. package/dist/node_modules/readable-stream/lib/_stream_writable.js +200 -190
  51. package/dist/node_modules/readable-stream/lib/internal/streams/async_iterator.js +207 -0
  52. package/dist/node_modules/readable-stream/lib/internal/streams/buffer_list.js +210 -0
  53. package/dist/node_modules/readable-stream/lib/internal/streams/destroy.js +48 -17
  54. package/dist/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +104 -0
  55. package/dist/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  56. package/dist/node_modules/readable-stream/lib/internal/streams/from.js +64 -0
  57. package/dist/node_modules/readable-stream/lib/internal/streams/pipeline.js +97 -0
  58. package/dist/node_modules/readable-stream/lib/internal/streams/state.js +27 -0
  59. package/dist/node_modules/readable-stream/package.json +35 -19
  60. package/dist/node_modules/readable-stream/readable-browser.js +2 -0
  61. package/dist/node_modules/readable-stream/readable.js +5 -8
  62. package/dist/node_modules/safe-buffer/index.js +3 -0
  63. package/dist/node_modules/safe-buffer/package.json +18 -4
  64. package/dist/node_modules/signal-exit/index.js +30 -8
  65. package/dist/node_modules/signal-exit/package.json +7 -5
  66. package/dist/node_modules/socks-proxy-agent/package.json +2 -2
  67. package/dist/node_modules/string-width/index.js +29 -19
  68. package/dist/node_modules/string-width/license +4 -16
  69. package/dist/node_modules/string-width/package.json +54 -54
  70. package/dist/node_modules/string_decoder/package.json +5 -2
  71. package/dist/node_modules/strip-ansi/index.js +2 -4
  72. package/dist/node_modules/strip-ansi/license +4 -16
  73. package/dist/node_modules/strip-ansi/package.json +52 -55
  74. package/dist/pnpm.cjs +52779 -4337
  75. package/package.json +18 -18
  76. package/dist/node_modules/are-we-there-yet/LICENSE +0 -5
  77. package/dist/node_modules/code-point-at/index.js +0 -32
  78. package/dist/node_modules/code-point-at/license +0 -21
  79. package/dist/node_modules/code-point-at/package.json +0 -38
  80. package/dist/node_modules/core-util-is/LICENSE +0 -19
  81. package/dist/node_modules/core-util-is/lib/util.js +0 -107
  82. package/dist/node_modules/core-util-is/package.json +0 -38
  83. package/dist/node_modules/gauge/LICENSE +0 -13
  84. package/dist/node_modules/gauge/has-color.js +0 -12
  85. package/dist/node_modules/gauge/themes.js +0 -54
  86. package/dist/node_modules/isarray/component.json +0 -19
  87. package/dist/node_modules/isarray/index.js +0 -5
  88. package/dist/node_modules/isarray/package.json +0 -45
  89. package/dist/node_modules/isarray/test.js +0 -20
  90. package/dist/node_modules/number-is-nan/index.js +0 -4
  91. package/dist/node_modules/number-is-nan/license +0 -21
  92. package/dist/node_modules/number-is-nan/package.json +0 -35
  93. package/dist/node_modules/object-assign/index.js +0 -90
  94. package/dist/node_modules/object-assign/license +0 -21
  95. package/dist/node_modules/object-assign/package.json +0 -42
  96. package/dist/node_modules/process-nextick-args/index.js +0 -45
  97. package/dist/node_modules/process-nextick-args/package.json +0 -25
  98. package/dist/node_modules/readable-stream/duplex-browser.js +0 -1
  99. package/dist/node_modules/readable-stream/duplex.js +0 -1
  100. package/dist/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -79
  101. package/dist/node_modules/readable-stream/passthrough.js +0 -1
  102. package/dist/node_modules/readable-stream/transform.js +0 -1
  103. package/dist/node_modules/readable-stream/writable-browser.js +0 -1
  104. package/dist/node_modules/readable-stream/writable.js +0 -8
  105. package/dist/node_modules/wide-align/node_modules/ansi-regex/index.js +0 -10
  106. package/dist/node_modules/wide-align/node_modules/ansi-regex/license +0 -9
  107. package/dist/node_modules/wide-align/node_modules/ansi-regex/package.json +0 -55
  108. package/dist/node_modules/wide-align/node_modules/is-fullwidth-code-point/index.js +0 -50
  109. package/dist/node_modules/wide-align/node_modules/is-fullwidth-code-point/license +0 -9
  110. package/dist/node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json +0 -42
  111. package/dist/node_modules/wide-align/node_modules/string-width/index.js +0 -47
  112. package/dist/node_modules/wide-align/node_modules/string-width/license +0 -9
  113. package/dist/node_modules/wide-align/node_modules/string-width/package.json +0 -56
  114. package/dist/node_modules/wide-align/node_modules/strip-ansi/index.js +0 -4
  115. package/dist/node_modules/wide-align/node_modules/strip-ansi/license +0 -9
  116. package/dist/node_modules/wide-align/node_modules/strip-ansi/package.json +0 -54
@@ -1,4 +1,10 @@
1
1
  'use strict';
2
- module.exports = function () {
3
- return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
2
+
3
+ module.exports = ({onlyFirst = false} = {}) => {
4
+ const pattern = [
5
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
6
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
7
+ ].join('|');
8
+
9
+ return new RegExp(pattern, onlyFirst ? undefined : 'g');
4
10
  };
@@ -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,64 +1,55 @@
1
1
  {
2
- "name": "ansi-regex",
3
- "version": "2.1.1",
4
- "description": "Regular expression for matching ANSI escape codes",
5
- "license": "MIT",
6
- "repository": "chalk/ansi-regex",
7
- "author": {
8
- "name": "Sindre Sorhus",
9
- "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
- },
12
- "maintainers": [
13
- "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
14
- "Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)",
15
- "JD Ballard <i.am.qix@gmail.com> (github.com/qix-)"
16
- ],
17
- "engines": {
18
- "node": ">=0.10.0"
19
- },
20
- "scripts": {
21
- "test": "xo && ava --verbose",
22
- "view-supported": "node fixtures/view-codes.js"
23
- },
24
- "files": [
25
- "index.js"
26
- ],
27
- "keywords": [
28
- "ansi",
29
- "styles",
30
- "color",
31
- "colour",
32
- "colors",
33
- "terminal",
34
- "console",
35
- "cli",
36
- "string",
37
- "tty",
38
- "escape",
39
- "formatting",
40
- "rgb",
41
- "256",
42
- "shell",
43
- "xterm",
44
- "command-line",
45
- "text",
46
- "regex",
47
- "regexp",
48
- "re",
49
- "match",
50
- "test",
51
- "find",
52
- "pattern"
53
- ],
54
- "devDependencies": {
55
- "ava": "0.17.0",
56
- "xo": "0.16.0"
57
- },
58
- "xo": {
59
- "rules": {
60
- "guard-for-in": 0,
61
- "no-loop-func": 0
62
- }
63
- }
2
+ "name": "ansi-regex",
3
+ "version": "5.0.1",
4
+ "description": "Regular expression for matching ANSI escape codes",
5
+ "license": "MIT",
6
+ "repository": "chalk/ansi-regex",
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",
17
+ "view-supported": "node fixtures/view-codes.js"
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts"
22
+ ],
23
+ "keywords": [
24
+ "ansi",
25
+ "styles",
26
+ "color",
27
+ "colour",
28
+ "colors",
29
+ "terminal",
30
+ "console",
31
+ "cli",
32
+ "string",
33
+ "tty",
34
+ "escape",
35
+ "formatting",
36
+ "rgb",
37
+ "256",
38
+ "shell",
39
+ "xterm",
40
+ "command-line",
41
+ "text",
42
+ "regex",
43
+ "regexp",
44
+ "re",
45
+ "match",
46
+ "test",
47
+ "find",
48
+ "pattern"
49
+ ],
50
+ "devDependencies": {
51
+ "ava": "^2.4.0",
52
+ "tsd": "^0.9.0",
53
+ "xo": "^0.25.3"
54
+ }
64
55
  }
@@ -1,38 +1,39 @@
1
1
  'use strict'
2
+ module.exports = validate
2
3
 
3
4
  function isArguments (thingy) {
4
5
  return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee')
5
6
  }
6
7
 
7
- var types = {
8
- '*': {label: 'any', check: function () { return true }},
9
- A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }},
10
- S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }},
11
- N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }},
12
- F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }},
13
- O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }},
14
- B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }},
15
- E: {label: 'error', check: function (thingy) { return thingy instanceof Error }},
16
- Z: {label: 'null', check: function (thingy) { return thingy == null }}
8
+ const types = {
9
+ '*': {label: 'any', check: () => true},
10
+ A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)},
11
+ S: {label: 'string', check: _ => typeof _ === 'string'},
12
+ N: {label: 'number', check: _ => typeof _ === 'number'},
13
+ F: {label: 'function', check: _ => typeof _ === 'function'},
14
+ O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)},
15
+ B: {label: 'boolean', check: _ => typeof _ === 'boolean'},
16
+ E: {label: 'error', check: _ => _ instanceof Error},
17
+ Z: {label: 'null', check: _ => _ == null}
17
18
  }
18
19
 
19
20
  function addSchema (schema, arity) {
20
- var group = arity[schema.length] = arity[schema.length] || []
21
+ const group = arity[schema.length] = arity[schema.length] || []
21
22
  if (group.indexOf(schema) === -1) group.push(schema)
22
23
  }
23
24
 
24
- var validate = module.exports = function (rawSchemas, args) {
25
+ function validate (rawSchemas, args) {
25
26
  if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length)
26
27
  if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas')
27
28
  if (!args) throw missingRequiredArg(1, 'args')
28
29
  if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas)
29
30
  if (!types.A.check(args)) throw invalidType(1, ['array'], args)
30
- var schemas = rawSchemas.split('|')
31
- var arity = {}
31
+ const schemas = rawSchemas.split('|')
32
+ const arity = {}
32
33
 
33
- schemas.forEach(function (schema) {
34
- for (var ii = 0; ii < schema.length; ++ii) {
35
- var type = schema[ii]
34
+ schemas.forEach(schema => {
35
+ for (let ii = 0; ii < schema.length; ++ii) {
36
+ const type = schema[ii]
36
37
  if (!types[type]) throw unknownType(ii, type)
37
38
  }
38
39
  if (/E.*E/.test(schema)) throw moreThanOneError(schema)
@@ -43,20 +44,18 @@ var validate = module.exports = function (rawSchemas, args) {
43
44
  if (schema.length === 1) addSchema('', arity)
44
45
  }
45
46
  })
46
- var matching = arity[args.length]
47
+ let matching = arity[args.length]
47
48
  if (!matching) {
48
49
  throw wrongNumberOfArgs(Object.keys(arity), args.length)
49
50
  }
50
- for (var ii = 0; ii < args.length; ++ii) {
51
- var newMatching = matching.filter(function (schema) {
52
- var type = schema[ii]
53
- var typeCheck = types[type].check
51
+ for (let ii = 0; ii < args.length; ++ii) {
52
+ let newMatching = matching.filter(schema => {
53
+ const type = schema[ii]
54
+ const typeCheck = types[type].check
54
55
  return typeCheck(args[ii])
55
56
  })
56
57
  if (!newMatching.length) {
57
- var labels = matching.map(function (schema) {
58
- return types[schema[ii]].label
59
- }).filter(function (schema) { return schema != null })
58
+ const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null)
60
59
  throw invalidType(ii, labels, args[ii])
61
60
  }
62
61
  matching = newMatching
@@ -72,8 +71,8 @@ function unknownType (num, type) {
72
71
  }
73
72
 
74
73
  function invalidType (num, expectedTypes, value) {
75
- var valueType
76
- Object.keys(types).forEach(function (typeCode) {
74
+ let valueType
75
+ Object.keys(types).forEach(typeCode => {
77
76
  if (types[typeCode].check(value)) valueType = types[typeCode].label
78
77
  })
79
78
  return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' +
@@ -85,8 +84,8 @@ function englishList (list) {
85
84
  }
86
85
 
87
86
  function wrongNumberOfArgs (expected, got) {
88
- var english = englishList(expected)
89
- var args = expected.every(function (ex) { return ex.length === 1 })
87
+ const english = englishList(expected)
88
+ const args = expected.every(ex => ex.length === 1)
90
89
  ? 'argument'
91
90
  : 'arguments'
92
91
  return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got)
@@ -98,8 +97,9 @@ function moreThanOneError (schema) {
98
97
  }
99
98
 
100
99
  function newException (code, msg) {
101
- var e = new Error(msg)
102
- e.code = code
103
- if (Error.captureStackTrace) Error.captureStackTrace(e, validate)
104
- return e
100
+ const err = new Error(msg)
101
+ err.code = code
102
+ /* istanbul ignore else */
103
+ if (Error.captureStackTrace) Error.captureStackTrace(err, validate)
104
+ return err
105
105
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aproba",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "description": "A ridiculously light-weight argument validator (now browser friendly)",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -8,14 +8,15 @@
8
8
  },
9
9
  "dependencies": {},
10
10
  "devDependencies": {
11
- "standard": "^10.0.3",
12
- "tap": "^10.0.2"
11
+ "standard": "^11.0.1",
12
+ "tap": "^12.0.1"
13
13
  },
14
14
  "files": [
15
15
  "index.js"
16
16
  ],
17
17
  "scripts": {
18
- "test": "standard && tap -j3 test/*.js"
18
+ "pretest": "standard",
19
+ "test": "tap --100 -J test/*.js"
19
20
  },
20
21
  "repository": {
21
22
  "type": "git",
@@ -19,7 +19,9 @@ util.inherits(TrackerGroup, TrackerBase)
19
19
  function bubbleChange (trackerGroup) {
20
20
  return function (name, completed, tracker) {
21
21
  trackerGroup.completion[tracker.id] = completed
22
- if (trackerGroup.finished) return
22
+ if (trackerGroup.finished) {
23
+ return
24
+ }
23
25
  trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup)
24
26
  }
25
27
  }
@@ -53,17 +55,22 @@ TrackerGroup.prototype.addUnit = function (unit, weight) {
53
55
  this.trackers.push(unit)
54
56
  this.completion[unit.id] = unit.completed()
55
57
  unit.on('change', this.bubbleChange)
56
- if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit)
58
+ if (!this.finished) {
59
+ this.emit('change', unit.name, this.completion[unit.id], unit)
60
+ }
57
61
  return unit
58
62
  }
59
63
 
60
64
  TrackerGroup.prototype.completed = function () {
61
- if (this.trackers.length === 0) return 0
65
+ if (this.trackers.length === 0) {
66
+ return 0
67
+ }
62
68
  var valPerWeight = 1 / this.totalWeight
63
69
  var completed = 0
64
70
  for (var ii = 0; ii < this.trackers.length; ii++) {
65
71
  var trackerId = this.trackers[ii].id
66
- completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId]
72
+ completed +=
73
+ valPerWeight * this.weight[trackerId] * this.completion[trackerId]
67
74
  }
68
75
  return completed
69
76
  }
@@ -82,7 +89,9 @@ TrackerGroup.prototype.newStream = function (name, todo, weight) {
82
89
 
83
90
  TrackerGroup.prototype.finish = function () {
84
91
  this.finished = true
85
- if (!this.trackers.length) this.addUnit(new Tracker(), 1, true)
92
+ if (!this.trackers.length) {
93
+ this.addUnit(new Tracker(), 1, true)
94
+ }
86
95
  for (var ii = 0; ii < this.trackers.length; ii++) {
87
96
  var tracker = this.trackers[ii]
88
97
  tracker.finish()
@@ -20,7 +20,9 @@ Tracker.prototype.addWork = function (work) {
20
20
 
21
21
  Tracker.prototype.completeWork = function (work) {
22
22
  this.workDone += work
23
- if (this.workDone > this.workTodo) this.workDone = this.workTodo
23
+ if (this.workDone > this.workTodo) {
24
+ this.workDone = this.workTodo
25
+ }
24
26
  this.emit('change', this.name, this.completed(), this)
25
27
  }
26
28
 
@@ -1,35 +1,53 @@
1
1
  {
2
2
  "name": "are-we-there-yet",
3
- "version": "1.1.7",
3
+ "version": "2.0.0",
4
4
  "description": "Keep track of the overall completion of many disparate processes",
5
- "main": "index.js",
5
+ "main": "lib/index.js",
6
6
  "scripts": {
7
- "test": "standard && tap test/*.js"
7
+ "test": "tap",
8
+ "npmclilint": "npmcli-lint",
9
+ "lint": "eslint '**/*.js'",
10
+ "lintfix": "npm run lint -- --fix",
11
+ "posttest": "npm run lint",
12
+ "postsnap": "npm run lintfix --",
13
+ "preversion": "npm test",
14
+ "postversion": "npm publish",
15
+ "prepublishOnly": "git push origin --follow-tags",
16
+ "snap": "tap"
8
17
  },
9
18
  "repository": {
10
19
  "type": "git",
11
- "url": "https://github.com/iarna/are-we-there-yet.git"
20
+ "url": "https://github.com/npm/are-we-there-yet.git"
12
21
  },
13
- "author": "Rebecca Turner (http://re-becca.org)",
22
+ "author": "GitHub Inc.",
14
23
  "license": "ISC",
15
24
  "bugs": {
16
- "url": "https://github.com/iarna/are-we-there-yet/issues"
25
+ "url": "https://github.com/npm/are-we-there-yet/issues"
17
26
  },
18
- "homepage": "https://github.com/iarna/are-we-there-yet",
27
+ "homepage": "https://github.com/npm/are-we-there-yet",
19
28
  "devDependencies": {
20
- "standard": "^11.0.1",
21
- "tap": "^12.0.1"
29
+ "@npmcli/eslint-config": "^1.0.0",
30
+ "@npmcli/template-oss": "^1.0.2",
31
+ "eslint": "^7.32.0",
32
+ "eslint-plugin-node": "^11.1.0",
33
+ "tap": "^15.0.9"
22
34
  },
23
35
  "dependencies": {
24
36
  "delegates": "^1.0.0",
25
- "readable-stream": "^2.0.6"
37
+ "readable-stream": "^3.6.0"
26
38
  },
27
39
  "files": [
28
- "index.js",
29
- "tracker-base.js",
30
- "tracker-group.js",
31
- "tracker-stream.js",
32
- "tracker.js",
33
- "CHANGES.md"
34
- ]
40
+ "bin",
41
+ "lib"
42
+ ],
43
+ "engines": {
44
+ "node": ">=10"
45
+ },
46
+ "tap": {
47
+ "branches": 68,
48
+ "statements": 92,
49
+ "functions": 86,
50
+ "lines": 92
51
+ },
52
+ "templateVersion": "1.0.2"
35
53
  }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ var colorSupport = require('./')({alwaysReturn: true })
3
+ console.log(JSON.stringify(colorSupport, null, 2))
@@ -0,0 +1,14 @@
1
+ module.exports = colorSupport({ alwaysReturn: true }, colorSupport)
2
+
3
+ function colorSupport(options, obj) {
4
+ obj = obj || {}
5
+ options = options || {}
6
+ obj.level = 0
7
+ obj.hasBasic = false
8
+ obj.has256 = false
9
+ obj.has16m = false
10
+ if (!options.alwaysReturn) {
11
+ return false
12
+ }
13
+ return obj
14
+ }
@@ -0,0 +1,134 @@
1
+ // call it on itself so we can test the export val for basic stuff
2
+ module.exports = colorSupport({ alwaysReturn: true }, colorSupport)
3
+
4
+ function hasNone (obj, options) {
5
+ obj.level = 0
6
+ obj.hasBasic = false
7
+ obj.has256 = false
8
+ obj.has16m = false
9
+ if (!options.alwaysReturn) {
10
+ return false
11
+ }
12
+ return obj
13
+ }
14
+
15
+ function hasBasic (obj) {
16
+ obj.hasBasic = true
17
+ obj.has256 = false
18
+ obj.has16m = false
19
+ obj.level = 1
20
+ return obj
21
+ }
22
+
23
+ function has256 (obj) {
24
+ obj.hasBasic = true
25
+ obj.has256 = true
26
+ obj.has16m = false
27
+ obj.level = 2
28
+ return obj
29
+ }
30
+
31
+ function has16m (obj) {
32
+ obj.hasBasic = true
33
+ obj.has256 = true
34
+ obj.has16m = true
35
+ obj.level = 3
36
+ return obj
37
+ }
38
+
39
+ function colorSupport (options, obj) {
40
+ options = options || {}
41
+
42
+ obj = obj || {}
43
+
44
+ // if just requesting a specific level, then return that.
45
+ if (typeof options.level === 'number') {
46
+ switch (options.level) {
47
+ case 0:
48
+ return hasNone(obj, options)
49
+ case 1:
50
+ return hasBasic(obj)
51
+ case 2:
52
+ return has256(obj)
53
+ case 3:
54
+ return has16m(obj)
55
+ }
56
+ }
57
+
58
+ obj.level = 0
59
+ obj.hasBasic = false
60
+ obj.has256 = false
61
+ obj.has16m = false
62
+
63
+ if (typeof process === 'undefined' ||
64
+ !process ||
65
+ !process.stdout ||
66
+ !process.env ||
67
+ !process.platform) {
68
+ return hasNone(obj, options)
69
+ }
70
+
71
+ var env = options.env || process.env
72
+ var stream = options.stream || process.stdout
73
+ var term = options.term || env.TERM || ''
74
+ var platform = options.platform || process.platform
75
+
76
+ if (!options.ignoreTTY && !stream.isTTY) {
77
+ return hasNone(obj, options)
78
+ }
79
+
80
+ if (!options.ignoreDumb && term === 'dumb' && !env.COLORTERM) {
81
+ return hasNone(obj, options)
82
+ }
83
+
84
+ if (platform === 'win32') {
85
+ return hasBasic(obj)
86
+ }
87
+
88
+ if (env.TMUX) {
89
+ return has256(obj)
90
+ }
91
+
92
+ if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION)) {
93
+ if (env.TRAVIS) {
94
+ return has256(obj)
95
+ } else {
96
+ return hasNone(obj, options)
97
+ }
98
+ }
99
+
100
+ // TODO: add more term programs
101
+ switch (env.TERM_PROGRAM) {
102
+ case 'iTerm.app':
103
+ var ver = env.TERM_PROGRAM_VERSION || '0.'
104
+ if (/^[0-2]\./.test(ver)) {
105
+ return has256(obj)
106
+ } else {
107
+ return has16m(obj)
108
+ }
109
+
110
+ case 'HyperTerm':
111
+ case 'Hyper':
112
+ return has16m(obj)
113
+
114
+ case 'MacTerm':
115
+ return has16m(obj)
116
+
117
+ case 'Apple_Terminal':
118
+ return has256(obj)
119
+ }
120
+
121
+ if (/^xterm-256/.test(term)) {
122
+ return has256(obj)
123
+ }
124
+
125
+ if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term)) {
126
+ return hasBasic(obj)
127
+ }
128
+
129
+ if (env.COLORTERM) {
130
+ return hasBasic(obj)
131
+ }
132
+
133
+ return hasNone(obj, options)
134
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "color-support",
3
+ "version": "1.1.3",
4
+ "description": "A module which will endeavor to guess your terminal's level of color support.",
5
+ "main": "index.js",
6
+ "browser": "browser.js",
7
+ "bin": "bin.js",
8
+ "devDependencies": {
9
+ "tap": "^10.3.3"
10
+ },
11
+ "scripts": {
12
+ "test": "tap test/*.js --100 -J",
13
+ "preversion": "npm test",
14
+ "postversion": "npm publish",
15
+ "postpublish": "git push origin --all; git push origin --tags"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/isaacs/color-support.git"
20
+ },
21
+ "keywords": [
22
+ "terminal",
23
+ "color",
24
+ "support",
25
+ "xterm",
26
+ "truecolor",
27
+ "256"
28
+ ],
29
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
30
+ "license": "ISC",
31
+ "files": [
32
+ "browser.js",
33
+ "index.js",
34
+ "bin.js"
35
+ ]
36
+ }