Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit e82cb0f

Browse files
committed
fix: only use debug if its actually there
1 parent 8b44866 commit e82cb0f

File tree

3 files changed

+114
-104
lines changed

3 files changed

+114
-104
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
"author": "Jeff Dickey @jdxcode",
66
"bugs": "https://github.com/jdxcode/stdout-stderr/issues",
77
"dependencies": {
8-
"debug": "*",
98
"strip-ansi": "^4.0.0"
109
},
1110
"devDependencies": {
12-
"@commitlint/cli": "^6.0.5",
13-
"@commitlint/config-conventional": "^6.0.4",
11+
"@commitlint/cli": "^6.1.0",
12+
"@commitlint/config-conventional": "^6.1.0",
1413
"@dxcli/tslint": "^0.1.3",
1514
"@types/chai": "^4.1.2",
16-
"@types/lodash": "^4.14.99",
15+
"@types/lodash": "^4.14.100",
1716
"@types/mocha": "^2.2.48",
1817
"@types/nock": "^9.1.2",
1918
"@types/node": "^9.4.0",
@@ -22,15 +21,16 @@
2221
"@types/strip-ansi": "^3.0.0",
2322
"chai": "^4.1.2",
2423
"chalk": "^2.3.0",
25-
"eslint": "^4.16.0",
24+
"debug": "^3.1.0",
25+
"eslint": "^4.17.0",
2626
"eslint-config-dxcli": "^1.2.1",
2727
"husky": "^0.14.3",
2828
"mocha": "^5.0.0",
2929
"mocha-junit-reporter": "^1.17.0",
3030
"nps": "^5.7.1",
3131
"nps-utils": "^1.5.0",
3232
"ts-node": "^4.1.0",
33-
"typedoc": "^0.9.0",
33+
"typedoc": "^0.10.0",
3434
"typescript": "^2.7.1"
3535
},
3636
"engines": {

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ export interface MockStd {
2323

2424
/** mocks stdout or stderr */
2525
function mock(std: 'stdout' | 'stderr'): MockStd {
26-
const debug = require('debug')(std)
26+
let debug: any
27+
try { debug = require('debug')(std) } catch {}
2728
const orig = process[std].write
2829
let writes: string[] = []
2930
function _debug(msg: string | Buffer) {
30-
if (!debug.enabled) return
31+
if (debug && !debug.enabled) return
3132
// remap writer to allow it to send to debug
3233
const prev = process[std].write
3334
process[std].write = orig

yarn.lock

Lines changed: 105 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
# yarn lockfile v1
33

44

5-
"@commitlint/cli@^6.0.5":
6-
version "6.0.5"
7-
resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-6.0.5.tgz#c159c41434d24167c2f52c29e81cffc1959a6d0f"
5+
"@commitlint/cli@^6.1.0":
6+
version "6.1.0"
7+
resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-6.1.0.tgz#0a545088b4e0268cca1dca7e8ccd95bd55847b88"
88
dependencies:
9-
"@commitlint/core" "^6.0.5"
9+
"@commitlint/core" "^6.1.0"
1010
babel-polyfill "6.26.0"
1111
chalk "2.3.0"
1212
get-stdin "5.0.1"
1313
lodash.merge "4.6.0"
1414
lodash.pick "4.4.0"
1515
meow "3.7.0"
1616

17-
"@commitlint/config-conventional@^6.0.4":
18-
version "6.0.4"
19-
resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-6.0.4.tgz#f5332c3aaf5423f2fa62287849859a9b769484f3"
20-
21-
"@commitlint/core@^6.0.5":
22-
version "6.0.5"
23-
resolved "https://registry.yarnpkg.com/@commitlint/core/-/core-6.0.5.tgz#a0f174f08a377eb9e5571bf31c2c9f60964a6ed9"
24-
dependencies:
25-
"@commitlint/execute-rule" "^6.0.4"
26-
"@commitlint/is-ignored" "^6.0.4"
27-
"@commitlint/parse" "^6.0.4"
28-
"@commitlint/resolve-extends" "^6.0.4"
29-
"@commitlint/rules" "^6.0.4"
30-
"@commitlint/top-level" "^6.0.5"
17+
"@commitlint/config-conventional@^6.1.0":
18+
version "6.1.0"
19+
resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-6.1.0.tgz#1f1c1577f1ca10f112e4346d9c94af1f8936f0c5"
20+
21+
"@commitlint/core@^6.1.0":
22+
version "6.1.0"
23+
resolved "https://registry.yarnpkg.com/@commitlint/core/-/core-6.1.0.tgz#41b2482044039435cb9673995598717038f2f6d0"
24+
dependencies:
25+
"@commitlint/execute-rule" "^6.1.0"
26+
"@commitlint/is-ignored" "^6.1.0"
27+
"@commitlint/parse" "^6.1.0"
28+
"@commitlint/resolve-extends" "^6.1.0"
29+
"@commitlint/rules" "^6.1.0"
30+
"@commitlint/top-level" "^6.1.0"
3131
"@marionebl/sander" "^0.6.0"
3232
babel-runtime "^6.23.0"
3333
chalk "^2.0.1"
@@ -39,42 +39,42 @@
3939
lodash.topairs "4.3.0"
4040
resolve-from "4.0.0"
4141

42-
"@commitlint/ensure@^6.0.4":
43-
version "6.0.4"
44-
resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-6.0.4.tgz#c5ae6d0a24797e58caceee61608c6ac9ced64691"
42+
"@commitlint/ensure@^6.1.0":
43+
version "6.1.0"
44+
resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-6.1.0.tgz#567f029d816b6b5ca16bf62499230324c99a8fa9"
4545
dependencies:
4646
lodash.camelcase "4.3.0"
4747
lodash.kebabcase "4.1.1"
4848
lodash.snakecase "4.1.1"
4949
lodash.startcase "4.4.0"
5050
lodash.upperfirst "4.3.1"
5151

52-
"@commitlint/execute-rule@^6.0.4":
53-
version "6.0.4"
54-
resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-6.0.4.tgz#5db080be51b2cc057028ce24a1cd9142283774fc"
52+
"@commitlint/execute-rule@^6.1.0":
53+
version "6.1.0"
54+
resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-6.1.0.tgz#4f56e5855a5e25ebcbc985d2209ea29f1bb89774"
5555
dependencies:
5656
babel-runtime "6.26.0"
5757

58-
"@commitlint/is-ignored@^6.0.4":
59-
version "6.0.4"
60-
resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-6.0.4.tgz#cc4cde7be8d101e848fa70b37381687fa837c417"
58+
"@commitlint/is-ignored@^6.1.0":
59+
version "6.1.0"
60+
resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-6.1.0.tgz#0b86f8b37dfc693d6d66760b36fee1aba50882d8"
6161
dependencies:
6262
semver "5.5.0"
6363

64-
"@commitlint/message@^6.0.4":
65-
version "6.0.4"
66-
resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-6.0.4.tgz#80fe320285cab5f0f4ab3847e8d3b98a3fd1e389"
64+
"@commitlint/message@^6.1.0":
65+
version "6.1.0"
66+
resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-6.1.0.tgz#ee4ca775ad876ba59d23d02ba386c9b9038969e3"
6767

68-
"@commitlint/parse@^6.0.4":
69-
version "6.0.4"
70-
resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-6.0.4.tgz#3d7403b024200d32d66e913ee464eaf46bbac075"
68+
"@commitlint/parse@^6.1.0":
69+
version "6.1.0"
70+
resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-6.1.0.tgz#e4ba58ab632371078b9b9609ae7af03c2e7b3a3e"
7171
dependencies:
7272
conventional-changelog-angular "^1.3.3"
7373
conventional-commits-parser "^2.1.0"
7474

75-
"@commitlint/resolve-extends@^6.0.4":
76-
version "6.0.4"
77-
resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-6.0.4.tgz#8cce624e856df7582d5621c882e83f69b44c18c4"
75+
"@commitlint/resolve-extends@^6.1.0":
76+
version "6.1.0"
77+
resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-6.1.0.tgz#b3d92f69e3746e94de0023f8be3b1f605a20839a"
7878
dependencies:
7979
babel-runtime "6.26.0"
8080
lodash.merge "4.6.0"
@@ -83,22 +83,22 @@
8383
resolve-from "^4.0.0"
8484
resolve-global "^0.1.0"
8585

86-
"@commitlint/rules@^6.0.4":
87-
version "6.0.4"
88-
resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-6.0.4.tgz#6891d7e37908d6438dc3b382f193774ab4a36479"
86+
"@commitlint/rules@^6.1.0":
87+
version "6.1.0"
88+
resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-6.1.0.tgz#564b69503a3a4d09d03a9a077731c9655ee8f4df"
8989
dependencies:
90-
"@commitlint/ensure" "^6.0.4"
91-
"@commitlint/message" "^6.0.4"
92-
"@commitlint/to-lines" "^6.0.4"
90+
"@commitlint/ensure" "^6.1.0"
91+
"@commitlint/message" "^6.1.0"
92+
"@commitlint/to-lines" "^6.1.0"
9393
babel-runtime "^6.23.0"
9494

95-
"@commitlint/to-lines@^6.0.4":
96-
version "6.0.4"
97-
resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-6.0.4.tgz#c0bb6ca0b5c5f565f18d9747de12067cb2c4cc34"
95+
"@commitlint/to-lines@^6.1.0":
96+
version "6.1.0"
97+
resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-6.1.0.tgz#9e130254c980dbd456e1693df1082a77ba7114a0"
9898

99-
"@commitlint/top-level@^6.0.5":
100-
version "6.0.5"
101-
resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-6.0.5.tgz#01cac031f7452c0bebfda75d6ef7fb79d1714f81"
99+
"@commitlint/top-level@^6.1.0":
100+
version "6.1.0"
101+
resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-6.1.0.tgz#b420c1e9166df3afa000186a42b7f49cae4014cc"
102102
dependencies:
103103
find-up "^2.1.0"
104104

@@ -121,35 +121,47 @@
121121
version "4.1.2"
122122
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.2.tgz#f1af664769cfb50af805431c407425ed619daa21"
123123

124-
"@types/fs-extra@4.0.0":
125-
version "4.0.0"
126-
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.0.tgz#1dd742ad5c9bce308f7a52d02ebc01421bc9102f"
124+
"@types/events@*":
125+
version "1.1.0"
126+
resolved "https://registry.yarnpkg.com/@types/events/-/events-1.1.0.tgz#93b1be91f63c184450385272c47b6496fd028e02"
127+
128+
"@types/fs-extra@5.0.0":
129+
version "5.0.0"
130+
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.0.tgz#d3e225b35eb5c6d3a5a782c28219df365c781413"
127131
dependencies:
128132
"@types/node" "*"
129133

130-
"@types/handlebars@4.0.31":
131-
version "4.0.31"
132-
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.31.tgz#a7fba66fafe42713aee88eeca8db91192efe6e72"
134+
"@types/glob@*":
135+
version "5.0.35"
136+
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.35.tgz#1ae151c802cece940443b5ac246925c85189f32a"
137+
dependencies:
138+
"@types/events" "*"
139+
"@types/minimatch" "*"
140+
"@types/node" "*"
133141

134-
"@types/highlight.js@9.1.8":
135-
version "9.1.8"
136-
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.1.8.tgz#d227f18bcb8f3f187e16965f2444859a04689758"
142+
"@types/handlebars@4.0.36":
143+
version "4.0.36"
144+
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.36.tgz#ff57c77fa1ab6713bb446534ddc4d979707a3a79"
137145

138-
"@types/lodash@4.14.74":
139-
version "4.14.74"
140-
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.74.tgz#ac3bd8db988e7f7038e5d22bd76a7ba13f876168"
146+
"@types/highlight.js@9.12.2":
147+
version "9.12.2"
148+
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.2.tgz#6ee7cd395effe5ec80b515d3ff1699068cd0cd1d"
141149

142-
"@types/lodash@^4.14.99":
150+
"@types/lodash@4.14.99":
143151
version "4.14.99"
144152
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.99.tgz#e6e10c0a4cc16c7409b3181f1e66880d2fb7d4dc"
145153

154+
"@types/lodash@^4.14.100":
155+
version "4.14.100"
156+
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.100.tgz#f353dd9d3a9785638b6cb8023e6639097bd31969"
157+
146158
"@types/marked@0.3.0":
147159
version "0.3.0"
148160
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.3.0.tgz#583c223dd33385a1dda01aaf77b0cd0411c4b524"
149161

150-
"@types/minimatch@2.0.29":
151-
version "2.0.29"
152-
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
162+
"@types/minimatch@*", "@types/minimatch@3.0.3":
163+
version "3.0.3"
164+
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
153165

154166
"@types/mocha@^2.2.48":
155167
version "2.2.48"
@@ -185,10 +197,11 @@
185197
dependencies:
186198
"@types/normalize-package-data" "*"
187199

188-
"@types/shelljs@0.7.0":
189-
version "0.7.0"
190-
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.0.tgz#229c157c6bc1e67d6b990e6c5e18dbd2ff58cff0"
200+
"@types/shelljs@0.7.7":
201+
version "0.7.7"
202+
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.7.tgz#1f7bfa28947661afea06365db9b1135bbc903ec4"
191203
dependencies:
204+
"@types/glob" "*"
192205
"@types/node" "*"
193206

194207
"@types/strip-ansi@^3.0.0":
@@ -657,7 +670,7 @@ date-fns@^1.23.0:
657670
version "1.29.0"
658671
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6"
659672

660-
debug@*, debug@3.1.0, debug@^3.1.0:
673+
debug@3.1.0, debug@^3.1.0:
661674
version "3.1.0"
662675
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
663676
dependencies:
@@ -793,9 +806,9 @@ eslint-visitor-keys@^1.0.0:
793806
version "1.0.0"
794807
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
795808

796-
eslint@^4.16.0:
797-
version "4.16.0"
798-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.16.0.tgz#934ada9e98715e1d7bbfd6f6f0519ed2fab35cc1"
809+
eslint@^4.17.0:
810+
version "4.17.0"
811+
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.17.0.tgz#dc24bb51ede48df629be7031c71d9dc0ee4f3ddf"
799812
dependencies:
800813
ajv "^5.3.0"
801814
babel-code-frame "^6.22.0"
@@ -958,9 +971,9 @@ from@~0:
958971
version "0.1.7"
959972
resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
960973

961-
fs-extra@^4.0.0:
962-
version "4.0.3"
963-
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
974+
fs-extra@^5.0.0:
975+
version "5.0.0"
976+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd"
964977
dependencies:
965978
graceful-fs "^4.1.2"
966979
jsonfile "^4.0.0"
@@ -1472,7 +1485,7 @@ map-stream@~0.1.0:
14721485
version "0.1.0"
14731486
resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194"
14741487

1475-
marked@^0.3.5:
1488+
marked@^0.3.12:
14761489
version "0.3.12"
14771490
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.12.tgz#7cf25ff2252632f3fe2406bde258e94eee927519"
14781491

@@ -2017,9 +2030,9 @@ shebang-regex@^1.0.0:
20172030
version "1.0.0"
20182031
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
20192032

2020-
shelljs@^0.7.0:
2021-
version "0.7.8"
2022-
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
2033+
shelljs@^0.8.1:
2034+
version "0.8.1"
2035+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.1.tgz#729e038c413a2254c4078b95ed46e0397154a9f1"
20232036
dependencies:
20242037
glob "^7.0.0"
20252038
interpret "^1.0.0"
@@ -2360,33 +2373,29 @@ typedoc-default-themes@^0.5.0:
23602373
version "0.5.0"
23612374
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227"
23622375

2363-
typedoc@^0.9.0:
2364-
version "0.9.0"
2365-
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.9.0.tgz#159bff7c7784ce5b91d86f3e4cc8928e62040957"
2376+
typedoc@^0.10.0:
2377+
version "0.10.0"
2378+
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.10.0.tgz#898b447248dabf68ecbde9d5ccf5141fda8aa166"
23662379
dependencies:
2367-
"@types/fs-extra" "4.0.0"
2368-
"@types/handlebars" "4.0.31"
2369-
"@types/highlight.js" "9.1.8"
2370-
"@types/lodash" "4.14.74"
2380+
"@types/fs-extra" "5.0.0"
2381+
"@types/handlebars" "4.0.36"
2382+
"@types/highlight.js" "9.12.2"
2383+
"@types/lodash" "4.14.99"
23712384
"@types/marked" "0.3.0"
2372-
"@types/minimatch" "2.0.29"
2373-
"@types/shelljs" "0.7.0"
2374-
fs-extra "^4.0.0"
2385+
"@types/minimatch" "3.0.3"
2386+
"@types/shelljs" "0.7.7"
2387+
fs-extra "^5.0.0"
23752388
handlebars "^4.0.6"
23762389
highlight.js "^9.0.0"
23772390
lodash "^4.13.1"
2378-
marked "^0.3.5"
2391+
marked "^0.3.12"
23792392
minimatch "^3.0.0"
23802393
progress "^2.0.0"
2381-
shelljs "^0.7.0"
2394+
shelljs "^0.8.1"
23822395
typedoc-default-themes "^0.5.0"
2383-
typescript "2.4.1"
2384-
2385-
typescript@2.4.1:
2386-
version "2.4.1"
2387-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc"
2396+
typescript "2.7.1"
23882397

2389-
typescript@^2.7.1:
2398+
typescript@2.7.1, typescript@^2.7.1:
23902399
version "2.7.1"
23912400
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.1.tgz#bb3682c2c791ac90e7c6210b26478a8da085c359"
23922401

0 commit comments

Comments
 (0)