serverless-spy 2.2.4 → 2.2.5

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 (216) hide show
  1. package/.jsii +3 -3
  2. package/dist/releasetag.txt +1 -1
  3. package/lib/src/ServerlessSpy.js +1 -1
  4. package/node_modules/bundle-name/index.js +2 -2
  5. package/node_modules/bundle-name/package.json +6 -5
  6. package/node_modules/bundle-name/readme.md +2 -2
  7. package/node_modules/default-browser/index.d.ts +5 -4
  8. package/node_modules/default-browser/index.js +13 -11
  9. package/node_modules/default-browser/package.json +14 -12
  10. package/node_modules/default-browser/windows.js +11 -5
  11. package/node_modules/default-browser-id/index.js +8 -32
  12. package/node_modules/default-browser-id/package.json +5 -8
  13. package/node_modules/default-browser-id/readme.md +2 -2
  14. package/node_modules/open/index.js +10 -10
  15. package/node_modules/{is-wsl → open/node_modules/is-wsl}/index.d.ts +2 -2
  16. package/node_modules/open/node_modules/is-wsl/index.js +27 -0
  17. package/node_modules/{is-wsl → open/node_modules/is-wsl}/package.json +21 -9
  18. package/node_modules/open/node_modules/is-wsl/readme.md +21 -0
  19. package/node_modules/open/package.json +9 -8
  20. package/node_modules/open/xdg-open +338 -137
  21. package/node_modules/run-applescript/index.d.ts +28 -4
  22. package/node_modules/run-applescript/index.js +20 -7
  23. package/node_modules/run-applescript/package.json +10 -9
  24. package/node_modules/run-applescript/readme.md +44 -6
  25. package/package.json +2 -2
  26. package/node_modules/big-integer/BigInteger.d.ts +0 -2393
  27. package/node_modules/big-integer/BigInteger.js +0 -1453
  28. package/node_modules/big-integer/BigInteger.min.js +0 -1
  29. package/node_modules/big-integer/LICENSE +0 -24
  30. package/node_modules/big-integer/README.md +0 -589
  31. package/node_modules/big-integer/bower.json +0 -29
  32. package/node_modules/big-integer/package.json +0 -48
  33. package/node_modules/big-integer/tsconfig.json +0 -24
  34. package/node_modules/bplist-parser/README.md +0 -48
  35. package/node_modules/bplist-parser/bplistParser.js +0 -363
  36. package/node_modules/bplist-parser/package.json +0 -34
  37. package/node_modules/bplist-parser/test/airplay.bplist +0 -0
  38. package/node_modules/bplist-parser/test/iTunes-small.bplist +0 -0
  39. package/node_modules/bplist-parser/test/int64.bplist +0 -0
  40. package/node_modules/bplist-parser/test/int64.xml +0 -10
  41. package/node_modules/bplist-parser/test/parseTest.js +0 -104
  42. package/node_modules/bplist-parser/test/sample1.bplist +0 -0
  43. package/node_modules/bplist-parser/test/sample2.bplist +0 -0
  44. package/node_modules/bplist-parser/test/uid.bplist +0 -0
  45. package/node_modules/bplist-parser/test/utf16.bplist +0 -0
  46. package/node_modules/bplist-parser/test/utf16_chinese.plist +0 -0
  47. package/node_modules/cross-spawn/CHANGELOG.md +0 -130
  48. package/node_modules/cross-spawn/LICENSE +0 -21
  49. package/node_modules/cross-spawn/README.md +0 -96
  50. package/node_modules/cross-spawn/index.js +0 -39
  51. package/node_modules/cross-spawn/lib/enoent.js +0 -59
  52. package/node_modules/cross-spawn/lib/parse.js +0 -91
  53. package/node_modules/cross-spawn/lib/util/escape.js +0 -45
  54. package/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
  55. package/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
  56. package/node_modules/cross-spawn/package.json +0 -73
  57. package/node_modules/default-browser/node_modules/execa/index.d.ts +0 -937
  58. package/node_modules/default-browser/node_modules/execa/index.js +0 -309
  59. package/node_modules/default-browser/node_modules/execa/lib/command.js +0 -120
  60. package/node_modules/default-browser/node_modules/execa/lib/error.js +0 -87
  61. package/node_modules/default-browser/node_modules/execa/lib/kill.js +0 -102
  62. package/node_modules/default-browser/node_modules/execa/lib/pipe.js +0 -42
  63. package/node_modules/default-browser/node_modules/execa/lib/promise.js +0 -36
  64. package/node_modules/default-browser/node_modules/execa/lib/stdio.js +0 -49
  65. package/node_modules/default-browser/node_modules/execa/lib/stream.js +0 -119
  66. package/node_modules/default-browser/node_modules/execa/lib/verbose.js +0 -19
  67. package/node_modules/default-browser/node_modules/execa/package.json +0 -87
  68. package/node_modules/default-browser/node_modules/execa/readme.md +0 -824
  69. package/node_modules/default-browser/node_modules/human-signals/LICENSE +0 -201
  70. package/node_modules/default-browser/node_modules/human-signals/README.md +0 -178
  71. package/node_modules/default-browser/node_modules/human-signals/build/src/core.js +0 -273
  72. package/node_modules/default-browser/node_modules/human-signals/build/src/main.d.ts +0 -73
  73. package/node_modules/default-browser/node_modules/human-signals/build/src/main.js +0 -70
  74. package/node_modules/default-browser/node_modules/human-signals/build/src/realtime.js +0 -16
  75. package/node_modules/default-browser/node_modules/human-signals/build/src/signals.js +0 -34
  76. package/node_modules/default-browser/node_modules/human-signals/package.json +0 -61
  77. package/node_modules/default-browser/node_modules/is-stream/index.d.ts +0 -81
  78. package/node_modules/default-browser/node_modules/is-stream/index.js +0 -29
  79. package/node_modules/default-browser/node_modules/is-stream/license +0 -9
  80. package/node_modules/default-browser/node_modules/is-stream/package.json +0 -44
  81. package/node_modules/default-browser/node_modules/is-stream/readme.md +0 -60
  82. package/node_modules/default-browser/node_modules/mimic-fn/index.d.ts +0 -52
  83. package/node_modules/default-browser/node_modules/mimic-fn/index.js +0 -71
  84. package/node_modules/default-browser/node_modules/mimic-fn/license +0 -9
  85. package/node_modules/default-browser/node_modules/mimic-fn/package.json +0 -45
  86. package/node_modules/default-browser/node_modules/mimic-fn/readme.md +0 -90
  87. package/node_modules/default-browser/node_modules/npm-run-path/index.d.ts +0 -90
  88. package/node_modules/default-browser/node_modules/npm-run-path/index.js +0 -52
  89. package/node_modules/default-browser/node_modules/npm-run-path/license +0 -9
  90. package/node_modules/default-browser/node_modules/npm-run-path/package.json +0 -49
  91. package/node_modules/default-browser/node_modules/npm-run-path/readme.md +0 -104
  92. package/node_modules/default-browser/node_modules/onetime/index.d.ts +0 -59
  93. package/node_modules/default-browser/node_modules/onetime/index.js +0 -41
  94. package/node_modules/default-browser/node_modules/onetime/license +0 -9
  95. package/node_modules/default-browser/node_modules/onetime/package.json +0 -45
  96. package/node_modules/default-browser/node_modules/onetime/readme.md +0 -94
  97. package/node_modules/default-browser/node_modules/path-key/index.d.ts +0 -31
  98. package/node_modules/default-browser/node_modules/path-key/index.js +0 -12
  99. package/node_modules/default-browser/node_modules/path-key/license +0 -9
  100. package/node_modules/default-browser/node_modules/path-key/package.json +0 -41
  101. package/node_modules/default-browser/node_modules/path-key/readme.md +0 -57
  102. package/node_modules/default-browser/node_modules/strip-final-newline/index.js +0 -14
  103. package/node_modules/default-browser/node_modules/strip-final-newline/license +0 -9
  104. package/node_modules/default-browser/node_modules/strip-final-newline/package.json +0 -43
  105. package/node_modules/default-browser/node_modules/strip-final-newline/readme.md +0 -35
  106. package/node_modules/execa/index.d.ts +0 -564
  107. package/node_modules/execa/index.js +0 -268
  108. package/node_modules/execa/lib/command.js +0 -52
  109. package/node_modules/execa/lib/error.js +0 -88
  110. package/node_modules/execa/lib/kill.js +0 -115
  111. package/node_modules/execa/lib/promise.js +0 -46
  112. package/node_modules/execa/lib/stdio.js +0 -52
  113. package/node_modules/execa/lib/stream.js +0 -97
  114. package/node_modules/execa/license +0 -9
  115. package/node_modules/execa/package.json +0 -74
  116. package/node_modules/execa/readme.md +0 -663
  117. package/node_modules/get-stream/buffer-stream.js +0 -52
  118. package/node_modules/get-stream/index.d.ts +0 -105
  119. package/node_modules/get-stream/index.js +0 -61
  120. package/node_modules/get-stream/license +0 -9
  121. package/node_modules/get-stream/package.json +0 -47
  122. package/node_modules/get-stream/readme.md +0 -124
  123. package/node_modules/human-signals/CHANGELOG.md +0 -11
  124. package/node_modules/human-signals/LICENSE +0 -201
  125. package/node_modules/human-signals/README.md +0 -165
  126. package/node_modules/human-signals/build/src/core.js +0 -273
  127. package/node_modules/human-signals/build/src/core.js.map +0 -1
  128. package/node_modules/human-signals/build/src/main.d.ts +0 -52
  129. package/node_modules/human-signals/build/src/main.js +0 -71
  130. package/node_modules/human-signals/build/src/main.js.map +0 -1
  131. package/node_modules/human-signals/build/src/realtime.js +0 -19
  132. package/node_modules/human-signals/build/src/realtime.js.map +0 -1
  133. package/node_modules/human-signals/build/src/signals.js +0 -35
  134. package/node_modules/human-signals/build/src/signals.js.map +0 -1
  135. package/node_modules/human-signals/package.json +0 -64
  136. package/node_modules/is-stream/index.d.ts +0 -79
  137. package/node_modules/is-stream/index.js +0 -28
  138. package/node_modules/is-stream/license +0 -9
  139. package/node_modules/is-stream/package.json +0 -42
  140. package/node_modules/is-stream/readme.md +0 -60
  141. package/node_modules/is-wsl/index.js +0 -31
  142. package/node_modules/is-wsl/license +0 -9
  143. package/node_modules/is-wsl/node_modules/is-docker/cli.js +0 -5
  144. package/node_modules/is-wsl/node_modules/is-docker/index.d.ts +0 -15
  145. package/node_modules/is-wsl/node_modules/is-docker/index.js +0 -29
  146. package/node_modules/is-wsl/node_modules/is-docker/license +0 -9
  147. package/node_modules/is-wsl/node_modules/is-docker/package.json +0 -42
  148. package/node_modules/is-wsl/node_modules/is-docker/readme.md +0 -27
  149. package/node_modules/is-wsl/readme.md +0 -36
  150. package/node_modules/isexe/.npmignore +0 -2
  151. package/node_modules/isexe/LICENSE +0 -15
  152. package/node_modules/isexe/README.md +0 -51
  153. package/node_modules/isexe/index.js +0 -57
  154. package/node_modules/isexe/mode.js +0 -41
  155. package/node_modules/isexe/package.json +0 -31
  156. package/node_modules/isexe/test/basic.js +0 -221
  157. package/node_modules/isexe/windows.js +0 -42
  158. package/node_modules/merge-stream/LICENSE +0 -21
  159. package/node_modules/merge-stream/README.md +0 -78
  160. package/node_modules/merge-stream/index.js +0 -41
  161. package/node_modules/merge-stream/package.json +0 -19
  162. package/node_modules/mimic-fn/index.d.ts +0 -54
  163. package/node_modules/mimic-fn/index.js +0 -13
  164. package/node_modules/mimic-fn/license +0 -9
  165. package/node_modules/mimic-fn/package.json +0 -42
  166. package/node_modules/mimic-fn/readme.md +0 -69
  167. package/node_modules/npm-run-path/index.d.ts +0 -89
  168. package/node_modules/npm-run-path/index.js +0 -47
  169. package/node_modules/npm-run-path/license +0 -9
  170. package/node_modules/npm-run-path/package.json +0 -44
  171. package/node_modules/npm-run-path/readme.md +0 -115
  172. package/node_modules/onetime/index.d.ts +0 -64
  173. package/node_modules/onetime/index.js +0 -44
  174. package/node_modules/onetime/license +0 -9
  175. package/node_modules/onetime/package.json +0 -43
  176. package/node_modules/onetime/readme.md +0 -94
  177. package/node_modules/path-key/index.d.ts +0 -40
  178. package/node_modules/path-key/index.js +0 -16
  179. package/node_modules/path-key/license +0 -9
  180. package/node_modules/path-key/package.json +0 -39
  181. package/node_modules/path-key/readme.md +0 -61
  182. package/node_modules/shebang-command/index.js +0 -19
  183. package/node_modules/shebang-command/license +0 -9
  184. package/node_modules/shebang-command/package.json +0 -34
  185. package/node_modules/shebang-command/readme.md +0 -34
  186. package/node_modules/shebang-regex/index.d.ts +0 -22
  187. package/node_modules/shebang-regex/index.js +0 -2
  188. package/node_modules/shebang-regex/license +0 -9
  189. package/node_modules/shebang-regex/package.json +0 -35
  190. package/node_modules/shebang-regex/readme.md +0 -33
  191. package/node_modules/signal-exit/LICENSE.txt +0 -16
  192. package/node_modules/signal-exit/README.md +0 -39
  193. package/node_modules/signal-exit/index.js +0 -202
  194. package/node_modules/signal-exit/package.json +0 -38
  195. package/node_modules/signal-exit/signals.js +0 -53
  196. package/node_modules/strip-final-newline/index.js +0 -16
  197. package/node_modules/strip-final-newline/license +0 -9
  198. package/node_modules/strip-final-newline/package.json +0 -40
  199. package/node_modules/strip-final-newline/readme.md +0 -30
  200. package/node_modules/titleize/index.d.ts +0 -17
  201. package/node_modules/titleize/index.js +0 -7
  202. package/node_modules/titleize/license +0 -9
  203. package/node_modules/titleize/package.json +0 -42
  204. package/node_modules/titleize/readme.md +0 -25
  205. package/node_modules/untildify/index.d.ts +0 -14
  206. package/node_modules/untildify/index.js +0 -12
  207. package/node_modules/untildify/license +0 -9
  208. package/node_modules/untildify/package.json +0 -43
  209. package/node_modules/untildify/readme.md +0 -30
  210. package/node_modules/which/CHANGELOG.md +0 -166
  211. package/node_modules/which/LICENSE +0 -15
  212. package/node_modules/which/README.md +0 -54
  213. package/node_modules/which/bin/node-which +0 -52
  214. package/node_modules/which/package.json +0 -43
  215. package/node_modules/which/which.js +0 -125
  216. /package/node_modules/{default-browser/node_modules/execa → open/node_modules/is-wsl}/license +0 -0
