mocha-compat 3.6.5 → 10.8.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 (85) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +61 -110
  3. package/bin/_mocha +10 -0
  4. package/bin/mocha.js +142 -0
  5. package/browser-entry.js +61 -22
  6. package/lib/browser/highlight-tags.js +39 -0
  7. package/lib/browser/parse-query.js +24 -0
  8. package/lib/{template.html → browser/template.html} +7 -5
  9. package/lib/cli/cli.js +89 -0
  10. package/lib/cli/collect-files.js +137 -0
  11. package/lib/cli/commands.js +14 -0
  12. package/lib/cli/config.js +100 -0
  13. package/lib/cli/index.js +3 -0
  14. package/lib/cli/init.js +36 -0
  15. package/lib/cli/lookup-files.js +150 -0
  16. package/lib/cli/node-flags.js +85 -0
  17. package/lib/cli/one-and-dones.js +69 -0
  18. package/lib/cli/options.js +284 -0
  19. package/lib/cli/run-helpers.js +304 -0
  20. package/lib/cli/run-option-metadata.js +116 -0
  21. package/lib/cli/run.js +380 -0
  22. package/lib/cli/watch-run.js +377 -0
  23. package/lib/context.js +16 -42
  24. package/lib/errors.js +563 -0
  25. package/lib/hook.js +50 -9
  26. package/lib/interfaces/bdd.js +28 -29
  27. package/lib/interfaces/common.js +56 -21
  28. package/lib/interfaces/exports.js +4 -7
  29. package/lib/interfaces/qunit.js +10 -11
  30. package/lib/interfaces/tdd.js +15 -15
  31. package/lib/mocha.js +1073 -292
  32. package/lib/mocharc.json +10 -0
  33. package/lib/nodejs/buffered-worker-pool.js +188 -0
  34. package/lib/nodejs/esm-utils.js +106 -0
  35. package/lib/nodejs/file-unloader.js +15 -0
  36. package/lib/nodejs/parallel-buffered-runner.js +433 -0
  37. package/lib/nodejs/reporters/parallel-buffered.js +165 -0
  38. package/lib/nodejs/serializer.js +414 -0
  39. package/lib/nodejs/worker.js +151 -0
  40. package/lib/pending.js +3 -3
  41. package/lib/plugin-loader.js +286 -0
  42. package/lib/reporters/base.js +305 -205
  43. package/lib/reporters/doc.js +52 -21
  44. package/lib/reporters/dot.js +31 -18
  45. package/lib/reporters/html.js +153 -81
  46. package/lib/reporters/json-stream.js +53 -24
  47. package/lib/reporters/json.js +88 -18
  48. package/lib/reporters/landing.js +38 -16
  49. package/lib/reporters/list.js +34 -19
  50. package/lib/reporters/markdown.js +28 -15
  51. package/lib/reporters/min.js +22 -8
  52. package/lib/reporters/nyan.js +62 -58
  53. package/lib/reporters/progress.js +32 -19
  54. package/lib/reporters/spec.js +41 -23
  55. package/lib/reporters/tap.js +255 -32
  56. package/lib/reporters/xunit.js +89 -39
  57. package/lib/runnable.js +233 -148
  58. package/lib/runner.js +679 -380
  59. package/lib/stats-collector.js +83 -0
  60. package/lib/suite.js +376 -112
  61. package/lib/test.js +82 -21
  62. package/lib/utils.js +364 -477
  63. package/mocha.css +183 -54
  64. package/mocha.js +19319 -19984
  65. package/mocha.js.map +1 -0
  66. package/package.json +164 -332
  67. package/vendor/glob/README.md +8 -396
  68. package/vendor/glob/common.js +1 -1
  69. package/vendor/glob/glob.js +3 -1
  70. package/vendor/glob/package.json +1 -27
  71. package/vendor/glob/sync.js +1 -1
  72. package/vendor/inflight/README.md +7 -34
  73. package/vendor/inflight/package.json +1 -10
  74. package/{lib/to-iso-string → vendor/serialize-javascript}/LICENSE +8 -6
  75. package/vendor/serialize-javascript/README.md +10 -0
  76. package/vendor/serialize-javascript/index.js +349 -0
  77. package/bin/_mocha-compat +0 -572
  78. package/bin/mocha-compat +0 -87
  79. package/bin/options.js +0 -41
  80. package/lib/browser/debug.js +0 -7
  81. package/lib/browser/events.js +0 -195
  82. package/lib/browser/progress.js +0 -119
  83. package/lib/browser/tty.js +0 -13
  84. package/lib/ms.js +0 -130
  85. package/lib/to-iso-string/index.js +0 -37