@@ -1,31 +0,0 @@
1
- {
2
- "name": "isexe",
3
- "version": "2.0.0",
4
- "description": "Minimal module to check if a file is executable.",
5
- "main": "index.js",
6
- "directories": {
7
- "test": "test"
8
- },
9
- "devDependencies": {
10
- "mkdirp": "^0.5.1",
11
- "rimraf": "^2.5.0",
12
- "tap": "^10.3.0"
13
- },
14
- "scripts": {
15
- "test": "tap test/*.js --100",
16
- "preversion": "npm test",
17
- "postversion": "npm publish",
18
- "postpublish": "git push origin --all; git push origin --tags"
19
- },
20
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
21
- "license": "ISC",
22
- "repository": {
23
- "type": "git",
24
- "url": "git+https://github.com/isaacs/isexe.git"
25
- },
26
- "keywords": [],
27
- "bugs": {
28
- "url": "https://github.com/isaacs/isexe/issues"
29
- },
30
- "homepage": "https://github.com/isaacs/isexe#readme"
31
- }
@@ -1,221 +0,0 @@
1
- var t = require('tap')
2
- var fs = require('fs')
3
- var path = require('path')
4
- var fixture = path.resolve(__dirname, 'fixtures')
5
- var meow = fixture + '/meow.cat'
6
- var mine = fixture + '/mine.cat'
7
- var ours = fixture + '/ours.cat'
8
- var fail = fixture + '/fail.false'
9
- var noent = fixture + '/enoent.exe'
10
- var mkdirp = require('mkdirp')
11
- var rimraf = require('rimraf')
12
-
13
- var isWindows = process.platform === 'win32'
14
- var hasAccess = typeof fs.access === 'function'
15
- var winSkip = isWindows && 'windows'
16
- var accessSkip = !hasAccess && 'no fs.access function'
17
- var hasPromise = typeof Promise === 'function'
18
- var promiseSkip = !hasPromise && 'no global Promise'
19
-
20
- function reset () {
21
- delete require.cache[require.resolve('../')]
22
- return require('../')
23
- }
24
-
25
- t.test('setup fixtures', function (t) {
26
- rimraf.sync(fixture)
27
- mkdirp.sync(fixture)
28
- fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n')
29
- fs.chmodSync(meow, parseInt('0755', 8))
30
- fs.writeFileSync(fail, '#!/usr/bin/env false\n')
31
- fs.chmodSync(fail, parseInt('0644', 8))
32
- fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n')
33
- fs.chmodSync(mine, parseInt('0744', 8))
34
- fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n')
35
- fs.chmodSync(ours, parseInt('0754', 8))
36
- t.end()
37
- })
38
-
39
- t.test('promise', { skip: promiseSkip }, function (t) {
40
- var isexe = reset()
41
- t.test('meow async', function (t) {
42
- isexe(meow).then(function (is) {
43
- t.ok(is)
44
- t.end()
45
- })
46
- })
47
- t.test('fail async', function (t) {
48
- isexe(fail).then(function (is) {
49
- t.notOk(is)
50
- t.end()
51
- })
52
- })
53
- t.test('noent async', function (t) {
54
- isexe(noent).catch(function (er) {
55
- t.ok(er)
56
- t.end()
57
- })
58
- })
59
- t.test('noent ignore async', function (t) {
60
- isexe(noent, { ignoreErrors: true }).then(function (is) {
61
- t.notOk(is)
62
- t.end()
63
- })
64
- })
65
- t.end()
66
- })
67
-
68
- t.test('no promise', function (t) {
69
- global.Promise = null
70
- var isexe = reset()
71
- t.throws('try to meow a promise', function () {
72
- isexe(meow)
73
- })
74
- t.end()
75
- })
76
-
77
- t.test('access', { skip: accessSkip || winSkip }, function (t) {
78
- runTest(t)
79
- })
80
-
81
- t.test('mode', { skip: winSkip }, function (t) {
82
- delete fs.access
83
- delete fs.accessSync
84
- var isexe = reset()
85
- t.ok(isexe.sync(ours, { uid: 0, gid: 0 }))
86
- t.ok(isexe.sync(mine, { uid: 0, gid: 0 }))
87
- runTest(t)
88
- })
89
-
90
- t.test('windows', function (t) {
91
- global.TESTING_WINDOWS = true
92
- var pathExt = '.EXE;.CAT;.CMD;.COM'
93
- t.test('pathExt option', function (t) {
94
- runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' })
95
- })
96
- t.test('pathExt env', function (t) {
97
- process.env.PATHEXT = pathExt
98
- runTest(t)
99
- })
100
- t.test('no pathExt', function (t) {
101
- // with a pathExt of '', any filename is fine.
102
- // so the "fail" one would still pass.
103
- runTest(t, { pathExt: '', skipFail: true })
104
- })
105
- t.test('pathext with empty entry', function (t) {
106
- // with a pathExt of '', any filename is fine.
107
- // so the "fail" one would still pass.
108
- runTest(t, { pathExt: ';' + pathExt, skipFail: true })
109
- })
110
- t.end()
111
- })
112
-
113
- t.test('cleanup', function (t) {
114
- rimraf.sync(fixture)
115
- t.end()
116
- })
117
-
118
- function runTest (t, options) {
119
- var isexe = reset()
120
-
121
- var optionsIgnore = Object.create(options || {})
122
- optionsIgnore.ignoreErrors = true
123
-
124
- if (!options || !options.skipFail) {
125
- t.notOk(isexe.sync(fail, options))
126
- }
127
- t.notOk(isexe.sync(noent, optionsIgnore))
128
- if (!options) {
129
- t.ok(isexe.sync(meow))
130
- } else {
131
- t.ok(isexe.sync(meow, options))
132
- }
133
-
134
- t.ok(isexe.sync(mine, options))
135
- t.ok(isexe.sync(ours, options))
136
- t.throws(function () {
137
- isexe.sync(noent, options)
138
- })
139
-
140
- t.test('meow async', function (t) {
141
- if (!options) {
142
- isexe(meow, function (er, is) {
143
- if (er) {
144
- throw er
145
- }
146
- t.ok(is)
147
- t.end()
148
- })
149
- } else {
150
- isexe(meow, options, function (er, is) {
151
- if (er) {
152
- throw er
153
- }
154
- t.ok(is)
155
- t.end()
156
- })
157
- }
158
- })
159
-
160
- t.test('mine async', function (t) {
161
- isexe(mine, options, function (er, is) {
162
- if (er) {
163
- throw er
164
- }
165
- t.ok(is)
166
- t.end()
167
- })
168
- })
169
-
170
- t.test('ours async', function (t) {
171
- isexe(ours, options, function (er, is) {
172
- if (er) {
173
- throw er
174
- }
175
- t.ok(is)
176
- t.end()
177
- })
178
- })
179
-
180
- if (!options || !options.skipFail) {
181
- t.test('fail async', function (t) {
182
- isexe(fail, options, function (er, is) {
183
- if (er) {
184
- throw er
185
- }
186
- t.notOk(is)
187
- t.end()
188
- })
189
- })
190
- }
191
-
192
- t.test('noent async', function (t) {
193
- isexe(noent, options, function (er, is) {
194
- t.ok(er)
195
- t.notOk(is)
196
- t.end()
197
- })
198
- })
199
-
200
- t.test('noent ignore async', function (t) {
201
- isexe(noent, optionsIgnore, function (er, is) {
202
- if (er) {
203
- throw er
204
- }
205
- t.notOk(is)
206
- t.end()
207
- })
208
- })
209
-
210
- t.test('directory is not executable', function (t) {
211
- isexe(__dirname, options, function (er, is) {
212
- if (er) {
213
- throw er
214
- }
215
- t.notOk(is)
216
- t.end()
217
- })
218
- })
219
-
220
- t.end()
221
- }
@@ -1,42 +0,0 @@
1
- module.exports = isexe
2
- isexe.sync = sync
3
-
4
- var fs = require('fs')
5
-
6
- function checkPathExt (path, options) {
7
- var pathext = options.pathExt !== undefined ?
8
- options.pathExt : process.env.PATHEXT
9
-
10
- if (!pathext) {
11
- return true
12
- }
13
-
14
- pathext = pathext.split(';')
15
- if (pathext.indexOf('') !== -1) {
16
- return true
17
- }
18
- for (var i = 0; i < pathext.length; i++) {
19
- var p = pathext[i].toLowerCase()
20
- if (p && path.substr(-p.length).toLowerCase() === p) {
21
- return true
22
- }
23
- }
24
- return false
25
- }
26
-
27
- function checkStat (stat, path, options) {
28
- if (!stat.isSymbolicLink() && !stat.isFile()) {
29
- return false
30
- }
31
- return checkPathExt(path, options)
32
- }
33
-
34
- function isexe (path, options, cb) {
35
- fs.stat(path, function (er, stat) {
36
- cb(er, er ? false : checkStat(stat, path, options))
37
- })
38
- }
39
-
40
- function sync (path, options) {
41
- return checkStat(fs.statSync(path), path, options)
42
- }
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) Stephen Sugden <me@stephensugden.com> (stephensugden.com)
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:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
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.
@@ -1,78 +0,0 @@
1
- # merge-stream
2
-
3
- Merge (interleave) a bunch of streams.
4
-
5
- [![build status](https://secure.travis-ci.org/grncdr/merge-stream.svg?branch=master)](http://travis-ci.org/grncdr/merge-stream)
6
-
7
- ## Synopsis
8
-
9
- ```javascript
10
- var stream1 = new Stream();
11
- var stream2 = new Stream();
12
-
13
- var merged = mergeStream(stream1, stream2);
14
-
15
- var stream3 = new Stream();
16
- merged.add(stream3);
17
- merged.isEmpty();
18
- //=> false
19
- ```
20
-
21
- ## Description
22
-
23
- This is adapted from [event-stream](https://github.com/dominictarr/event-stream) separated into a new module, using Streams3.
24
-
25
- ## API
26
-
27
- ### `mergeStream`
28
-
29
- Type: `function`
30
-
31
- Merges an arbitrary number of streams. Returns a merged stream.
32
-
33
- #### `merged.add`
34
-
35
- A method to dynamically add more sources to the stream. The argument supplied to `add` can be either a source or an array of sources.
36
-
37
- #### `merged.isEmpty`
38
-
39
- A method that tells you if the merged stream is empty.
40
-
41
- When a stream is "empty" (aka. no sources were added), it could not be returned to a gulp task.
42
-
43
- So, we could do something like this:
44
-
45
- ```js
46
- stream = require('merge-stream')();
47
- // Something like a loop to add some streams to the merge stream
48
- // stream.add(streamA);
49
- // stream.add(streamB);
50
- return stream.isEmpty() ? null : stream;
51
- ```
52
-
53
- ## Gulp example
54
-
55
- An example use case for **merge-stream** is to combine parts of a task in a project's **gulpfile.js** like this:
56
-
57
- ```js
58
- const gulp = require('gulp');
59
- const htmlValidator = require('gulp-w3c-html-validator');
60
- const jsHint = require('gulp-jshint');
61
- const mergeStream = require('merge-stream');
62
-
63
- function lint() {
64
- return mergeStream(
65
- gulp.src('src/*.html')
66
- .pipe(htmlValidator())
67
- .pipe(htmlValidator.reporter()),
68
- gulp.src('src/*.js')
69
- .pipe(jsHint())
70
- .pipe(jsHint.reporter())
71
- );
72
- }
73
- gulp.task('lint', lint);
74
- ```
75
-
76
- ## License
77
-
78
- MIT
@@ -1,41 +0,0 @@
1
- 'use strict';
2
-
3
- const { PassThrough } = require('stream');
4
-
5
- module.exports = function (/*streams...*/) {
6
- var sources = []
7
- var output = new PassThrough({objectMode: true})
8
-
9
- output.setMaxListeners(0)
10
-
11
- output.add = add
12
- output.isEmpty = isEmpty
13
-
14
- output.on('unpipe', remove)
15
-
16
- Array.prototype.slice.call(arguments).forEach(add)
17
-
18
- return output
19
-
20
- function add (source) {
21
- if (Array.isArray(source)) {
22
- source.forEach(add)
23
- return this
24
- }
25
-
26
- sources.push(source);
27
- source.once('end', remove.bind(null, source))
28
- source.once('error', output.emit.bind(output, 'error'))
29
- source.pipe(output, {end: false})
30
- return this
31
- }
32
-
33
- function isEmpty () {
34
- return sources.length == 0;
35
- }
36
-
37
- function remove (source) {
38
- sources = sources.filter(function (it) { return it !== source })
39
- if (!sources.length && output.readable) { output.end() }
40
- }
41
- }
@@ -1,19 +0,0 @@
1
- {
2
- "name": "merge-stream",
3
- "version": "2.0.0",
4
- "description": "Create a stream that emits events from multiple other streams",
5
- "files": [
6
- "index.js"
7
- ],
8
- "scripts": {
9
- "test": "istanbul cover test.js && istanbul check-cover --statements 100 --branches 100"
10
- },
11
- "repository": "grncdr/merge-stream",
12
- "author": "Stephen Sugden <me@stephensugden.com>",
13
- "license": "MIT",
14
- "dependencies": {},
15
- "devDependencies": {
16
- "from2": "^2.0.3",
17
- "istanbul": "^0.4.5"
18
- }
19
- }
@@ -1,54 +0,0 @@
1
- declare const mimicFn: {
2
- /**
3
- Make a function mimic another one. It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
4
-
5
- @param to - Mimicking function.
6
- @param from - Function to mimic.
7
- @returns The modified `to` function.
8
-
9
- @example
10
- ```
11
- import mimicFn = require('mimic-fn');
12
-
13
- function foo() {}
14
- foo.unicorn = '🦄';
15
-
16
- function wrapper() {
17
- return foo();
18
- }
19
-
20
- console.log(wrapper.name);
21
- //=> 'wrapper'
22
-
23
- mimicFn(wrapper, foo);
24
-
25
- console.log(wrapper.name);
26
- //=> 'foo'
27
-
28
- console.log(wrapper.unicorn);
29
- //=> '🦄'
30
- ```
31
- */
32
- <
33
- ArgumentsType extends unknown[],
34
- ReturnType,
35
- FunctionType extends (...arguments: ArgumentsType) => ReturnType
36
- >(
37
- to: (...arguments: ArgumentsType) => ReturnType,
38
- from: FunctionType
39
- ): FunctionType;
40
-
41
- // TODO: Remove this for the next major release, refactor the whole definition to:
42
- // declare function mimicFn<
43
- // ArgumentsType extends unknown[],
44
- // ReturnType,
45
- // FunctionType extends (...arguments: ArgumentsType) => ReturnType
46
- // >(
47
- // to: (...arguments: ArgumentsType) => ReturnType,
48
- // from: FunctionType
49
- // ): FunctionType;
50
- // export = mimicFn;
51
- default: typeof mimicFn;
52
- };
53
-
54
- export = mimicFn;
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- const mimicFn = (to, from) => {
4
- for (const prop of Reflect.ownKeys(from)) {
5
- Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
6
- }
7
-
8
- return to;
9
- };
10
-
11
- module.exports = mimicFn;
12
- // TODO: Remove this for the next major release
13
- module.exports.default = mimicFn;
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
-
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:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
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,42 +0,0 @@
1
- {
2
- "name": "mimic-fn",
3
- "version": "2.1.0",
4
- "description": "Make a function mimic another one",
5
- "license": "MIT",
6
- "repository": "sindresorhus/mimic-fn",
7
- "author": {
8
- "name": "Sindre Sorhus",
9
- "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
- },
12
- "engines": {
13
- "node": ">=6"
14
- },
15
- "scripts": {
16
- "test": "xo && ava && tsd"
17
- },
18
- "files": [
19
- "index.js",
20
- "index.d.ts"
21
- ],
22
- "keywords": [
23
- "function",
24
- "mimic",
25
- "imitate",
26
- "rename",
27
- "copy",
28
- "inherit",
29
- "properties",
30
- "name",
31
- "func",
32
- "fn",
33
- "set",
34
- "infer",
35
- "change"
36
- ],
37
- "devDependencies": {
38
- "ava": "^1.4.1",
39
- "tsd": "^0.7.1",
40
- "xo": "^0.24.0"
41
- }
42
- }
@@ -1,69 +0,0 @@
1
- # mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn)
2
-
3
- > Make a function mimic another one
4
-
5
- Useful when you wrap a function in another function and like to preserve the original name and other properties.
6
-
7
-
8
- ## Install
9
-
10
- ```
11
- $ npm install mimic-fn
12
- ```
13
-
14
-
15
- ## Usage
16
-
17
- ```js
18
- const mimicFn = require('mimic-fn');
19
-
20
- function foo() {}
21
- foo.unicorn = '🦄';
22
-
23
- function wrapper() {
24
- return foo();
25
- }
26
-
27
- console.log(wrapper.name);
28
- //=> 'wrapper'
29
-
30
- mimicFn(wrapper, foo);
31
-
32
- console.log(wrapper.name);
33
- //=> 'foo'
34
-
35
- console.log(wrapper.unicorn);
36
- //=> '🦄'
37
- ```
38
-
39
-
40
- ## API
41
-
42
- It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
43
-
44
- ### mimicFn(to, from)
45
-
46
- Modifies the `to` function and returns it.
47
-
48
- #### to
49
-
50
- Type: `Function`
51
-
52
- Mimicking function.
53
-
54
- #### from
55
-
56
- Type: `Function`
57
-
58
- Function to mimic.
59
-
60
-
61
- ## Related
62
-
63
- - [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
64
- - [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties
65
-
66
-
67
- ## License
68
-
69
- MIT © [Sindre Sorhus](https://sindresorhus.com)