@@ -1,399 +1,11 @@
1
- # Glob
1
+ # vendored glob
2
2
 
3
- Match files using the patterns the shell uses, like stars and stuff.
3
+ glob 8.1.0, byte-identical to the published tarball except that `require('inflight')` in `glob.js`
4
+ points at `../inflight/inflight.js`.
4
5
 
5
- [![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
6
+ Upstream deprecated glob 8 as unsupported, and it pulls `inflight`, which is deprecated for leaking
7
+ memory. Neither has a fix on this line: glob 9 removed the sync and callback API that
8
+ `lib/cli/lookup-files.js` uses, and mocha only escaped glob in 11. Vendoring both is what keeps the
9
+ production tree free of deprecated packages, the same way `support/3.x` does it.
6
10
 
7
- This is a glob implementation in JavaScript. It uses the `minimatch`
8
- library to do its matching.
9
-
10
- ![a fun cartoon logo made of glob characters](logo/glob.png)
11
-
12
- ## Usage
13
-
14
- Install with npm
15
-
16
- ```
17
- npm i glob
18
- ```
19
-
20
- ```javascript
21
- var glob = require("glob")
22
-
23
- // options is optional
24
- glob("**/*.js", options, function (er, files) {
25
- // files is an array of filenames.
26
- // If the `nonull` option is set, and nothing
27
- // was found, then files is ["**/*.js"]
28
- // er is an error object or null.
29
- })
30
- ```
31
-
32
- ## Glob Primer
33
-
34
- "Globs" are the patterns you type when you do stuff like `ls *.js` on
35
- the command line, or put `build/*` in a `.gitignore` file.
36
-
37
- Before parsing the path part patterns, braced sections are expanded
38
- into a set. Braced sections start with `{` and end with `}`, with any
39
- number of comma-delimited sections within. Braced sections may contain
40
- slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
41
-
42
- The following characters have special magic meaning when used in a
43
- path portion:
44
-
45
- * `*` Matches 0 or more characters in a single path portion
46
- * `?` Matches 1 character
47
- * `[...]` Matches a range of characters, similar to a RegExp range.
48
- If the first character of the range is `!` or `^` then it matches
49
- any character not in the range.
50
- * `!(pattern|pattern|pattern)` Matches anything that does not match
51
- any of the patterns provided.
52
- * `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
53
- patterns provided.
54
- * `+(pattern|pattern|pattern)` Matches one or more occurrences of the
55
- patterns provided.
56
- * `*(a|b|c)` Matches zero or more occurrences of the patterns provided
57
- * `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
58
- provided
59
- * `**` If a "globstar" is alone in a path portion, then it matches
60
- zero or more directories and subdirectories searching for matches.
61
- It does not crawl symlinked directories.
62
-
63
- ### Dots
64
-
65
- If a file or directory path portion has a `.` as the first character,
66
- then it will not match any glob pattern unless that pattern's
67
- corresponding path part also has a `.` as its first character.
68
-
69
- For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
70
- However the pattern `a/*/c` would not, because `*` does not start with
71
- a dot character.
72
-
73
- You can make glob treat dots as normal characters by setting
74
- `dot:true` in the options.
75
-
76
- ### Basename Matching
77
-
78
- If you set `matchBase:true` in the options, and the pattern has no
79
- slashes in it, then it will seek for any file anywhere in the tree
80
- with a matching basename. For example, `*.js` would match
81
- `test/simple/basic.js`.
82
-
83
- ### Empty Sets
84
-
85
- If no matching files are found, then an empty array is returned. This
86
- differs from the shell, where the pattern itself is returned. For
87
- example:
88
-
89
- $ echo a*s*d*f
90
- a*s*d*f
91
-
92
- To get the bash-style behavior, set the `nonull:true` in the options.
93
-
94
- ### See Also:
95
-
96
- * `man sh`
97
- * `man bash` (Search for "Pattern Matching")
98
- * `man 3 fnmatch`
99
- * `man 5 gitignore`
100
- * [minimatch documentation](https://github.com/isaacs/minimatch)
101
-
102
- ## glob.hasMagic(pattern, [options])
103
-
104
- Returns `true` if there are any special characters in the pattern, and
105
- `false` otherwise.
106
-
107
- Note that the options affect the results. If `noext:true` is set in
108
- the options object, then `+(a|b)` will not be considered a magic
109
- pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
110
- then that is considered magical, unless `nobrace:true` is set in the
111
- options.
112
-
113
- ## glob(pattern, [options], cb)
114
-
115
- * `pattern` `{String}` Pattern to be matched
116
- * `options` `{Object}`
117
- * `cb` `{Function}`
118
- * `err` `{Error | null}`
119
- * `matches` `{Array<String>}` filenames found matching the pattern
120
-
121
- Perform an asynchronous glob search.
122
-
123
- ## glob.sync(pattern, [options])
124
-
125
- * `pattern` `{String}` Pattern to be matched
126
- * `options` `{Object}`
127
- * return: `{Array<String>}` filenames found matching the pattern
128
-
129
- Perform a synchronous glob search.
130
-
131
- ## Class: glob.Glob
132
-
133
- Create a Glob object by instantiating the `glob.Glob` class.
134
-
135
- ```javascript
136
- var Glob = require("glob").Glob
137
- var mg = new Glob(pattern, options, cb)
138
- ```
139
-
140
- It's an EventEmitter, and starts walking the filesystem to find matches
141
- immediately.
142
-
143
- ### new glob.Glob(pattern, [options], [cb])
144
-
145
- * `pattern` `{String}` pattern to search for
146
- * `options` `{Object}`
147
- * `cb` `{Function}` Called when an error occurs, or matches are found
148
- * `err` `{Error | null}`
149
- * `matches` `{Array<String>}` filenames found matching the pattern
150
-
151
- Note that if the `sync` flag is set in the options, then matches will
152
- be immediately available on the `g.found` member.
153
-
154
- ### Properties
155
-
156
- * `minimatch` The minimatch object that the glob uses.
157
- * `options` The options object passed in.
158
- * `aborted` Boolean which is set to true when calling `abort()`. There
159
- is no way at this time to continue a glob search after aborting, but
160
- you can re-use the statCache to avoid having to duplicate syscalls.
161
- * `cache` Convenience object. Each field has the following possible
162
- values:
163
- * `false` - Path does not exist
164
- * `true` - Path exists
165
- * `'FILE'` - Path exists, and is not a directory
166
- * `'DIR'` - Path exists, and is a directory
167
- * `[file, entries, ...]` - Path exists, is a directory, and the
168
- array value is the results of `fs.readdir`
169
- * `statCache` Cache of `fs.stat` results, to prevent statting the same
170
- path multiple times.
171
- * `symlinks` A record of which paths are symbolic links, which is
172
- relevant in resolving `**` patterns.
173
- * `realpathCache` An optional object which is passed to `fs.realpath`
174
- to minimize unnecessary syscalls. It is stored on the instantiated
175
- Glob object, and may be re-used.
176
-
177
- ### Events
178
-
179
- * `end` When the matching is finished, this is emitted with all the
180
- matches found. If the `nonull` option is set, and no match was found,
181
- then the `matches` list contains the original pattern. The matches
182
- are sorted, unless the `nosort` flag is set.
183
- * `match` Every time a match is found, this is emitted with the specific
184
- thing that matched. It is not deduplicated or resolved to a realpath.
185
- * `error` Emitted when an unexpected error is encountered, or whenever
186
- any fs error occurs if `options.strict` is set.
187
- * `abort` When `abort()` is called, this event is raised.
188
-
189
- ### Methods
190
-
191
- * `pause` Temporarily stop the search
192
- * `resume` Resume the search
193
- * `abort` Stop the search forever
194
-
195
- ### Options
196
-
197
- All the options that can be passed to Minimatch can also be passed to
198
- Glob to change pattern matching behavior. Also, some have been added,
199
- or have glob-specific ramifications.
200
-
201
- All options are false by default, unless otherwise noted.
202
-
203
- All options are added to the Glob object, as well.
204
-
205
- If you are running many `glob` operations, you can pass a Glob object
206
- as the `options` argument to a subsequent operation to shortcut some
207
- `stat` and `readdir` calls. At the very least, you may pass in shared
208
- `symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
209
- parallel glob operations will be sped up by sharing information about
210
- the filesystem.
211
-
212
- * `cwd` The current working directory in which to search. Defaults
213
- to `process.cwd()`. This option is always coerced to use
214
- forward-slashes as a path separator, because it is not tested
215
- as a glob pattern, so there is no need to escape anything.
216
- * `root` The place where patterns starting with `/` will be mounted
217
- onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
218
- systems, and `C:\` or some such on Windows.) This option is
219
- always coerced to use forward-slashes as a path separator,
220
- because it is not tested as a glob pattern, so there is no need
221
- to escape anything.
222
- * `windowsPathsNoEscape` Use `\\` as a path separator _only_, and
223
- _never_ as an escape character. If set, all `\\` characters
224
- are replaced with `/` in the pattern. Note that this makes it
225
- **impossible** to match against paths containing literal glob
226
- pattern characters, but allows matching with patterns constructed
227
- using `path.join()` and `path.resolve()` on Windows platforms,
228
- mimicking the (buggy!) behavior of Glob v7 and before on
229
- Windows. Please use with caution, and be mindful of [the caveat
230
- below about Windows paths](#windows). (For legacy reasons,
231
- this is also set if `allowWindowsEscape` is set to the exact
232
- value `false`.)
233
- * `dot` Include `.dot` files in normal matches and `globstar` matches.
234
- Note that an explicit dot in a portion of the pattern will always
235
- match dot files.
236
- * `nomount` By default, a pattern starting with a forward-slash will be
237
- "mounted" onto the root setting, so that a valid filesystem path is
238
- returned. Set this flag to disable that behavior.
239
- * `mark` Add a `/` character to directory matches. Note that this
240
- requires additional stat calls.
241
- * `nosort` Don't sort the results.
242
- * `stat` Set to true to stat *all* results. This reduces performance
243
- somewhat, and is completely unnecessary, unless `readdir` is presumed
244
- to be an untrustworthy indicator of file existence.
245
- * `silent` When an unusual error is encountered when attempting to
246
- read a directory, a warning will be printed to stderr. Set the
247
- `silent` option to true to suppress these warnings.
248
- * `strict` When an unusual error is encountered when attempting to
249
- read a directory, the process will just continue on in search of
250
- other matches. Set the `strict` option to raise an error in these
251
- cases.
252
- * `cache` See `cache` property above. Pass in a previously generated
253
- cache object to save some fs calls.
254
- * `statCache` A cache of results of filesystem information, to prevent
255
- unnecessary stat calls. While it should not normally be necessary
256
- to set this, you may pass the statCache from one glob() call to the
257
- options object of another, if you know that the filesystem will not
258
- change between calls. (See "Race Conditions" below.)
259
- * `symlinks` A cache of known symbolic links. You may pass in a
260
- previously generated `symlinks` object to save `lstat` calls when
261
- resolving `**` matches.
262
- * `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
263
- * `nounique` In some cases, brace-expanded patterns can result in the
264
- same file showing up multiple times in the result set. By default,
265
- this implementation prevents duplicates in the result set. Set this
266
- flag to disable that behavior.
267
- * `nonull` Set to never return an empty set, instead returning a set
268
- containing the pattern itself. This is the default in glob(3).
269
- * `debug` Set to enable debug logging in minimatch and glob.
270
- * `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
271
- * `noglobstar` Do not match `**` against multiple filenames. (Ie,
272
- treat it as a normal `*` instead.)
273
- * `noext` Do not match `+(a|b)` "extglob" patterns.
274
- * `nocase` Perform a case-insensitive match. Note: on
275
- case-insensitive filesystems, non-magic patterns will match by
276
- default, since `stat` and `readdir` will not raise errors.
277
- * `matchBase` Perform a basename-only match if the pattern does not
278
- contain any slash characters. That is, `*.js` would be treated as
279
- equivalent to `**/*.js`, matching all js files in all directories.
280
- * `nodir` Do not match directories, only files. (Note: to match
281
- *only* directories, simply put a `/` at the end of the pattern.)
282
- * `ignore` Add a pattern or an array of glob patterns to exclude matches.
283
- Note: `ignore` patterns are *always* in `dot:true` mode, regardless
284
- of any other settings.
285
- * `follow` Follow symlinked directories when expanding `**` patterns.
286
- Note that this can result in a lot of duplicate references in the
287
- presence of cyclic links.
288
- * `realpath` Set to true to call `fs.realpath` on all of the results.
289
- In the case of a symlink that cannot be resolved, the full absolute
290
- path to the matched entry is returned (though it will usually be a
291
- broken symlink)
292
- * `absolute` Set to true to always receive absolute paths for matched
293
- files. Unlike `realpath`, this also affects the values returned in
294
- the `match` event.
295
- * `fs` File-system object with Node's `fs` API. By default, the built-in
296
- `fs` module will be used. Set to a volume provided by a library like
297
- `memfs` to avoid using the "real" file-system.
298
-
299
- ## Comparisons to other fnmatch/glob implementations
300
-
301
- While strict compliance with the existing standards is a worthwhile
302
- goal, some discrepancies exist between node-glob and other
303
- implementations, and are intentional.
304
-
305
- The double-star character `**` is supported by default, unless the
306
- `noglobstar` flag is set. This is supported in the manner of bsdglob
307
- and bash 4.3, where `**` only has special significance if it is the only
308
- thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
309
- `a/**b` will not.
310
-
311
- Note that symlinked directories are not crawled as part of a `**`,
312
- though their contents may match against subsequent portions of the
313
- pattern. This prevents infinite loops and duplicates and the like.
314
-
315
- If an escaped pattern has no matches, and the `nonull` flag is set,
316
- then glob returns the pattern as-provided, rather than
317
- interpreting the character escapes. For example,
318
- `glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
319
- `"*a?"`. This is akin to setting the `nullglob` option in bash, except
320
- that it does not resolve escaped pattern characters.
321
-
322
- If brace expansion is not disabled, then it is performed before any
323
- other interpretation of the glob pattern. Thus, a pattern like
324
- `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
325
- **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
326
- checked for validity. Since those two are valid, matching proceeds.
327
-
328
- ### Comments and Negation
329
-
330
- Previously, this module let you mark a pattern as a "comment" if it
331
- started with a `#` character, or a "negated" pattern if it started
332
- with a `!` character.
333
-
334
- These options were deprecated in version 5, and removed in version 6.
335
-
336
- To specify things that should not match, use the `ignore` option.
337
-
338
- ## Windows
339
-
340
- **Please only use forward-slashes in glob expressions.**
341
-
342
- Though windows uses either `/` or `\` as its path separator, only `/`
343
- characters are used by this glob implementation. You must use
344
- forward-slashes **only** in glob expressions. Back-slashes will always
345
- be interpreted as escape characters, not path separators.
346
-
347
- Results from absolute patterns such as `/foo/*` are mounted onto the
348
- root setting using `path.join`. On windows, this will by default result
349
- in `/foo/*` matching `C:\foo\bar.txt`.
350
-
351
- To automatically coerce all `\` characters to `/` in pattern
352
- strings, **thus making it impossible to escape literal glob
353
- characters**, you may set the `windowsPathsNoEscape` option to
354
- `true`.
355
-
356
- ## Race Conditions
357
-
358
- Glob searching, by its very nature, is susceptible to race conditions,
359
- since it relies on directory walking and such.
360
-
361
- As a result, it is possible that a file that exists when glob looks for
362
- it may have been deleted or modified by the time it returns the result.
363
-
364
- As part of its internal implementation, this program caches all stat
365
- and readdir calls that it makes, in order to cut down on system
366
- overhead. However, this also makes it even more susceptible to races,
367
- especially if the cache or statCache objects are reused between glob
368
- calls.
369
-
370
- Users are thus advised not to use a glob result as a guarantee of
371
- filesystem state in the face of rapid changes. For the vast majority
372
- of operations, this is never a problem.
373
-
374
- ## Glob Logo
375
- Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo).
376
-
377
- The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
378
-
379
- ## Contributing
380
-
381
- Any change to behavior (including bugfixes) must come with a test.
382
-
383
- Patches that fail tests or reduce performance will be rejected.
384
-
385
- ```
386
- # to run tests
387
- npm test
388
-
389
- # to re-generate test fixtures
390
- npm run test-regen
391
-
392
- # to benchmark against bash/zsh
393
- npm run bench
394
-
395
- # to profile javascript
396
- npm run prof
397
- ```
398
-
399
- ![](oh-my-glob.gif)
11
+ Regenerate with `npm pack glob@8.1.0` and re-apply the one inflight line rather than editing in place.
@@ -13,7 +13,7 @@ function ownProp (obj, field) {
13
13
  var fs = require("fs")
14
14
  var path = require("path")
15
15
  var minimatch = require("minimatch")
16
- var isAbsolute = require('is-absolute')
16
+ var isAbsolute = require("path").isAbsolute
17
17
  var Minimatch = minimatch.Minimatch
18
18
 
19
19
  function alphasort (a, b) {
@@ -42,16 +42,18 @@ module.exports = glob
42
42
 
43
43
  var rp = require('fs.realpath')
44
44
  var minimatch = require('minimatch')
45
+ var Minimatch = minimatch.Minimatch
45
46
  var inherits = require('inherits')
46
47
  var EE = require('events').EventEmitter
47
48
  var path = require('path')
48
49
  var assert = require('assert')
49
- var isAbsolute = require('is-absolute')
50
+ var isAbsolute = require('path').isAbsolute
50
51
  var globSync = require('./sync.js')
51
52
  var common = require('./common.js')
52
53
  var setopts = common.setopts
53
54
  var ownProp = common.ownProp
54
55
  var inflight = require('../inflight/inflight.js')
56
+ var util = require('util')
55
57
  var childrenIgnored = common.childrenIgnored
56
58
  var isIgnored = common.isIgnored
57
59
 
@@ -18,36 +18,10 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "fs.realpath": "^1.0.0",
21
- "inflight": "^1.0.6",
22
21
  "inherits": "2",
23
- "minimatch": "^10.0.3",
22
+ "minimatch": "^5.1.8",
24
23
  "once": "^1.4.0"
25
24
  },
26
- "devDependencies": {
27
- "memfs": "^4.17.2",
28
- "mkdirp": "3",
29
- "rimraf": "^6.0.1",
30
- "tap": "^21.1.0",
31
- "tick": "0.1.1"
32
- },
33
- "tap": {
34
- "before": "test/00-setup.js",
35
- "after": "test/zz-cleanup.js",
36
- "statements": 90,
37
- "branches": 90,
38
- "functions": 90,
39
- "lines": 90,
40
- "jobs": 1
41
- },
42
- "scripts": {
43
- "prepublish": "npm run benchclean",
44
- "profclean": "rm -f v8.log profile.txt",
45
- "test": "tap",
46
- "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
47
- "bench": "bash benchmark.sh",
48
- "prof": "bash prof.sh && cat profile.txt",
49
- "benchclean": "node benchclean.js"
50
- },
51
25
  "license": "ISC",
52
26
  "funding": {
53
27
  "url": "https://github.com/sponsors/isaacs"
@@ -8,7 +8,7 @@ var Glob = require('./glob.js').Glob
8
8
  var util = require('util')
9
9
  var path = require('path')
10
10
  var assert = require('assert')
11
- var isAbsolute = require('is-absolute')
11
+ var isAbsolute = require('path').isAbsolute
12
12
  var common = require('./common.js')
13
13
  var setopts = common.setopts
14
14
  var ownProp = common.ownProp
@@ -1,37 +1,10 @@
1
- # inflight
1
+ # vendored inflight
2
2
 
3
- Add callbacks to requests in flight to avoid async duplication
3
+ inflight 1.0.6, byte-identical to the published tarball. Reached only from `../glob/glob.js`, which
4
+ requires it by relative path.
4
5
 
5
- ## USAGE
6
+ Upstream deprecated it for leaking memory and published no successor. It is vendored rather than
7
+ installed so a consumer's production tree carries no deprecated package; see `../glob/README.md` for
8
+ why glob itself cannot simply be upgraded.
6
9
 
7
- ```javascript
8
- var inflight = require('inflight')
9
-
10
- // some request that does some stuff
11
- function req(key, callback) {
12
- // key is any random string. like a url or filename or whatever.
13
- //
14
- // will return either a falsey value, indicating that the
15
- // request for this key is already in flight, or a new callback
16
- // which when called will call all callbacks passed to inflightk
17
- // with the same key
18
- callback = inflight(key, callback)
19
-
20
- // If we got a falsey value back, then there's already a req going
21
- if (!callback) return
22
-
23
- // this is where you'd fetch the url or whatever
24
- // callback is also once()-ified, so it can safely be assigned
25
- // to multiple events etc. First call wins.
26
- setTimeout(function() {
27
- callback(null, key)
28
- }, 100)
29
- }
30
-
31
- // only assigns a single setTimeout
32
- // when it dings, all cbs get called
33
- req('foo', cb1)
34
- req('foo', cb2)
35
- req('foo', cb3)
36
- req('foo', cb4)
37
- ```
10
+ Regenerate with `npm pack inflight@1.0.6` rather than editing in place.
@@ -3,19 +3,10 @@
3
3
  "version": "1.0.6",
4
4
  "description": "Add callbacks to requests in flight to avoid async duplication",
5
5
  "main": "inflight.js",
6
- "files": [
7
- "inflight.js"
8
- ],
9
6
  "dependencies": {
10
- "once": "^1.4.0",
7
+ "once": "^1.3.0",
11
8
  "wrappy": "1"
12
9
  },
13
- "devDependencies": {
14
- "tap": "^21.1.0"
15
- },
16
- "scripts": {
17
- "test": "tap test.js --100"
18
- },
19
10
  "repository": {
20
11
  "type": "git",
21
12
  "url": "https://github.com/npm/inflight.git"
@@ -1,4 +1,6 @@
1
- Copyright (c) 2016 Segment.io, Inc. (friends@segment.com)
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Kevin Malakoff
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
6
  of this software and associated documentation files (the "Software"), to deal
@@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
9
  copies of the Software, and to permit persons to whom the Software is
8
10
  furnished to do so, subject to the following conditions:
9
11
 
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
12
14
 
13
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,10 @@
1
+ # vendored serialize-javascript
2
+
3
+ serialize-javascript 7.1.1 semantics with the UID generated via `randombytes` instead of
4
+ `crypto.getRandomValues`, which is the only reason upstream 7.1.1 declares `engines: >=20`.
5
+
6
+ Upstream 6.x — what mocha 10.8.2 depends on — carries two advisories (RCE via a spoofed
7
+ `toISOString`, RCE via `RegExp.flags`) and there is no fixed version that runs below Node 20.
8
+
9
+ Kept byte-identical to `function-exec-sync`'s `dist/cjs/serialize-javascript.js` so the two can be
10
+ diffed. Regenerate from there rather than editing in place.