Christian Matos 3 years ago
parent
commit
35195f1065
100 changed files with 5676 additions and 5 deletions
  1. 2
    5
      config.xml
  2. 1
    0
      node_modules/.bin/ios-sim
  3. 1
    0
      node_modules/.bin/uuid
  4. 41
    0
      node_modules/@netflix/nerror/CHANGELOG.md
  5. 21
    0
      node_modules/@netflix/nerror/LICENSE
  6. 339
    0
      node_modules/@netflix/nerror/README.md
  7. 67
    0
      node_modules/@netflix/nerror/lib/index.d.ts
  8. 3
    0
      node_modules/@netflix/nerror/lib/index.js
  9. 813
    0
      node_modules/@netflix/nerror/lib/verror.js
  10. 77
    0
      node_modules/@netflix/nerror/package.json
  11. 21
    0
      node_modules/@nodelib/fs.scandir/LICENSE
  12. 171
    0
      node_modules/@nodelib/fs.scandir/README.md
  13. 13
    0
      node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts
  14. 18
    0
      node_modules/@nodelib/fs.scandir/out/adapters/fs.js
  15. 5
    0
      node_modules/@nodelib/fs.scandir/out/constants.d.ts
  16. 13
    0
      node_modules/@nodelib/fs.scandir/out/constants.js
  17. 13
    0
      node_modules/@nodelib/fs.scandir/out/index.d.ts
  18. 24
    0
      node_modules/@nodelib/fs.scandir/out/index.js
  19. 8
    0
      node_modules/@nodelib/fs.scandir/out/providers/async.d.ts
  20. 90
    0
      node_modules/@nodelib/fs.scandir/out/providers/async.js
  21. 6
    0
      node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts
  22. 52
    0
      node_modules/@nodelib/fs.scandir/out/providers/sync.js
  23. 21
    0
      node_modules/@nodelib/fs.scandir/out/settings.d.ts
  24. 24
    0
      node_modules/@nodelib/fs.scandir/out/settings.js
  25. 20
    0
      node_modules/@nodelib/fs.scandir/out/types/index.d.ts
  26. 2
    0
      node_modules/@nodelib/fs.scandir/out/types/index.js
  27. 3
    0
      node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts
  28. 18
    0
      node_modules/@nodelib/fs.scandir/out/utils/fs.js
  29. 3
    0
      node_modules/@nodelib/fs.scandir/out/utils/index.d.ts
  30. 4
    0
      node_modules/@nodelib/fs.scandir/out/utils/index.js
  31. 64
    0
      node_modules/@nodelib/fs.scandir/package.json
  32. 21
    0
      node_modules/@nodelib/fs.stat/LICENSE
  33. 126
    0
      node_modules/@nodelib/fs.stat/README.md
  34. 11
    0
      node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts
  35. 16
    0
      node_modules/@nodelib/fs.stat/out/adapters/fs.js
  36. 13
    0
      node_modules/@nodelib/fs.stat/out/index.d.ts
  37. 24
    0
      node_modules/@nodelib/fs.stat/out/index.js
  38. 5
    0
      node_modules/@nodelib/fs.stat/out/providers/async.d.ts
  39. 31
    0
      node_modules/@nodelib/fs.stat/out/providers/async.js
  40. 4
    0
      node_modules/@nodelib/fs.stat/out/providers/sync.d.ts
  41. 22
    0
      node_modules/@nodelib/fs.stat/out/providers/sync.js
  42. 17
    0
      node_modules/@nodelib/fs.stat/out/settings.d.ts
  43. 16
    0
      node_modules/@nodelib/fs.stat/out/settings.js
  44. 5
    0
      node_modules/@nodelib/fs.stat/out/types/index.d.ts
  45. 2
    0
      node_modules/@nodelib/fs.stat/out/types/index.js
  46. 59
    0
      node_modules/@nodelib/fs.stat/package.json
  47. 21
    0
      node_modules/@nodelib/fs.walk/LICENSE
  48. 215
    0
      node_modules/@nodelib/fs.walk/README.md
  49. 15
    0
      node_modules/@nodelib/fs.walk/out/index.d.ts
  50. 32
    0
      node_modules/@nodelib/fs.walk/out/index.js
  51. 13
    0
      node_modules/@nodelib/fs.walk/out/providers/async.d.ts
  52. 30
    0
      node_modules/@nodelib/fs.walk/out/providers/async.js
  53. 5
    0
      node_modules/@nodelib/fs.walk/out/providers/index.d.ts
  54. 8
    0
      node_modules/@nodelib/fs.walk/out/providers/index.js
  55. 13
    0
      node_modules/@nodelib/fs.walk/out/providers/stream.d.ts
  56. 30
    0
      node_modules/@nodelib/fs.walk/out/providers/stream.js
  57. 11
    0
      node_modules/@nodelib/fs.walk/out/providers/sync.d.ts
  58. 14
    0
      node_modules/@nodelib/fs.walk/out/providers/sync.js
  59. 30
    0
      node_modules/@nodelib/fs.walk/out/readers/async.d.ts
  60. 93
    0
      node_modules/@nodelib/fs.walk/out/readers/async.js
  61. 7
    0
      node_modules/@nodelib/fs.walk/out/readers/common.d.ts
  62. 24
    0
      node_modules/@nodelib/fs.walk/out/readers/common.js
  63. 7
    0
      node_modules/@nodelib/fs.walk/out/readers/reader.d.ts
  64. 11
    0
      node_modules/@nodelib/fs.walk/out/readers/reader.js
  65. 16
    0
      node_modules/@nodelib/fs.walk/out/readers/sync.d.ts
  66. 59
    0
      node_modules/@nodelib/fs.walk/out/readers/sync.js
  67. 31
    0
      node_modules/@nodelib/fs.walk/out/settings.d.ts
  68. 26
    0
      node_modules/@nodelib/fs.walk/out/settings.js
  69. 9
    0
      node_modules/@nodelib/fs.walk/out/types/index.d.ts
  70. 2
    0
      node_modules/@nodelib/fs.walk/out/types/index.js
  71. 64
    0
      node_modules/@nodelib/fs.walk/package.json
  72. 6
    0
      node_modules/assert-plus/AUTHORS
  73. 14
    0
      node_modules/assert-plus/CHANGES.md
  74. 162
    0
      node_modules/assert-plus/README.md
  75. 211
    0
      node_modules/assert-plus/assert.js
  76. 82
    0
      node_modules/assert-plus/package.json
  77. 6
    0
      node_modules/at-least-node/LICENSE
  78. 25
    0
      node_modules/at-least-node/README.md
  79. 5
    0
      node_modules/at-least-node/index.js
  80. 60
    0
      node_modules/at-least-node/package.json
  81. 18
    0
      node_modules/bplist-creator/LICENSE
  82. 64
    0
      node_modules/bplist-creator/README.md
  83. 456
    0
      node_modules/bplist-creator/bplistCreator.js
  84. 59
    0
      node_modules/bplist-creator/package.json
  85. BIN
      node_modules/bplist-creator/test/airplay.bplist
  86. BIN
      node_modules/bplist-creator/test/binaryData.bplist
  87. 197
    0
      node_modules/bplist-creator/test/creatorTest.js
  88. BIN
      node_modules/bplist-creator/test/iTunes-small.bplist
  89. BIN
      node_modules/bplist-creator/test/sample1.bplist
  90. BIN
      node_modules/bplist-creator/test/sample2.bplist
  91. BIN
      node_modules/bplist-creator/test/uid.bplist
  92. BIN
      node_modules/bplist-creator/test/utf16.bplist
  93. 184
    0
      node_modules/braces/CHANGELOG.md
  94. 21
    0
      node_modules/braces/LICENSE
  95. 593
    0
      node_modules/braces/README.md
  96. 170
    0
      node_modules/braces/index.js
  97. 57
    0
      node_modules/braces/lib/compile.js
  98. 57
    0
      node_modules/braces/lib/constants.js
  99. 113
    0
      node_modules/braces/lib/expand.js
  100. 0
    0
      node_modules/braces/lib/parse.js

+ 2
- 5
config.xml View File

@@ -8,19 +8,16 @@
8 8
         Apache Cordova Team
9 9
     </author>
10 10
     <content src="index.html" />
11
-    <plugin name="cordova-plugin-whitelist" spec="1" />
12 11
     <access origin="*" />
13 12
     <allow-intent href="http://*/*" />
14 13
     <allow-intent href="https://*/*" />
15 14
     <allow-intent href="tel:*" />
16 15
     <allow-intent href="sms:*" />
16
+    <allow-intent href="file://*"/>
17 17
     <allow-intent href="mailto:*" />
18 18
     <allow-intent href="geo:*" />
19 19
     <platform name="android">
20 20
         <allow-intent href="market:*" />
21 21
     </platform>
22
-    <platform name="ios">
23
-        <allow-intent href="itms:*" />
24
-        <allow-intent href="itms-apps:*" />
25
-    </platform>
22
+
26 23
 </widget>

+ 1
- 0
node_modules/.bin/ios-sim View File

@@ -0,0 +1 @@
1
+../ios-sim/bin/ios-sim

+ 1
- 0
node_modules/.bin/uuid View File

@@ -0,0 +1 @@
1
+../uuid/dist/bin/uuid

+ 41
- 0
node_modules/@netflix/nerror/CHANGELOG.md View File

@@ -0,0 +1,41 @@
1
+<a name="1.1.3"></a>
2
+### 1.1.3 (2019-11-27)
3
+
4
+
5
+#### Bug Fixes
6
+
7
+* **nerror:**  don't call extsprintf if single string passed to VError constructor (#11) ([89b2088b](https://github.com/Netflix/nerror/commit/89b2088b))
8
+
9
+
10
+<a name="1.1.2"></a>
11
+### 1.1.2 (2019-07-26)
12
+
13
+
14
+<a name="1.1.1"></a>
15
+### 1.1.1 (2019-07-09)
16
+
17
+
18
+<a name="1.1.0"></a>
19
+## 1.1.0 (2019-05-06)
20
+
21
+
22
+#### Features
23
+
24
+* **errorForEach:** make it MultiError support more general (#2) ([96cc8769](https://github.com/Netflix/nerror/commit/96cc8769))
25
+
26
+
27
+<a name="1.0.0"></a>
28
+## 1.0.0 (2019-05-02)
29
+
30
+
31
+#### Features
32
+
33
+* **nerror:** initial commit ([c959d4fc](https://github.com/Netflix/nerror/commit/c959d4fc))
34
+
35
+
36
+#### Breaking Changes
37
+
38
+* initial release
39
+
40
+ ([6ae8bd30](https://github.com/Netflix/nerror/commit/6ae8bd30))
41
+

+ 21
- 0
node_modules/@netflix/nerror/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2019, AUTHORS. All rights reserved.
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

+ 339
- 0
node_modules/@netflix/nerror/README.md View File

@@ -0,0 +1,339 @@
1
+# nerror: rich JavaScript errors
2
+
3
+[![Build Status](https://travis-ci.org/Netflix/nerror.svg?branch=master)](https://travis-ci.org/Netflix/nerror)
4
+
5
+*Netflix services uses [VError](https://github.com/joyent/node-verror) to make
6
+operation of Node.js applications easier  through meaningful error chains.
7
+VError is an amazing library by Joyent and we  are glad for all the hard work
8
+for the contributors made during the years.
9
+In early 2019 Netflix error handling requirements started to broaden enough that
10
+we had to find a way to make quick iterations on VError with minimizing the
11
+churn on existing VError customers. As a result of this we decided to fork
12
+VError as NError. We hope in the future after the initial development period we
13
+can seek convergence between the two projects.*
14
+
15
+This module provides several classes in support of Joyent's [Best Practices for
16
+Error Handling in Node.js](http://www.joyent.com/developers/node/design/errors).
17
+If you find any of the behavior here confusing or surprising, check out that
18
+document first.
19
+
20
+## API
21
+
22
+See [API](/api.md)
23
+
24
+## Classes
25
+
26
+The error classes here support:
27
+
28
+* printf-style arguments for the message
29
+* chains of causes
30
+* properties to provide extra information about the error
31
+* creating your own subclasses that support all of these
32
+
33
+The classes here are:
34
+
35
+* **VError**, for chaining errors while preserving each one's error message.
36
+  This is useful in servers and command-line utilities when you want to
37
+  propagate an error up a call stack, but allow various levels to add their own
38
+  context.  See examples below.
39
+* **WError**, for wrapping errors while hiding the lower-level messages from the
40
+  top-level error.  This is useful for API endpoints where you don't want to
41
+  expose internal error messages, but you still want to preserve the error chain
42
+  for logging and debugging.
43
+* **PError**, which is just like VError but does not interpret printf-style
44
+  arguments at all.
45
+* **SError**, which is just like VError but interprets printf-style arguments
46
+  more strictly.
47
+* **MultiError**, which is just an Error that encapsulates one or more other
48
+  errors.  (This is used for parallel operations that return several errors.)
49
+
50
+For the full list of features see [API](/api.md).
51
+
52
+## Quick start
53
+
54
+First, install the package:
55
+
56
+    npm install @netflix/nerror
57
+
58
+If nothing else, you can use VError as a drop-in replacement for the built-in
59
+JavaScript Error class, with the addition of printf-style messages:
60
+
61
+```javascript
62
+const { VError } = require('@netflix/nerror');
63
+const err = new VError('missing file: "%s"', '/etc/passwd');
64
+console.log(err.message);
65
+```
66
+
67
+This prints:
68
+
69
+    missing file: "/etc/passwd"
70
+
71
+You can also pass a `cause` argument, which is any other Error object:
72
+
73
+```javascript
74
+const fs = require('fs');
75
+const filename = '/nonexistent';
76
+fs.stat(filename, function (err1) {
77
+	const err2 = new VError(err1, 'stat "%s"', filename);
78
+	console.error(err2.message);
79
+});
80
+```
81
+
82
+This prints out:
83
+
84
+    stat "/nonexistent": ENOENT, stat '/nonexistent'
85
+
86
+which resembles how Unix programs typically report errors:
87
+
88
+    $ sort /nonexistent
89
+    sort: open failed: /nonexistent: No such file or directory
90
+
91
+To match the Unixy feel, when you print out the error, just prepend the
92
+program's name to the VError's `message`.  Or just call
93
+[node-cmdutil.fail(your_verror)](https://github.com/joyent/node-cmdutil), which
94
+does this for you.
95
+
96
+You can get the next-level Error using `err.cause()`:
97
+
98
+```javascript
99
+console.error(err2.cause().message);
100
+```
101
+
102
+prints:
103
+
104
+    ENOENT, stat '/nonexistent'
105
+
106
+Of course, you can chain these as many times as you want, and it works with any
107
+kind of Error:
108
+
109
+```javascript
110
+const err1 = new Error('No such file or directory');
111
+const err2 = new VError(err1, 'failed to stat "%s"', '/junk');
112
+const err3 = new VError(err2, 'request failed');
113
+console.error(err3.message);
114
+```
115
+
116
+This prints:
117
+
118
+    request failed: failed to stat "/junk": No such file or directory
119
+
120
+The idea is that each layer in the stack annotates the error with a description
121
+of what it was doing.  The end result is a message that explains what happened
122
+at each level.
123
+
124
+You can also decorate Error objects with additional information so that callers
125
+can not only handle each kind of error differently, but also construct their own
126
+error messages (e.g., to localize them, format them, group them by type, and so
127
+on).  See the example below.
128
+
129
+
130
+## Deeper dive
131
+
132
+The two main goals for VError are:
133
+
134
+* **Make it easy to construct clear, complete error messages intended for
135
+  people.**  Clear error messages greatly improve both user experience and
136
+  debuggability, so we wanted to make it easy to build them.  That's why the
137
+  constructor takes printf-style arguments.
138
+* **Make it easy to construct objects with programmatically-accessible
139
+  metadata** (which we call _informational properties_).  Instead of just saying
140
+  "connection refused while connecting to 192.168.1.2:80", you can add
141
+  properties like `"ip": "192.168.1.2"` and `"tcpPort": 80`.  This can be used
142
+  for feeding into monitoring systems, analyzing large numbers of Errors (as
143
+  from a log file), or localizing error messages.
144
+
145
+To really make this useful, it also needs to be easy to compose Errors:
146
+higher-level code should be able to augment the Errors reported by lower-level
147
+code to provide a more complete description of what happened.  Instead of saying
148
+"connection refused", you can say "operation X failed: connection refused".
149
+That's why VError supports `causes`.
150
+
151
+In order for all this to work, programmers need to know that it's generally safe
152
+to wrap lower-level Errors with higher-level ones.  If you have existing code
153
+that handles Errors produced by a library, you should be able to wrap those
154
+Errors with a VError to add information without breaking the error handling
155
+code.  There are two obvious ways that this could break such consumers:
156
+
157
+* The error's name might change.  People typically use `name` to determine what
158
+  kind of Error they've got.  To ensure compatibility, you can create VErrors
159
+  with custom names, but this approach isn't great because it prevents you from
160
+  representing complex failures.  For this reason, VError provides
161
+  `findCauseByName`, which essentially asks: does this Error _or any of its
162
+  causes_ have this specific type?  If error handling code uses
163
+  `findCauseByName`, then subsystems can construct very specific causal chains
164
+  for debuggability and still let people handle simple cases easily.  There's an
165
+  example below.
166
+* The error's properties might change.  People often hang additional properties
167
+  off of Error objects.  If we wrap an existing Error in a new Error, those
168
+  properties would be lost unless we copied them.  But there are a variety of
169
+  both standard and non-standard Error properties that should _not_ be copied in
170
+  this way: most obviously `name`, `message`, and `stack`, but also `fileName`,
171
+  `lineNumber`, and a few others.  Plus, it's useful for some Error subclasses
172
+  to have their own private properties -- and there'd be no way to know whether
173
+  these should be copied.  For these reasons, VError first-classes these
174
+  information properties.  You have to provide them in the constructor, you can
175
+  only fetch them with the `info()` function, and VError takes care of making
176
+  sure properties from causes wind up in the `info()` output.
177
+
178
+Let's put this all together with an example from the node-fast RPC library.
179
+node-fast implements a simple RPC protocol for Node programs.  There's a server
180
+and client interface, and clients make RPC requests to servers.  Let's say the
181
+server fails with an UnauthorizedError with message "user 'bob' is not
182
+authorized".  The client wraps all server errors with a FastServerError.  The
183
+client also wraps all request errors with a FastRequestError that includes the
184
+name of the RPC call being made.  The result of this failed RPC might look like
185
+this:
186
+
187
+    name: FastRequestError
188
+    message: "request failed: server error: user 'bob' is not authorized"
189
+    rpcMsgid: <unique identifier for this request>
190
+    rpcMethod: GetObject
191
+    cause:
192
+        name: FastServerError
193
+        message: "server error: user 'bob' is not authorized"
194
+        cause:
195
+            name: UnauthorizedError
196
+            message: "user 'bob' is not authorized"
197
+            rpcUser: "bob"
198
+
199
+When the caller uses `VError.info()`, the information properties are collapsed
200
+so that it looks like this:
201
+
202
+    message: "request failed: server error: user 'bob' is not authorized"
203
+    rpcMsgid: <unique identifier for this request>
204
+    rpcMethod: GetObject
205
+    rpcUser: "bob"
206
+
207
+Taking this apart:
208
+
209
+* The error's message is a complete description of the problem.  The caller can
210
+  report this directly to its caller, which can potentially make its way back to
211
+  an end user (if appropriate).  It can also be logged.
212
+* The caller can tell that the request failed on the server, rather than as a
213
+  result of a client problem (e.g., failure to serialize the request), a
214
+  transport problem (e.g., failure to connect to the server), or something else
215
+  (e.g., a timeout).  They do this using `findCauseByName('FastServerError')`
216
+  rather than checking the `name` field directly.
217
+* If the caller logs this error, the logs can be analyzed to aggregate
218
+  errors by cause, by RPC method name, by user, or whatever.  Or the
219
+  error can be correlated with other events for the same rpcMsgid.
220
+* It wasn't very hard for any part of the code to contribute to this Error.
221
+  Each part of the stack has just a few lines to provide exactly what it knows,
222
+  with very little boilerplate.
223
+
224
+It's not expected that you'd use these complex forms all the time.  Despite
225
+supporting the complex case above, you can still just do:
226
+
227
+   new VError("my service isn't working");
228
+
229
+for the simple cases.
230
+
231
+
232
+## Examples
233
+
234
+The "Demo" section above covers several basic cases.  Here's a more advanced
235
+case:
236
+
237
+```javascript
238
+const err1 = new VError('something bad happened');
239
+/* ... */
240
+const err2 = new VError({
241
+    'name': 'ConnectionError',
242
+    'cause': err1,
243
+    'info': {
244
+        'errno': 'ECONNREFUSED',
245
+        'remote_ip': '127.0.0.1',
246
+        'port': 215
247
+    }
248
+}, 'failed to connect to "%s:%d"', '127.0.0.1', 215);
249
+
250
+console.log(err2.message);
251
+console.log(err2.name);
252
+console.log(VError.info(err2));
253
+console.log(err2.stack);
254
+```
255
+
256
+This outputs:
257
+
258
+    failed to connect to "127.0.0.1:215": something bad happened
259
+    ConnectionError
260
+    { errno: 'ECONNREFUSED', remote_ip: '127.0.0.1', port: 215 }
261
+    ConnectionError: failed to connect to "127.0.0.1:215": something bad happened
262
+        at Object.<anonymous> (/home/dap/node-verror/examples/info.js:5:12)
263
+        at Module._compile (module.js:456:26)
264
+        at Object.Module._extensions..js (module.js:474:10)
265
+        at Module.load (module.js:356:32)
266
+        at Function.Module._load (module.js:312:12)
267
+        at Function.Module.runMain (module.js:497:10)
268
+        at startup (node.js:119:16)
269
+        at node.js:935:3
270
+
271
+Information properties are inherited up the cause chain, with values at the top
272
+of the chain overriding same-named values lower in the chain.  To continue that
273
+example:
274
+
275
+```javascript
276
+const err3 = new VError({
277
+    'name': 'RequestError',
278
+    'cause': err2,
279
+    'info': {
280
+        'errno': 'EBADREQUEST'
281
+    }
282
+}, 'request failed');
283
+
284
+console.log(err3.message);
285
+console.log(err3.name);
286
+console.log(VError.info(err3));
287
+console.log(err3.stack);
288
+```
289
+
290
+This outputs:
291
+
292
+    request failed: failed to connect to "127.0.0.1:215": something bad happened
293
+    RequestError
294
+    { errno: 'EBADREQUEST', remote_ip: '127.0.0.1', port: 215 }
295
+    RequestError: request failed: failed to connect to "127.0.0.1:215": something bad happened
296
+        at Object.<anonymous> (/home/dap/node-verror/examples/info.js:20:12)
297
+        at Module._compile (module.js:456:26)
298
+        at Object.Module._extensions..js (module.js:474:10)
299
+        at Module.load (module.js:356:32)
300
+        at Function.Module._load (module.js:312:12)
301
+        at Function.Module.runMain (module.js:497:10)
302
+        at startup (node.js:119:16)
303
+        at node.js:935:3
304
+
305
+You can also print the complete stack trace of combined `Error`s by using
306
+`VError.fullStack(err).`
307
+
308
+```javascript
309
+const err1 = new VError('something bad happened');
310
+/* ... */
311
+const err2 = new VError(err1, 'something really bad happened here');
312
+
313
+console.log(VError.fullStack(err2));
314
+```
315
+
316
+This outputs:
317
+
318
+    VError: something really bad happened here: something bad happened
319
+        at Object.<anonymous> (/home/dap/node-verror/examples/fullStack.js:5:12)
320
+        at Module._compile (module.js:409:26)
321
+        at Object.Module._extensions..js (module.js:416:10)
322
+        at Module.load (module.js:343:32)
323
+        at Function.Module._load (module.js:300:12)
324
+        at Function.Module.runMain (module.js:441:10)
325
+        at startup (node.js:139:18)
326
+        at node.js:968:3
327
+    caused by: VError: something bad happened
328
+        at Object.<anonymous> (/home/dap/node-verror/examples/fullStack.js:3:12)
329
+        at Module._compile (module.js:409:26)
330
+        at Object.Module._extensions..js (module.js:416:10)
331
+        at Module.load (module.js:343:32)
332
+        at Function.Module._load (module.js:300:12)
333
+        at Function.Module.runMain (module.js:441:10)
334
+        at startup (node.js:139:18)
335
+        at node.js:968:3
336
+
337
+`VError.fullStack` is also safe to use on regular `Error`s, so feel free to use
338
+it whenever you need to extract the stack trace from an `Error`, regardless if
339
+it's a `VError` or not.

+ 67
- 0
node_modules/@netflix/nerror/lib/index.d.ts View File

@@ -0,0 +1,67 @@
1
+export class VError extends Error {
2
+    static VError: typeof VError;
3
+
4
+    static cause(err: Error): Error | null;
5
+    static info(err: Error): VError.Info;
6
+    static fullStack(err: Error): string;
7
+    static findCauseByName(err: Error, name: string): Error | null;
8
+    static hasCauseWithName(err: Error, name: string): boolean;
9
+    static errorFromList<T extends Error>(
10
+        errors: T[]
11
+    ): null | T | VError.MultiError;
12
+    static errorForEach(err: Error, func: (err: Error) => void): void;
13
+
14
+    cause(): Error | undefined;
15
+    constructor(
16
+        options: VError.Options | Error,
17
+        message: string,
18
+        ...params: any[]
19
+    );
20
+    constructor(message?: string, ...params: any[]);
21
+}
22
+
23
+export namespace VError {
24
+    interface Info {
25
+        [key: string]: any;
26
+    }
27
+
28
+    interface Options {
29
+        cause?: Error | null;
30
+        name?: string;
31
+        strict?: boolean;
32
+        constructorOpt?(...args: any[]): void;
33
+        info?: Info;
34
+    }
35
+
36
+    /*
37
+     * SError is like VError, but stricter about types.  You cannot pass "null" or
38
+     * "undefined" as string arguments to the formatter.  Since SError is only a
39
+     * different function, not really a different class, we don't set
40
+     * SError.prototype.name.
41
+     */
42
+    class SError extends VError {}
43
+
44
+    /*
45
+     * PError is like VError, but the message is not run through printf-style
46
+     * templating.
47
+     */
48
+    class PError extends VError {}
49
+
50
+    /*
51
+     * Represents a collection of errors for the purpose of consumers that generally
52
+     * only deal with one error.  Callers can extract the individual errors
53
+     * contained in this object, but may also just treat it as a normal single
54
+     * error, in which case a summary message will be printed.
55
+     */
56
+    class MultiError extends VError {
57
+        constructor(errors: Error[]);
58
+        errors(): Error[];
59
+    }
60
+
61
+    /*
62
+     * Like JavaScript's built-in Error class, but supports a "cause" argument which
63
+     * is wrapped, not "folded in" as with VError.	Accepts a printf-style message.
64
+     * The cause argument can be null.
65
+     */
66
+    class WError extends VError {}
67
+}

+ 3
- 0
node_modules/@netflix/nerror/lib/index.js View File

@@ -0,0 +1,3 @@
1
+'use strict';
2
+
3
+module.exports = require('./verror');

+ 813
- 0
node_modules/@netflix/nerror/lib/verror.js View File

@@ -0,0 +1,813 @@
1
+'use strict';
2
+
3
+/*
4
+ * verror.js: richer JavaScript errors
5
+ */
6
+const util = require('util');
7
+
8
+const _ = require('lodash');
9
+const assert = require('assert-plus');
10
+const { sprintf } = require('extsprintf');
11
+
12
+/*
13
+ * Public interface
14
+ */
15
+
16
+/* So you can 'var VError = require('@netflix/nerror')' */
17
+module.exports = VError;
18
+/* For compatibility */
19
+VError.VError = VError;
20
+/* Other exported classes */
21
+VError.PError = PError;
22
+VError.SError = SError;
23
+VError.WError = WError;
24
+VError.MultiError = MultiError;
25
+
26
+/**
27
+ * Normalized forms, producing an object with the following properties.
28
+ * @private
29
+ * @typedef {Object} ParsedOptions parsed Options
30
+ * @param {Object} options e- quivalent to "options" in third form. This will
31
+ *              never
32
+ *    			be a direct reference to what the caller passed in
33
+ *    			(i.e., it may be a shallow copy), so it can be freely
34
+ *    			modified.
35
+ * @param {String} shortmessage - result of sprintf(sprintf_args), taking
36
+ *              `options.strict` into account as described in README.md.
37
+ */
38
+
39
+/**
40
+ * Common function used to parse constructor arguments for VError, WError, and
41
+ * SError.  Named arguments to this function:
42
+ *
43
+ *     strict		force strict interpretation of sprintf arguments, even
44
+ *     			if the options in "argv" don't say so
45
+ *
46
+ *     argv		error's constructor arguments, which are to be
47
+ *     			interpreted as described in README.md.  For quick
48
+ *     			reference, "argv" has one of the following forms:
49
+ *
50
+ *          [ sprintf_args... ]           (argv[0] is a string)
51
+ *          [ cause, sprintf_args... ]    (argv[0] is an Error)
52
+ *          [ options, sprintf_args... ]  (argv[0] is an object)
53
+ *
54
+
55
+ * @private
56
+ * @param {Array} args - arguments
57
+ * @returns {ParsedOptions} parsed options
58
+ */
59
+function parseConstructorArguments(args) {
60
+    let options, sprintf_args, shortmessage, k;
61
+
62
+    assert.object(args, 'args');
63
+    assert.bool(args.strict, 'args.strict');
64
+    assert.array(args.argv, 'args.argv');
65
+    assert.optionalBool(args.skipPrintf, 'args.skipPrintf');
66
+    const argv = args.argv;
67
+
68
+    /*
69
+     * First, figure out which form of invocation we've been given.
70
+     */
71
+    if (argv.length === 0) {
72
+        options = {};
73
+        sprintf_args = [];
74
+    } else if (_.isError(argv[0])) {
75
+        options = { cause: argv[0] };
76
+        sprintf_args = argv.slice(1);
77
+    } else if (typeof argv[0] === 'object') {
78
+        options = {};
79
+        // eslint-disable-next-line guard-for-in
80
+        for (k in argv[0]) {
81
+            options[k] = argv[0][k];
82
+        }
83
+        sprintf_args = argv.slice(1);
84
+    } else {
85
+        assert.string(
86
+            argv[0],
87
+            'first argument to VError, PError, SError, or WError ' +
88
+                'constructor must be a string, object, or Error'
89
+        );
90
+        options = {};
91
+        sprintf_args = argv;
92
+    }
93
+
94
+    // Preserve options
95
+    if (args.skipPrintf) {
96
+        options.skipPrintf = args.skipPrintf;
97
+    }
98
+    if (args.strict) {
99
+        options.strict = args.strict;
100
+    }
101
+
102
+    /*
103
+     * Now construct the error's message.
104
+     *
105
+     * extsprintf (which we invoke here with our caller's arguments in order
106
+     * to construct this Error's message) is strict in its interpretation of
107
+     * values to be processed by the "%s" specifier.  The value passed to
108
+     * extsprintf must actually be a string or something convertible to a
109
+     * String using .toString().  Passing other values (notably "null" and
110
+     * "undefined") is considered a programmer error.  The assumption is
111
+     * that if you actually want to print the string "null" or "undefined",
112
+     * then that's easy to do that when you're calling extsprintf; on the
113
+     * other hand, if you did NOT want that (i.e., there's actually a bug
114
+     * where the program assumes some variable is non-null and tries to
115
+     * print it, which might happen when constructing a packet or file in
116
+     * some specific format), then it's better to stop immediately than
117
+     * produce bogus output.
118
+     *
119
+     * However, sometimes the bug is only in the code calling VError, and a
120
+     * programmer might prefer to have the error message contain "null" or
121
+     * "undefined" rather than have the bug in the error path crash the
122
+     * program (making the first bug harder to identify).  For that reason,
123
+     * by default VError converts "null" or "undefined" arguments to their
124
+     * string representations and passes those to extsprintf.  Programmers
125
+     * desiring the strict behavior can use the SError class or pass the
126
+     * "strict" option to the VError constructor.
127
+     */
128
+    assert.object(options);
129
+    if (!options.skipPrintf && !options.strict && !args.strict) {
130
+        sprintf_args = sprintf_args.map(function(a) {
131
+            return a === null ? 'null' : a === undefined ? 'undefined' : a;
132
+        });
133
+    }
134
+
135
+    if (sprintf_args.length === 0) {
136
+        shortmessage = '';
137
+    } else if (
138
+        options.skipPrintf ||
139
+        (sprintf_args.length === 1 && typeof sprintf_args[0] === 'string')
140
+    ) {
141
+        assert.equal(
142
+            sprintf_args.length,
143
+            1,
144
+            'only one argument is allowed with options.skipPrintf'
145
+        );
146
+        shortmessage = sprintf_args[0];
147
+    } else {
148
+        shortmessage = sprintf.apply(null, sprintf_args);
149
+    }
150
+
151
+    return {
152
+        options: options,
153
+        shortmessage: shortmessage
154
+    };
155
+}
156
+
157
+/**
158
+ * @public
159
+ * @typedef {Object} VErrorOptions Options
160
+ * @param {String} name - Name of the error.
161
+ * @param {Error} [cause] -  Indicates that the new error was caused by `cause`.
162
+ * @param {Boolean} [strict=false] - If true, then `null` and `undefined` values
163
+ *  in `sprintf_args` are passed through to `sprintf()`
164
+ * @param {Function} [constructorOpt] -If specified, then the stack trace for
165
+ *  this error ends at function `constructorOpt`.
166
+ * @param {Object} [info]- Specifies arbitrary informational properties.
167
+ * @param {Boolean} [skipPrintf=false] - If true, then `sprintf()` is not called
168
+ */
169
+
170
+/**
171
+ *
172
+ * About Constructor:
173
+ * All of these forms construct a new VError that behaves just like the built-in
174
+ * JavaScript `Error` class, with some additional methods described below.
175
+ *
176
+ * About Properties:
177
+ * For all of these classes except `PError`, the printf-style arguments passed to
178
+ * the constructor are processed with `sprintf()` to form a message.
179
+ * For `WError`, this becomes the complete `message` property.  For `SError` and
180
+ * `VError`, this message is prepended to the message of the cause, if any
181
+ * (with a suitable separator), and the result becomes the `message` property.
182
+ *
183
+ * The `stack` property is managed entirely by the underlying JavaScript
184
+ * implementation.  It's generally implemented using a getter function because
185
+ * constructing the human-readable stack trace is somewhat expensive.
186
+ *
187
+ * @public
188
+ * @class VError
189
+ * @param {...String|VErrorOptions|Error} [arg] - sprintf args, options or cause
190
+ * @param {...String} [args] - sprintf args
191
+ * @property {String} name - Programmatically-usable name of the error.
192
+ * @property {String} message - Human-readable summary of the failure.
193
+ * Programmatically-accessible details are provided through `VError.info(err)`
194
+ * class method.
195
+ * @property {String} stack - Human-readable stack trace where the Error was
196
+ * constructed.
197
+ * @example
198
+ * // This is the most general form.  You can specify any supported options
199
+ * // including "cause" and "info") this way.</caption>
200
+ * new VError(options, sprintf_args...)
201
+ * @example
202
+ * // This is a useful shorthand when the only option you need is "cause".
203
+ * new VError(cause, sprintf_args...)
204
+ * @example
205
+ * // This is a useful shorthand when you don't need any options at all.
206
+ * new VError(sprintf_args...)
207
+ */
208
+function VError(...args) {
209
+    let obj, ctor, message, k;
210
+
211
+    /*
212
+     * This is a regrettable pattern, but JavaScript's built-in Error class
213
+     * is defined to work this way, so we allow the constructor to be called
214
+     * without "new".
215
+     */
216
+    if (!(this instanceof VError)) {
217
+        obj = Object.create(VError.prototype);
218
+        VError.apply(obj, arguments);
219
+        return obj;
220
+    }
221
+
222
+    /*
223
+     * For convenience and backwards compatibility, we support several
224
+     * different calling forms.  Normalize them here.
225
+     */
226
+    const parsed = parseConstructorArguments({
227
+        argv: args,
228
+        strict: false
229
+    });
230
+
231
+    /*
232
+     * If we've been given a name, apply it now.
233
+     */
234
+    if (parsed.options.name) {
235
+        assert.string(parsed.options.name, 'error\'s "name" must be a string');
236
+        this.name = parsed.options.name;
237
+    }
238
+
239
+    /*
240
+     * For debugging, we keep track of the original short message (attached
241
+     * this Error particularly) separately from the complete message (which
242
+     * includes the messages of our cause chain).
243
+     */
244
+    this.jse_shortmsg = parsed.shortmessage;
245
+    message = parsed.shortmessage;
246
+
247
+    /*
248
+     * If we've been given a cause, record a reference to it and update our
249
+     * message appropriately.
250
+     */
251
+    const cause = parsed.options.cause;
252
+    if (cause) {
253
+        VError._assertError(cause, '"cause" must be an Error');
254
+        this.jse_cause = cause;
255
+
256
+        if (!parsed.options.skipCauseMessage) {
257
+            message += ': ' + cause.message;
258
+        }
259
+    }
260
+
261
+    /*
262
+     * If we've been given an object with properties, shallow-copy that
263
+     * here.  We don't want to use a deep copy in case there are non-plain
264
+     * objects here, but we don't want to use the original object in case
265
+     * the caller modifies it later.
266
+     */
267
+    this.jse_info = {};
268
+    if (parsed.options.info) {
269
+        // eslint-disable-next-line guard-for-in
270
+        for (k in parsed.options.info) {
271
+            this.jse_info[k] = parsed.options.info[k];
272
+        }
273
+    }
274
+
275
+    this.message = message;
276
+    Error.call(this, message);
277
+
278
+    if (Error.captureStackTrace) {
279
+        ctor = parsed.options.constructorOpt || this.constructor;
280
+        Error.captureStackTrace(this, ctor);
281
+    }
282
+
283
+    return this;
284
+}
285
+
286
+util.inherits(VError, Error);
287
+VError.prototype.name = 'VError';
288
+
289
+/**
290
+ * Appends any keys/fields to the existing jse_info. this can stomp over any
291
+ * existing fields.
292
+ * @public
293
+ * @memberof VError.prototype
294
+ * @param {Object} obj source obj to assign fields from
295
+ * @return {Object} new info object
296
+ */
297
+VError.prototype.assignInfo = function ve_assignInfo(obj) {
298
+    assert.optionalObject(obj, 'obj');
299
+    return Object.assign(this.jse_info, obj);
300
+};
301
+
302
+/**
303
+ * Instance level convenience method vs using the static methods on VError.
304
+ * @public
305
+ * @memberof VError.prototype
306
+ * @return {Object} info object
307
+ */
308
+VError.prototype.info = function ve_info() {
309
+    return VError.info(this);
310
+};
311
+
312
+/**
313
+ * A string representing the VError.
314
+ * @public
315
+ * @memberof VError.prototype
316
+ * @return {String} string representation
317
+ */
318
+VError.prototype.toString = function ve_toString() {
319
+    let str =
320
+        (this.hasOwnProperty('name') && this.name) ||
321
+        this.constructor.name ||
322
+        this.constructor.prototype.name;
323
+    if (this.message) {
324
+        str += ': ' + this.message;
325
+    }
326
+
327
+    return str;
328
+};
329
+
330
+/**
331
+ * This method is provided for compatibility.  New callers should use
332
+ * VError.cause() instead.  That method also uses the saner `null` return value
333
+ * when there is no cause.
334
+ * @public
335
+ * @memberof VError.prototype
336
+ * @return {undefined|Error} Error cause if any
337
+ */
338
+VError.prototype.cause = function ve_cause() {
339
+    const cause = VError.cause(this);
340
+    return cause === null ? undefined : cause;
341
+};
342
+
343
+/*
344
+ * Static methods
345
+ *
346
+ * These class-level methods are provided so that callers can use them on
347
+ * instances of Errors that are not VErrors.  New interfaces should be provided
348
+ * only using static methods to eliminate the class of programming mistake where
349
+ * people fail to check whether the Error object has the corresponding methods.
350
+ */
351
+
352
+/**
353
+ * @private
354
+ * @static
355
+ * @memberof VError
356
+ * @param {Error} err - error to assert
357
+ * @param {String} [msg] - optional message
358
+ * @returns {undefined} no return value
359
+ * @throws AssertationError - when input is not an error
360
+ */
361
+VError._assertError = function _assertError(err, msg) {
362
+    assert.optionalString(msg, 'msg');
363
+    const _msg = (msg || 'err must be an Error') + ` but got ${String(err)}`;
364
+    assert.ok(_.isError(err), _msg);
365
+};
366
+
367
+/**
368
+ * Checks if an error is a VError or VError sub-class.
369
+ *
370
+ * @public
371
+ * @static
372
+ * @memberof VError
373
+ * @param {Error} err - error
374
+ * @return {Boolean} is a VError or VError sub-class
375
+ */
376
+VError.isVError = function assignInfo(err) {
377
+    // We are checking on internals here instead of using
378
+    // `err instanceof VError` to being compatible with the original VError lib.
379
+    return err && err.hasOwnProperty('jse_info');
380
+};
381
+
382
+/**
383
+ * Appends any keys/fields to the `jse_info`. This can stomp over any existing
384
+ * fields.
385
+ *
386
+ * Note: This method is static because in this way we don't need to check on
387
+ * VError versions to be sure `assignInfo` method is supported.
388
+ *
389
+ * @public
390
+ * @static
391
+ * @memberof VError
392
+ * @param {Error} err - error
393
+ * @param {Object} obj - source obj to assign fields from
394
+ * @return {Object} new info object
395
+ */
396
+VError.assignInfo = function assignInfo(err, obj) {
397
+    VError._assertError(err);
398
+    assert.optionalObject(obj, 'obj');
399
+
400
+    if (!VError.isVError(err)) {
401
+        throw new TypeError('err must be an instance of VError');
402
+    }
403
+
404
+    return Object.assign(err.jse_info, obj);
405
+};
406
+
407
+/**
408
+ * Returns the next Error in the cause chain for `err`, or `null` if there is no
409
+ * next error.  See the `cause` argument to the constructor.
410
+ * Errors can have arbitrarily long cause chains.  You can walk the `cause`
411
+ * chain by invoking `VError.cause(err)` on each subsequent return value.
412
+ * If `err` is not a `VError`, the cause is `null`.
413
+ *
414
+ * @public
415
+ * @static
416
+ * @memberof VError
417
+ * @param {VError} err - error
418
+ * @return {undefined|Error} Error cause if any
419
+ */
420
+VError.cause = function cause(err) {
421
+    VError._assertError(err);
422
+    return _.isError(err.jse_cause) ? err.jse_cause : null;
423
+};
424
+
425
+/**
426
+ * Returns an object with all of the extra error information that's been
427
+ * associated with this Error and all of its causes. These are the properties
428
+ * passed in using the `info` option to the constructor. Properties not
429
+ * specified in the constructor for this Error are implicitly inherited from
430
+ * this error's cause.
431
+ *
432
+ * These properties are intended to provide programmatically-accessible metadata
433
+ * about the error.  For an error that indicates a failure to resolve a DNS
434
+ * name, informational properties might include the DNS name to be resolved, or
435
+ * even the list of resolvers used to resolve it.  The values of these
436
+ * properties should generally be plain objects (i.e., consisting only of null,
437
+ * undefined, numbers, booleans, strings, and objects and arrays containing only
438
+ * other plain objects).
439
+ *
440
+ * @public
441
+ * @static
442
+ * @memberof VError
443
+ * @param {VError} err - error
444
+ * @return {Object} info object
445
+ */
446
+VError.info = function info(err) {
447
+    let rv, k;
448
+
449
+    VError._assertError(err);
450
+    const cause = VError.cause(err);
451
+    if (cause !== null) {
452
+        rv = VError.info(cause);
453
+    } else {
454
+        rv = {};
455
+    }
456
+
457
+    if (typeof err.jse_info === 'object' && err.jse_info !== null) {
458
+        // eslint-disable-next-line guard-for-in
459
+        for (k in err.jse_info) {
460
+            rv[k] = err.jse_info[k];
461
+        }
462
+    }
463
+
464
+    return rv;
465
+};
466
+
467
+/**
468
+ * The `findCauseByName()` function traverses the cause chain for `err`, looking
469
+ * for an error whose `name` property matches the passed in `name` value. If no
470
+ * match is found, `null` is returned.
471
+ *
472
+ * If all you want is to know _whether_ there's a cause (and you don't care what
473
+ * it is), you can use `VError.hasCauseWithName(err, name)`.
474
+ *
475
+ * If a vanilla error or a non-VError error is passed in, then there is no cause
476
+ * chain to traverse. In this scenario, the function will check the `name`
477
+ * property of only `err`.
478
+ *
479
+ * @public
480
+ * @static
481
+ * @memberof VError
482
+ * @param {VError} err - error
483
+ * @param {String} name - name of cause Error
484
+ * @return {null|Error} cause if any
485
+ */
486
+VError.findCauseByName = function findCauseByName(err, name) {
487
+    let cause;
488
+
489
+    VError._assertError(err);
490
+    assert.string(name, 'name');
491
+    assert.ok(name.length > 0, 'name cannot be empty');
492
+
493
+    for (cause = err; cause !== null; cause = VError.cause(cause)) {
494
+        assert.ok(_.isError(cause));
495
+        if (cause.name === name) {
496
+            return cause;
497
+        }
498
+    }
499
+
500
+    return null;
501
+};
502
+
503
+/**
504
+ * Returns true if and only if `VError.findCauseByName(err, name)` would return
505
+ * a non-null value.  This essentially determines whether `err` has any cause in
506
+ * its cause chain that has name `name`.
507
+ *
508
+ * @public
509
+ * @static
510
+ * @memberof VError
511
+ * @param {VError} err - error
512
+ * @param {String} name - name of cause Error
513
+ * @return {Boolean} has cause
514
+ */
515
+VError.hasCauseWithName = function hasCauseWithName(err, name) {
516
+    return VError.findCauseByName(err, name) !== null;
517
+};
518
+
519
+/**
520
+ * Returns a string containing the full stack trace, with all nested errors
521
+ * recursively reported as `'caused by:' + err.stack`.
522
+ *
523
+ * @public
524
+ * @static
525
+ * @memberof VError
526
+ * @param {VError} err - error
527
+ * @return {String} full stack trace
528
+ */
529
+VError.fullStack = function fullStack(err) {
530
+    VError._assertError(err);
531
+
532
+    const cause = VError.cause(err);
533
+
534
+    if (cause) {
535
+        return err.stack + '\ncaused by: ' + VError.fullStack(cause);
536
+    }
537
+
538
+    return err.stack;
539
+};
540
+
541
+/**
542
+ * Given an array of Error objects (possibly empty), return a single error
543
+ * representing the whole collection of errors. If the list has:
544
+ *
545
+ * * 0 elements, returns `null`
546
+ * * 1 element, returns the sole error
547
+ * * more than 1 element, returns a MultiError referencing the whole list
548
+ *
549
+ * This is useful for cases where an operation may produce any number of errors,
550
+ * and you ultimately want to implement the usual `callback(err)` pattern.
551
+ * You can accumulate the errors in an array and then invoke
552
+ * `callback(VError.errorFromList(errors))` when the operation is complete.
553
+ *
554
+ * @public
555
+ * @static
556
+ * @memberof VError
557
+ * @param {Array<Error>} errors - errors
558
+ * @return {null|Error|MultiError} single or multi error if any
559
+ */
560
+VError.errorFromList = function errorFromList(errors) {
561
+    assert.arrayOfObject(errors, 'errors');
562
+
563
+    if (errors.length === 0) {
564
+        return null;
565
+    }
566
+
567
+    errors.forEach(function(e) {
568
+        assert.ok(_.isError(e), 'all errors must be an Error');
569
+    });
570
+
571
+    if (errors.length === 1) {
572
+        return errors[0];
573
+    }
574
+
575
+    return new MultiError(errors);
576
+};
577
+
578
+/**
579
+ * Convenience function for iterating an error that may itself be a MultiError.
580
+ *
581
+ * In all cases, `err` must be an Error.  If `err` is a MultiError, then `func`
582
+ * is invoked as `func(errorN)` for each of the underlying errors of the
583
+ * MultiError.
584
+ * If `err` is any other kind of error, `func` is invoked once as `func(err)`.
585
+ * In all cases, `func` is invoked synchronously.
586
+ *
587
+ * This is useful for cases where an operation may produce any number of
588
+ * warnings that may be encapsulated with a MultiError -- but may not be.
589
+ *
590
+ * This function does not iterate an error's cause chain.
591
+ *
592
+ * @public
593
+ * @static
594
+ * @memberof VError
595
+ * @param {Error} err - error
596
+ * @param {Function} func - iterator
597
+ * @return {undefined} no return value
598
+ */
599
+VError.errorForEach = function errorForEach(err, func) {
600
+    VError._assertError(err);
601
+    assert.func(func, 'func');
602
+
603
+    if (err.name === 'MultiError') {
604
+        err.errors().forEach(function iterError(e) {
605
+            func(e);
606
+        });
607
+    } else {
608
+        func(err);
609
+    }
610
+};
611
+
612
+/**
613
+ * PError is like VError, but the message is not run through printf-style
614
+ * templating.
615
+ *
616
+ * @public
617
+ * @class PError
618
+ * @extends VError
619
+ * @param {...String|VErrorOptions|Error} [arg] - sprintf args, options or cause
620
+ * @param {...String} [args] - sprintf args
621
+ */
622
+function PError(...args) {
623
+    let obj;
624
+
625
+    if (!(this instanceof PError)) {
626
+        obj = Object.create(PError.prototype);
627
+        PError.apply(obj, args);
628
+        return obj;
629
+    }
630
+
631
+    const parsed = parseConstructorArguments({
632
+        argv: args,
633
+        strict: false,
634
+        skipPrintf: true
635
+    });
636
+
637
+    VError.call(this, parsed.options, parsed.shortmessage);
638
+
639
+    return this;
640
+}
641
+
642
+util.inherits(PError, VError);
643
+PError.prototype.name = 'PError';
644
+
645
+/**
646
+ * SError is like VError, but stricter about types. You cannot pass "null" or
647
+ * "undefined" as string arguments to the formatter.
648
+ *
649
+ * @public
650
+ * @class SError
651
+ * @extends VError
652
+ * @param {...String|VErrorOptions|Error} [arg] - sprintf args, options or cause
653
+ * @param {...String} [args] - sprintf args
654
+ */
655
+function SError(...args) {
656
+    let obj;
657
+
658
+    if (!(this instanceof SError)) {
659
+        obj = Object.create(SError.prototype);
660
+        SError.apply(obj, arguments);
661
+        return obj;
662
+    }
663
+
664
+    const parsed = parseConstructorArguments({
665
+        argv: args,
666
+        strict: true
667
+    });
668
+
669
+    const options = parsed.options;
670
+    options.skipPrintf = false;
671
+    VError.call(this, options, '%s', parsed.shortmessage);
672
+
673
+    return this;
674
+}
675
+
676
+/*
677
+ * We don't bother setting SError.prototype.name because once constructed,
678
+ * SErrors are just like VErrors.
679
+ */
680
+util.inherits(SError, VError);
681
+
682
+/**
683
+ * Represents a collection of errors for the purpose of consumers that generally
684
+ * only deal with one error.  Callers can extract the individual errors
685
+ * contained in this object, but may also just treat it as a normal single
686
+ * error, in which case a summary message will be printed.
687
+ *
688
+ * @public
689
+ * @class MultiError
690
+ * @extends VError
691
+ * @param {Array<Error>} errors - errors
692
+ * @example
693
+ * // `error_list` is an array of at least one `Error` object.
694
+ * new MultiError(error_list)
695
+ *
696
+ * // The cause of the MultiError is the first error provided.  None of the
697
+ * // other `VError` options are supported.  The `message` for a MultiError
698
+ * // consists the `message` from the first error, prepended with a message
699
+ * // indicating that there were other errors.
700
+ *
701
+ * //For example:
702
+ * err = new MultiError([
703
+ *     new Error('failed to resolve DNS name "abc.example.com"'),
704
+ *     new Error('failed to resolve DNS name "def.example.com"'),
705
+ * ]);
706
+ * console.error(err.message);
707
+ *
708
+ * // outputs:
709
+ * //   first of 2 errors: failed to resolve DNS name "abc.example.com"
710
+ */
711
+function MultiError(errors) {
712
+    assert.array(errors, 'list of errors');
713
+    assert.ok(errors.length > 0, 'must be at least one error');
714
+    this.ase_errors = errors;
715
+
716
+    VError.call(
717
+        this,
718
+        {
719
+            cause: errors[0]
720
+        },
721
+        'first of %d error%s',
722
+        errors.length,
723
+        errors.length === 1 ? '' : 's'
724
+    );
725
+}
726
+
727
+util.inherits(MultiError, VError);
728
+MultiError.prototype.name = 'MultiError';
729
+
730
+/**
731
+ * Returns an array of the errors used to construct this MultiError.
732
+ *
733
+ * @public
734
+ * @memberof MultiError.prototype
735
+ * @returns {Array<Error>} errors
736
+ */
737
+MultiError.prototype.errors = function me_errors() {
738
+    return this.ase_errors.slice(0);
739
+};
740
+
741
+/**
742
+ * WError for wrapping errors while hiding the lower-level messages from the
743
+ * top-level error.  This is useful for API endpoints where you don't want to
744
+ * expose internal error messages, but you still want to preserve the error
745
+ * chain for logging and debugging
746
+ *
747
+ * @public
748
+ * @class WError
749
+ * @extends VError
750
+ * @param {...String|VErrorOptions|Error} [arg] - sprintf args, options or cause
751
+ * @param {...String} [args] - sprintf args
752
+ */
753
+function WError(...args) {
754
+    let obj;
755
+
756
+    if (!(this instanceof WError)) {
757
+        obj = Object.create(WError.prototype);
758
+        WError.apply(obj, args);
759
+        return obj;
760
+    }
761
+
762
+    const parsed = parseConstructorArguments({
763
+        argv: args,
764
+        strict: false
765
+    });
766
+
767
+    const options = parsed.options;
768
+    options.skipCauseMessage = true;
769
+    options.skipPrintf = false;
770
+    VError.call(this, options, '%s', parsed.shortmessage);
771
+
772
+    return this;
773
+}
774
+
775
+util.inherits(WError, VError);
776
+WError.prototype.name = 'WError';
777
+
778
+/**
779
+ * A string representing the WError.
780
+ * @public
781
+ * @memberof WError.prototype
782
+ * @return {String} string representation
783
+ */
784
+WError.prototype.toString = function we_toString() {
785
+    let str =
786
+        (this.hasOwnProperty('name') && this.name) ||
787
+        this.constructor.name ||
788
+        this.constructor.prototype.name;
789
+    if (this.message) {
790
+        str += ': ' + this.message;
791
+    }
792
+    if (this.jse_cause && this.jse_cause.message) {
793
+        str += '; caused by ' + this.jse_cause.toString();
794
+    }
795
+
796
+    return str;
797
+};
798
+
799
+/**
800
+ * For purely historical reasons, WError's cause() function allows you to set
801
+ * the cause.
802
+ * @public
803
+ * @memberof WError.prototype
804
+ * @param {Error} c - cause
805
+ * @return {undefined|Error} Error cause
806
+ */
807
+WError.prototype.cause = function we_cause(c) {
808
+    if (_.isError(c)) {
809
+        this.jse_cause = c;
810
+    }
811
+
812
+    return this.jse_cause;
813
+};

+ 77
- 0
node_modules/@netflix/nerror/package.json View File

@@ -0,0 +1,77 @@
1
+{
2
+  "_from": "@netflix/nerror@^1.1.3",
3
+  "_id": "@netflix/nerror@1.1.3",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-b+MGNyP9/LXkapreJzNUzcvuzZslj/RGgdVVJ16P2wSlYatfLycPObImqVJSmNAdyeShvNeM/pl3sVZsObFueg==",
6
+  "_location": "/@netflix/nerror",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@netflix/nerror@^1.1.3",
12
+    "name": "@netflix/nerror",
13
+    "escapedName": "@netflix%2fnerror",
14
+    "scope": "@netflix",
15
+    "rawSpec": "^1.1.3",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^1.1.3"
18
+  },
19
+  "_requiredBy": [
20
+    "/cordova-ios/cordova-common"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/@netflix/nerror/-/nerror-1.1.3.tgz",
23
+  "_shasum": "9d88eccca442f1d544f2761d15ea557dc0a44ed2",
24
+  "_spec": "@netflix/nerror@^1.1.3",
25
+  "_where": "/Users/christian/Documents/artesanias/node_modules/cordova-ios/node_modules/cordova-common",
26
+  "bugs": {
27
+    "url": "https://github.com/Netflix/nerror/issues"
28
+  },
29
+  "bundleDependencies": false,
30
+  "dependencies": {
31
+    "assert-plus": "^1.0.0",
32
+    "extsprintf": "^1.4.0",
33
+    "lodash": "^4.17.15"
34
+  },
35
+  "deprecated": false,
36
+  "description": "Rich errors",
37
+  "devDependencies": {
38
+    "chai": "^4.1.2",
39
+    "conventional-changelog-angular": "^5.0.0",
40
+    "conventional-recommended-bump": "^4.0.0",
41
+    "documentation": "^8.0.0",
42
+    "eslint": "^4.19.1",
43
+    "eslint-config-prettier": "^2.9.0",
44
+    "eslint-plugin-prettier": "^2.6.0",
45
+    "mocha": "^5.2.0",
46
+    "nyc": "^12.0.2",
47
+    "prettier": "^1.13.5",
48
+    "tsd": "^0.7.3",
49
+    "unleash": "^2.0.1"
50
+  },
51
+  "files": [
52
+    "lib",
53
+    "lib/index.d.ts"
54
+  ],
55
+  "homepage": "https://github.com/Netflix/nerror",
56
+  "keywords": [
57
+    "nerror",
58
+    "error",
59
+    "multierror",
60
+    "verror"
61
+  ],
62
+  "license": "MIT",
63
+  "main": "lib/index.js",
64
+  "name": "@netflix/nerror",
65
+  "repository": {
66
+    "type": "git",
67
+    "url": "git+https://github.com/Netflix/nerror.git"
68
+  },
69
+  "scripts": {
70
+    "test": "make prepush & tsd"
71
+  },
72
+  "tsd": {
73
+    "directory": "test"
74
+  },
75
+  "types": "lib/index.d.ts",
76
+  "version": "1.1.3"
77
+}

+ 21
- 0
node_modules/@nodelib/fs.scandir/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) Denis Malinochkin
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 all
13
+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 THE
21
+SOFTWARE.

+ 171
- 0
node_modules/@nodelib/fs.scandir/README.md View File

@@ -0,0 +1,171 @@
1
+# @nodelib/fs.scandir
2
+
3
+> List files and directories inside the specified directory.
4
+
5
+## :bulb: Highlights
6
+
7
+The package is aimed at obtaining information about entries in the directory.
8
+
9
+* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional).
10
+* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode).
11
+* :link: Can safely work with broken symbolic links.
12
+
13
+## Install
14
+
15
+```console
16
+npm install @nodelib/fs.scandir
17
+```
18
+
19
+## Usage
20
+
21
+```ts
22
+import * as fsScandir from '@nodelib/fs.scandir';
23
+
24
+fsScandir.scandir('path', (error, stats) => { /* … */ });
25
+```
26
+
27
+## API
28
+
29
+### .scandir(path, [optionsOrSettings], callback)
30
+
31
+Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style.
32
+
33
+```ts
34
+fsScandir.scandir('path', (error, entries) => { /* … */ });
35
+fsScandir.scandir('path', {}, (error, entries) => { /* … */ });
36
+fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ });
37
+```
38
+
39
+### .scandirSync(path, [optionsOrSettings])
40
+
41
+Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path.
42
+
43
+```ts
44
+const entries = fsScandir.scandirSync('path');
45
+const entries = fsScandir.scandirSync('path', {});
46
+const entries = fsScandir.scandirSync(('path', new fsScandir.Settings());
47
+```
48
+
49
+#### path
50
+
51
+* Required: `true`
52
+* Type: `string | Buffer | URL`
53
+
54
+A path to a file. If a URL is provided, it must use the `file:` protocol.
55
+
56
+#### optionsOrSettings
57
+
58
+* Required: `false`
59
+* Type: `Options | Settings`
60
+* Default: An instance of `Settings` class
61
+
62
+An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class.
63
+
64
+> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
65
+
66
+### Settings([options])
67
+
68
+A class of full settings of the package.
69
+
70
+```ts
71
+const settings = new fsScandir.Settings({ followSymbolicLinks: false });
72
+
73
+const entries = fsScandir.scandirSync('path', settings);
74
+```
75
+
76
+## Entry
77
+
78
+* `name` — The name of the entry (`unknown.txt`).
79
+* `path` — The path of the entry relative to call directory (`root/unknown.txt`).
80
+* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class.
81
+* `stats` (optional) — An instance of `fs.Stats` class.
82
+
83
+For example, the `scandir` call for `tools` directory with one directory inside:
84
+
85
+```ts
86
+{
87
+	dirent: Dirent { name: 'typedoc', /* … */ },
88
+	name: 'typedoc',
89
+	path: 'tools/typedoc'
90
+}
91
+```
92
+
93
+## Options
94
+
95
+### stats
96
+
97
+* Type: `boolean`
98
+* Default: `false`
99
+
100
+Adds an instance of `fs.Stats` class to the [`Entry`](#entry).
101
+
102
+> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO??
103
+
104
+### followSymbolicLinks
105
+
106
+* Type: `boolean`
107
+* Default: `false`
108
+
109
+Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`.
110
+
111
+### `throwErrorOnBrokenSymbolicLink`
112
+
113
+* Type: `boolean`
114
+* Default: `true`
115
+
116
+Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`.
117
+
118
+### `pathSegmentSeparator`
119
+
120
+* Type: `string`
121
+* Default: `path.sep`
122
+
123
+By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
124
+
125
+### `fs`
126
+
127
+* Type: [`FileSystemAdapter`](./src/adapters/fs.ts)
128
+* Default: A default FS methods
129
+
130
+By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
131
+
132
+```ts
133
+interface FileSystemAdapter {
134
+	lstat?: typeof fs.lstat;
135
+	stat?: typeof fs.stat;
136
+	lstatSync?: typeof fs.lstatSync;
137
+	statSync?: typeof fs.statSync;
138
+	readdir?: typeof fs.readdir;
139
+	readdirSync?: typeof fs.readdirSync;
140
+}
141
+
142
+const settings = new fsScandir.Settings({
143
+	fs: { lstat: fakeLstat }
144
+});
145
+```
146
+
147
+## `old` and `modern` mode
148
+
149
+This package has two modes that are used depending on the environment and parameters of use.
150
+
151
+### old
152
+
153
+* Node.js below `10.10` or when the `stats` option is enabled
154
+
155
+When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links).
156
+
157
+### modern
158
+
159
+* Node.js 10.10+ and the `stats` option is disabled
160
+
161
+In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present.
162
+
163
+This mode makes fewer calls to the file system. It's faster.
164
+
165
+## Changelog
166
+
167
+See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
168
+
169
+## License
170
+
171
+This software is released under the terms of the MIT license.

+ 13
- 0
node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts View File

@@ -0,0 +1,13 @@
1
+/// <reference types="node" />
2
+import * as fs from 'fs';
3
+export declare type FileSystemAdapter = {
4
+    lstat: typeof fs.lstat;
5
+    stat: typeof fs.stat;
6
+    lstatSync: typeof fs.lstatSync;
7
+    statSync: typeof fs.statSync;
8
+    readdir: typeof fs.readdir;
9
+    readdirSync: typeof fs.readdirSync;
10
+};
11
+export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
12
+export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
13
+//# sourceMappingURL=fs.d.ts.map

+ 18
- 0
node_modules/@nodelib/fs.scandir/out/adapters/fs.js View File

@@ -0,0 +1,18 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const fs = require("fs");
4
+exports.FILE_SYSTEM_ADAPTER = {
5
+    lstat: fs.lstat,
6
+    stat: fs.stat,
7
+    lstatSync: fs.lstatSync,
8
+    statSync: fs.statSync,
9
+    readdir: fs.readdir,
10
+    readdirSync: fs.readdirSync
11
+};
12
+function createFileSystemAdapter(fsMethods) {
13
+    if (fsMethods === undefined) {
14
+        return exports.FILE_SYSTEM_ADAPTER;
15
+    }
16
+    return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
17
+}
18
+exports.createFileSystemAdapter = createFileSystemAdapter;

+ 5
- 0
node_modules/@nodelib/fs.scandir/out/constants.d.ts View File

@@ -0,0 +1,5 @@
1
+/**
2
+ * IS `true` for Node.js 10.10 and greater.
3
+ */
4
+export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean;
5
+//# sourceMappingURL=constants.d.ts.map

+ 13
- 0
node_modules/@nodelib/fs.scandir/out/constants.js View File

@@ -0,0 +1,13 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.');
4
+const MAJOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
5
+const MINOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
6
+const SUPPORTED_MAJOR_VERSION = 10;
7
+const SUPPORTED_MINOR_VERSION = 10;
8
+const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
9
+const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
10
+/**
11
+ * IS `true` for Node.js 10.10 and greater.
12
+ */
13
+exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;

+ 13
- 0
node_modules/@nodelib/fs.scandir/out/index.d.ts View File

@@ -0,0 +1,13 @@
1
+import { FileSystemAdapter } from './adapters/fs';
2
+import * as async from './providers/async';
3
+import Settings, { Options } from './settings';
4
+import { Dirent, Entry } from './types';
5
+declare type AsyncCallback = async.AsyncCallback;
6
+declare function scandir(path: string, callback: AsyncCallback): void;
7
+declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
8
+declare namespace scandir {
9
+    function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
10
+}
11
+declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[];
12
+export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options };
13
+//# sourceMappingURL=index.d.ts.map

+ 24
- 0
node_modules/@nodelib/fs.scandir/out/index.js View File

@@ -0,0 +1,24 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const async = require("./providers/async");
4
+const sync = require("./providers/sync");
5
+const settings_1 = require("./settings");
6
+exports.Settings = settings_1.default;
7
+function scandir(path, optionsOrSettingsOrCallback, callback) {
8
+    if (typeof optionsOrSettingsOrCallback === 'function') {
9
+        return async.read(path, getSettings(), optionsOrSettingsOrCallback);
10
+    }
11
+    async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
12
+}
13
+exports.scandir = scandir;
14
+function scandirSync(path, optionsOrSettings) {
15
+    const settings = getSettings(optionsOrSettings);
16
+    return sync.read(path, settings);
17
+}
18
+exports.scandirSync = scandirSync;
19
+function getSettings(settingsOrOptions = {}) {
20
+    if (settingsOrOptions instanceof settings_1.default) {
21
+        return settingsOrOptions;
22
+    }
23
+    return new settings_1.default(settingsOrOptions);
24
+}

+ 8
- 0
node_modules/@nodelib/fs.scandir/out/providers/async.d.ts View File

@@ -0,0 +1,8 @@
1
+/// <reference types="node" />
2
+import Settings from '../settings';
3
+import { Entry } from '../types';
4
+export declare type AsyncCallback = (err: NodeJS.ErrnoException, entries: Entry[]) => void;
5
+export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void;
6
+export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void;
7
+export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void;
8
+//# sourceMappingURL=async.d.ts.map

+ 90
- 0
node_modules/@nodelib/fs.scandir/out/providers/async.js View File

@@ -0,0 +1,90 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const fsStat = require("@nodelib/fs.stat");
4
+const rpl = require("run-parallel");
5
+const constants_1 = require("../constants");
6
+const utils = require("../utils");
7
+function read(directory, settings, callback) {
8
+    if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
9
+        return readdirWithFileTypes(directory, settings, callback);
10
+    }
11
+    return readdir(directory, settings, callback);
12
+}
13
+exports.read = read;
14
+function readdirWithFileTypes(directory, settings, callback) {
15
+    settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
16
+        if (readdirError !== null) {
17
+            return callFailureCallback(callback, readdirError);
18
+        }
19
+        const entries = dirents.map((dirent) => ({
20
+            dirent,
21
+            name: dirent.name,
22
+            path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
23
+        }));
24
+        if (!settings.followSymbolicLinks) {
25
+            return callSuccessCallback(callback, entries);
26
+        }
27
+        const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
28
+        rpl(tasks, (rplError, rplEntries) => {
29
+            if (rplError !== null) {
30
+                return callFailureCallback(callback, rplError);
31
+            }
32
+            callSuccessCallback(callback, rplEntries);
33
+        });
34
+    });
35
+}
36
+exports.readdirWithFileTypes = readdirWithFileTypes;
37
+function makeRplTaskEntry(entry, settings) {
38
+    return (done) => {
39
+        if (!entry.dirent.isSymbolicLink()) {
40
+            return done(null, entry);
41
+        }
42
+        settings.fs.stat(entry.path, (statError, stats) => {
43
+            if (statError !== null) {
44
+                if (settings.throwErrorOnBrokenSymbolicLink) {
45
+                    return done(statError);
46
+                }
47
+                return done(null, entry);
48
+            }
49
+            entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
50
+            return done(null, entry);
51
+        });
52
+    };
53
+}
54
+function readdir(directory, settings, callback) {
55
+    settings.fs.readdir(directory, (readdirError, names) => {
56
+        if (readdirError !== null) {
57
+            return callFailureCallback(callback, readdirError);
58
+        }
59
+        const filepaths = names.map((name) => `${directory}${settings.pathSegmentSeparator}${name}`);
60
+        const tasks = filepaths.map((filepath) => {
61
+            return (done) => fsStat.stat(filepath, settings.fsStatSettings, done);
62
+        });
63
+        rpl(tasks, (rplError, results) => {
64
+            if (rplError !== null) {
65
+                return callFailureCallback(callback, rplError);
66
+            }
67
+            const entries = [];
68
+            names.forEach((name, index) => {
69
+                const stats = results[index];
70
+                const entry = {
71
+                    name,
72
+                    path: filepaths[index],
73
+                    dirent: utils.fs.createDirentFromStats(name, stats)
74
+                };
75
+                if (settings.stats) {
76
+                    entry.stats = stats;
77
+                }
78
+                entries.push(entry);
79
+            });
80
+            callSuccessCallback(callback, entries);
81
+        });
82
+    });
83
+}
84
+exports.readdir = readdir;
85
+function callFailureCallback(callback, error) {
86
+    callback(error);
87
+}
88
+function callSuccessCallback(callback, result) {
89
+    callback(null, result);
90
+}

+ 6
- 0
node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts View File

@@ -0,0 +1,6 @@
1
+import Settings from '../settings';
2
+import { Entry } from '../types';
3
+export declare function read(directory: string, settings: Settings): Entry[];
4
+export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[];
5
+export declare function readdir(directory: string, settings: Settings): Entry[];
6
+//# sourceMappingURL=sync.d.ts.map

+ 52
- 0
node_modules/@nodelib/fs.scandir/out/providers/sync.js View File

@@ -0,0 +1,52 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const fsStat = require("@nodelib/fs.stat");
4
+const constants_1 = require("../constants");
5
+const utils = require("../utils");
6
+function read(directory, settings) {
7
+    if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
8
+        return readdirWithFileTypes(directory, settings);
9
+    }
10
+    return readdir(directory, settings);
11
+}
12
+exports.read = read;
13
+function readdirWithFileTypes(directory, settings) {
14
+    const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
15
+    return dirents.map((dirent) => {
16
+        const entry = {
17
+            dirent,
18
+            name: dirent.name,
19
+            path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
20
+        };
21
+        if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
22
+            try {
23
+                const stats = settings.fs.statSync(entry.path);
24
+                entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
25
+            }
26
+            catch (error) {
27
+                if (settings.throwErrorOnBrokenSymbolicLink) {
28
+                    throw error;
29
+                }
30
+            }
31
+        }
32
+        return entry;
33
+    });
34
+}
35
+exports.readdirWithFileTypes = readdirWithFileTypes;
36
+function readdir(directory, settings) {
37
+    const names = settings.fs.readdirSync(directory);
38
+    return names.map((name) => {
39
+        const entryPath = `${directory}${settings.pathSegmentSeparator}${name}`;
40
+        const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
41
+        const entry = {
42
+            name,
43
+            path: entryPath,
44
+            dirent: utils.fs.createDirentFromStats(name, stats)
45
+        };
46
+        if (settings.stats) {
47
+            entry.stats = stats;
48
+        }
49
+        return entry;
50
+    });
51
+}
52
+exports.readdir = readdir;

+ 21
- 0
node_modules/@nodelib/fs.scandir/out/settings.d.ts View File

@@ -0,0 +1,21 @@
1
+import * as fsStat from '@nodelib/fs.stat';
2
+import * as fs from './adapters/fs';
3
+export declare type Options = {
4
+    followSymbolicLinks?: boolean;
5
+    fs?: Partial<fs.FileSystemAdapter>;
6
+    pathSegmentSeparator?: string;
7
+    stats?: boolean;
8
+    throwErrorOnBrokenSymbolicLink?: boolean;
9
+};
10
+export default class Settings {
11
+    private readonly _options;
12
+    readonly followSymbolicLinks: boolean;
13
+    readonly fs: fs.FileSystemAdapter;
14
+    readonly pathSegmentSeparator: string;
15
+    readonly stats: boolean;
16
+    readonly throwErrorOnBrokenSymbolicLink: boolean;
17
+    readonly fsStatSettings: fsStat.Settings;
18
+    constructor(_options?: Options);
19
+    private _getValue;
20
+}
21
+//# sourceMappingURL=settings.d.ts.map

+ 24
- 0
node_modules/@nodelib/fs.scandir/out/settings.js View File

@@ -0,0 +1,24 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const path = require("path");
4
+const fsStat = require("@nodelib/fs.stat");
5
+const fs = require("./adapters/fs");
6
+class Settings {
7
+    constructor(_options = {}) {
8
+        this._options = _options;
9
+        this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
10
+        this.fs = fs.createFileSystemAdapter(this._options.fs);
11
+        this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
12
+        this.stats = this._getValue(this._options.stats, false);
13
+        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
14
+        this.fsStatSettings = new fsStat.Settings({
15
+            followSymbolicLink: this.followSymbolicLinks,
16
+            fs: this.fs,
17
+            throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
18
+        });
19
+    }
20
+    _getValue(option, value) {
21
+        return option === undefined ? value : option;
22
+    }
23
+}
24
+exports.default = Settings;

+ 20
- 0
node_modules/@nodelib/fs.scandir/out/types/index.d.ts View File

@@ -0,0 +1,20 @@
1
+/// <reference types="node" />
2
+import * as fs from 'fs';
3
+export declare type Entry = {
4
+    dirent: Dirent;
5
+    name: string;
6
+    path: string;
7
+    stats?: Stats;
8
+};
9
+export declare type Stats = fs.Stats;
10
+export declare type Dirent = {
11
+    isBlockDevice(): boolean;
12
+    isCharacterDevice(): boolean;
13
+    isDirectory(): boolean;
14
+    isFIFO(): boolean;
15
+    isFile(): boolean;
16
+    isSocket(): boolean;
17
+    isSymbolicLink(): boolean;
18
+    name: string;
19
+};
20
+//# sourceMappingURL=index.d.ts.map

+ 2
- 0
node_modules/@nodelib/fs.scandir/out/types/index.js View File

@@ -0,0 +1,2 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });

+ 3
- 0
node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts View File

@@ -0,0 +1,3 @@
1
+import { Dirent, Stats } from '../types';
2
+export declare function createDirentFromStats(name: string, stats: Stats): Dirent;
3
+//# sourceMappingURL=fs.d.ts.map

+ 18
- 0
node_modules/@nodelib/fs.scandir/out/utils/fs.js View File

@@ -0,0 +1,18 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+class DirentFromStats {
4
+    constructor(name, stats) {
5
+        this.name = name;
6
+        this.isBlockDevice = stats.isBlockDevice.bind(stats);
7
+        this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
8
+        this.isDirectory = stats.isDirectory.bind(stats);
9
+        this.isFIFO = stats.isFIFO.bind(stats);
10
+        this.isFile = stats.isFile.bind(stats);
11
+        this.isSocket = stats.isSocket.bind(stats);
12
+        this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
13
+    }
14
+}
15
+function createDirentFromStats(name, stats) {
16
+    return new DirentFromStats(name, stats);
17
+}
18
+exports.createDirentFromStats = createDirentFromStats;

+ 3
- 0
node_modules/@nodelib/fs.scandir/out/utils/index.d.ts View File

@@ -0,0 +1,3 @@
1
+import * as fs from './fs';
2
+export { fs };
3
+//# sourceMappingURL=index.d.ts.map

+ 4
- 0
node_modules/@nodelib/fs.scandir/out/utils/index.js View File

@@ -0,0 +1,4 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const fs = require("./fs");
4
+exports.fs = fs;

+ 64
- 0
node_modules/@nodelib/fs.scandir/package.json View File

@@ -0,0 +1,64 @@
1
+{
2
+  "_from": "@nodelib/fs.scandir@2.1.3",
3
+  "_id": "@nodelib/fs.scandir@2.1.3",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==",
6
+  "_location": "/@nodelib/fs.scandir",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "version",
10
+    "registry": true,
11
+    "raw": "@nodelib/fs.scandir@2.1.3",
12
+    "name": "@nodelib/fs.scandir",
13
+    "escapedName": "@nodelib%2ffs.scandir",
14
+    "scope": "@nodelib",
15
+    "rawSpec": "2.1.3",
16
+    "saveSpec": null,
17
+    "fetchSpec": "2.1.3"
18
+  },
19
+  "_requiredBy": [
20
+    "/@nodelib/fs.walk"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
23
+  "_shasum": "3a582bdb53804c6ba6d146579c46e52130cf4a3b",
24
+  "_spec": "@nodelib/fs.scandir@2.1.3",
25
+  "_where": "/Users/christian/Documents/artesanias/node_modules/@nodelib/fs.walk",
26
+  "bundleDependencies": false,
27
+  "dependencies": {
28
+    "@nodelib/fs.stat": "2.0.3",
29
+    "run-parallel": "^1.1.9"
30
+  },
31
+  "deprecated": false,
32
+  "description": "List files and directories inside the specified directory",
33
+  "engines": {
34
+    "node": ">= 8"
35
+  },
36
+  "gitHead": "3b1ef7554ad7c061b3580858101d483fba847abf",
37
+  "keywords": [
38
+    "NodeLib",
39
+    "fs",
40
+    "FileSystem",
41
+    "file system",
42
+    "scandir",
43
+    "readdir",
44
+    "dirent"
45
+  ],
46
+  "license": "MIT",
47
+  "main": "out/index.js",
48
+  "name": "@nodelib/fs.scandir",
49
+  "repository": {
50
+    "type": "git",
51
+    "url": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir"
52
+  },
53
+  "scripts": {
54
+    "build": "npm run clean && npm run compile && npm run lint && npm test",
55
+    "clean": "rimraf {tsconfig.tsbuildinfo,out}",
56
+    "compile": "tsc -b .",
57
+    "compile:watch": "tsc -p . --watch --sourceMap",
58
+    "lint": "eslint \"src/**/*.ts\" --cache",
59
+    "test": "mocha \"out/**/*.spec.js\" -s 0",
60
+    "watch": "npm run clean && npm run compile:watch"
61
+  },
62
+  "typings": "out/index.d.ts",
63
+  "version": "2.1.3"
64
+}

+ 21
- 0
node_modules/@nodelib/fs.stat/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) Denis Malinochkin
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 all
13
+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 THE
21
+SOFTWARE.

+ 126
- 0
node_modules/@nodelib/fs.stat/README.md View File

@@ -0,0 +1,126 @@
1
+# @nodelib/fs.stat
2
+
3
+> Get the status of a file with some features.
4
+
5
+## :bulb: Highlights
6
+
7
+Wrapper around standard method `fs.lstat` and `fs.stat` with some features.
8
+
9
+* :beginner: Normally follows symbolic link.
10
+* :gear: Can safely work with broken symbolic link.
11
+
12
+## Install
13
+
14
+```console
15
+npm install @nodelib/fs.stat
16
+```
17
+
18
+## Usage
19
+
20
+```ts
21
+import * as fsStat from '@nodelib/fs.stat';
22
+
23
+fsStat.stat('path', (error, stats) => { /* … */ });
24
+```
25
+
26
+## API
27
+
28
+### .stat(path, [optionsOrSettings], callback)
29
+
30
+Returns an instance of `fs.Stats` class for provided path with standard callback-style.
31
+
32
+```ts
33
+fsStat.stat('path', (error, stats) => { /* … */ });
34
+fsStat.stat('path', {}, (error, stats) => { /* … */ });
35
+fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ });
36
+```
37
+
38
+### .statSync(path, [optionsOrSettings])
39
+
40
+Returns an instance of `fs.Stats` class for provided path.
41
+
42
+```ts
43
+const stats = fsStat.stat('path');
44
+const stats = fsStat.stat('path', {});
45
+const stats = fsStat.stat('path', new fsStat.Settings());
46
+```
47
+
48
+#### path
49
+
50
+* Required: `true`
51
+* Type: `string | Buffer | URL`
52
+
53
+A path to a file. If a URL is provided, it must use the `file:` protocol.
54
+
55
+#### optionsOrSettings
56
+
57
+* Required: `false`
58
+* Type: `Options | Settings`
59
+* Default: An instance of `Settings` class
60
+
61
+An [`Options`](#options) object or an instance of [`Settings`](#settings) class.
62
+
63
+> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
64
+
65
+### Settings([options])
66
+
67
+A class of full settings of the package.
68
+
69
+```ts
70
+const settings = new fsStat.Settings({ followSymbolicLink: false });
71
+
72
+const stats = fsStat.stat('path', settings);
73
+```
74
+
75
+## Options
76
+
77
+### `followSymbolicLink`
78
+
79
+* Type: `boolean`
80
+* Default: `true`
81
+
82
+Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`.
83
+
84
+### `markSymbolicLink`
85
+
86
+* Type: `boolean`
87
+* Default: `false`
88
+
89
+Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`).
90
+
91
+> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link.
92
+
93
+### `throwErrorOnBrokenSymbolicLink`
94
+
95
+* Type: `boolean`
96
+* Default: `true`
97
+
98
+Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.
99
+
100
+### `fs`
101
+
102
+* Type: [`FileSystemAdapter`](./src/adapters/fs.ts)
103
+* Default: A default FS methods
104
+
105
+By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
106
+
107
+```ts
108
+interface FileSystemAdapter {
109
+	lstat?: typeof fs.lstat;
110
+	stat?: typeof fs.stat;
111
+	lstatSync?: typeof fs.lstatSync;
112
+	statSync?: typeof fs.statSync;
113
+}
114
+
115
+const settings = new fsStat.Settings({
116
+	fs: { lstat: fakeLstat }
117
+});
118
+```
119
+
120
+## Changelog
121
+
122
+See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
123
+
124
+## License
125
+
126
+This software is released under the terms of the MIT license.

+ 11
- 0
node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts View File

@@ -0,0 +1,11 @@
1
+/// <reference types="node" />
2
+import * as fs from 'fs';
3
+export declare type FileSystemAdapter = {
4
+    lstat: typeof fs.lstat;
5
+    stat: typeof fs.stat;
6
+    lstatSync: typeof fs.lstatSync;
7
+    statSync: typeof fs.statSync;
8
+};
9
+export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
10
+export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
11
+//# sourceMappingURL=fs.d.ts.map

+ 16
- 0
node_modules/@nodelib/fs.stat/out/adapters/fs.js View File

@@ -0,0 +1,16 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const fs = require("fs");
4
+exports.FILE_SYSTEM_ADAPTER = {
5
+    lstat: fs.lstat,
6
+    stat: fs.stat,
7
+    lstatSync: fs.lstatSync,
8
+    statSync: fs.statSync
9
+};
10
+function createFileSystemAdapter(fsMethods) {
11
+    if (fsMethods === undefined) {
12
+        return exports.FILE_SYSTEM_ADAPTER;
13
+    }
14
+    return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
15
+}
16
+exports.createFileSystemAdapter = createFileSystemAdapter;

+ 13
- 0
node_modules/@nodelib/fs.stat/out/index.d.ts View File

@@ -0,0 +1,13 @@
1
+import { FileSystemAdapter } from './adapters/fs';
2
+import * as async from './providers/async';
3
+import Settings, { Options } from './settings';
4
+import { Stats } from './types';
5
+declare type AsyncCallback = async.AsyncCallback;
6
+declare function stat(path: string, callback: AsyncCallback): void;
7
+declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
8
+declare namespace stat {
9
+    function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Stats>;
10
+}
11
+declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats;
12
+export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, Options, Stats };
13
+//# sourceMappingURL=index.d.ts.map

+ 24
- 0
node_modules/@nodelib/fs.stat/out/index.js View File

@@ -0,0 +1,24 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const async = require("./providers/async");
4
+const sync = require("./providers/sync");
5
+const settings_1 = require("./settings");
6
+exports.Settings = settings_1.default;
7
+function stat(path, optionsOrSettingsOrCallback, callback) {
8
+    if (typeof optionsOrSettingsOrCallback === 'function') {
9
+        return async.read(path, getSettings(), optionsOrSettingsOrCallback);
10
+    }
11
+    async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
12
+}
13
+exports.stat = stat;
14
+function statSync(path, optionsOrSettings) {
15
+    const settings = getSettings(optionsOrSettings);
16
+    return sync.read(path, settings);
17
+}
18
+exports.statSync = statSync;
19
+function getSettings(settingsOrOptions = {}) {
20
+    if (settingsOrOptions instanceof settings_1.default) {
21
+        return settingsOrOptions;
22
+    }
23
+    return new settings_1.default(settingsOrOptions);
24
+}

+ 5
- 0
node_modules/@nodelib/fs.stat/out/providers/async.d.ts View File

@@ -0,0 +1,5 @@
1
+import Settings from '../settings';
2
+import { ErrnoException, Stats } from '../types';
3
+export declare type AsyncCallback = (err: ErrnoException, stats: Stats) => void;
4
+export declare function read(path: string, settings: Settings, callback: AsyncCallback): void;
5
+//# sourceMappingURL=async.d.ts.map

+ 31
- 0
node_modules/@nodelib/fs.stat/out/providers/async.js View File

@@ -0,0 +1,31 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+function read(path, settings, callback) {
4
+    settings.fs.lstat(path, (lstatError, lstat) => {
5
+        if (lstatError !== null) {
6
+            return callFailureCallback(callback, lstatError);
7
+        }
8
+        if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
9
+            return callSuccessCallback(callback, lstat);
10
+        }
11
+        settings.fs.stat(path, (statError, stat) => {
12
+            if (statError !== null) {
13
+                if (settings.throwErrorOnBrokenSymbolicLink) {
14
+                    return callFailureCallback(callback, statError);
15
+                }
16
+                return callSuccessCallback(callback, lstat);
17
+            }
18
+            if (settings.markSymbolicLink) {
19
+                stat.isSymbolicLink = () => true;
20
+            }
21
+            callSuccessCallback(callback, stat);
22
+        });
23
+    });
24
+}
25
+exports.read = read;
26
+function callFailureCallback(callback, error) {
27
+    callback(error);
28
+}
29
+function callSuccessCallback(callback, result) {
30
+    callback(null, result);
31
+}

+ 4
- 0
node_modules/@nodelib/fs.stat/out/providers/sync.d.ts View File

@@ -0,0 +1,4 @@
1
+import Settings from '../settings';
2
+import { Stats } from '../types';
3
+export declare function read(path: string, settings: Settings): Stats;
4
+//# sourceMappingURL=sync.d.ts.map

+ 22
- 0
node_modules/@nodelib/fs.stat/out/providers/sync.js View File

@@ -0,0 +1,22 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+function read(path, settings) {
4
+    const lstat = settings.fs.lstatSync(path);
5
+    if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
6
+        return lstat;
7
+    }
8
+    try {
9
+        const stat = settings.fs.statSync(path);
10
+        if (settings.markSymbolicLink) {
11
+            stat.isSymbolicLink = () => true;
12
+        }
13
+        return stat;
14
+    }
15
+    catch (error) {
16
+        if (!settings.throwErrorOnBrokenSymbolicLink) {
17
+            return lstat;
18
+        }
19
+        throw error;
20
+    }
21
+}
22
+exports.read = read;

+ 17
- 0
node_modules/@nodelib/fs.stat/out/settings.d.ts View File

@@ -0,0 +1,17 @@
1
+import * as fs from './adapters/fs';
2
+export declare type Options = {
3
+    followSymbolicLink?: boolean;
4
+    fs?: Partial<fs.FileSystemAdapter>;
5
+    markSymbolicLink?: boolean;
6
+    throwErrorOnBrokenSymbolicLink?: boolean;
7
+};
8
+export default class Settings {
9
+    private readonly _options;
10
+    readonly followSymbolicLink: boolean;
11
+    readonly fs: fs.FileSystemAdapter;
12
+    readonly markSymbolicLink: boolean;
13
+    readonly throwErrorOnBrokenSymbolicLink: boolean;
14
+    constructor(_options?: Options);
15
+    private _getValue;
16
+}
17
+//# sourceMappingURL=settings.d.ts.map

+ 16
- 0
node_modules/@nodelib/fs.stat/out/settings.js View File

@@ -0,0 +1,16 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const fs = require("./adapters/fs");
4
+class Settings {
5
+    constructor(_options = {}) {
6
+        this._options = _options;
7
+        this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
8
+        this.fs = fs.createFileSystemAdapter(this._options.fs);
9
+        this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
10
+        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
11
+    }
12
+    _getValue(option, value) {
13
+        return option === undefined ? value : option;
14
+    }
15
+}
16
+exports.default = Settings;

+ 5
- 0
node_modules/@nodelib/fs.stat/out/types/index.d.ts View File

@@ -0,0 +1,5 @@
1
+/// <reference types="node" />
2
+import * as fs from 'fs';
3
+export declare type Stats = fs.Stats;
4
+export declare type ErrnoException = NodeJS.ErrnoException;
5
+//# sourceMappingURL=index.d.ts.map

+ 2
- 0
node_modules/@nodelib/fs.stat/out/types/index.js View File

@@ -0,0 +1,2 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });

+ 59
- 0
node_modules/@nodelib/fs.stat/package.json View File

@@ -0,0 +1,59 @@
1
+{
2
+  "_from": "@nodelib/fs.stat@^2.0.2",
3
+  "_id": "@nodelib/fs.stat@2.0.3",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==",
6
+  "_location": "/@nodelib/fs.stat",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@nodelib/fs.stat@^2.0.2",
12
+    "name": "@nodelib/fs.stat",
13
+    "escapedName": "@nodelib%2ffs.stat",
14
+    "scope": "@nodelib",
15
+    "rawSpec": "^2.0.2",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^2.0.2"
18
+  },
19
+  "_requiredBy": [
20
+    "/@nodelib/fs.scandir",
21
+    "/fast-glob"
22
+  ],
23
+  "_resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz",
24
+  "_shasum": "34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3",
25
+  "_spec": "@nodelib/fs.stat@^2.0.2",
26
+  "_where": "/Users/christian/Documents/artesanias/node_modules/fast-glob",
27
+  "bundleDependencies": false,
28
+  "deprecated": false,
29
+  "description": "Get the status of a file with some features",
30
+  "engines": {
31
+    "node": ">= 8"
32
+  },
33
+  "gitHead": "3b1ef7554ad7c061b3580858101d483fba847abf",
34
+  "keywords": [
35
+    "NodeLib",
36
+    "fs",
37
+    "FileSystem",
38
+    "file system",
39
+    "stat"
40
+  ],
41
+  "license": "MIT",
42
+  "main": "out/index.js",
43
+  "name": "@nodelib/fs.stat",
44
+  "repository": {
45
+    "type": "git",
46
+    "url": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat"
47
+  },
48
+  "scripts": {
49
+    "build": "npm run clean && npm run compile && npm run lint && npm test",
50
+    "clean": "rimraf {tsconfig.tsbuildinfo,out}",
51
+    "compile": "tsc -b .",
52
+    "compile:watch": "tsc -p . --watch --sourceMap",
53
+    "lint": "eslint \"src/**/*.ts\" --cache",
54
+    "test": "mocha \"out/**/*.spec.js\" -s 0",
55
+    "watch": "npm run clean && npm run compile:watch"
56
+  },
57
+  "typings": "out/index.d.ts",
58
+  "version": "2.0.3"
59
+}

+ 21
- 0
node_modules/@nodelib/fs.walk/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) Denis Malinochkin
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 all
13
+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 THE
21
+SOFTWARE.

+ 215
- 0
node_modules/@nodelib/fs.walk/README.md View File

@@ -0,0 +1,215 @@
1
+# @nodelib/fs.walk
2
+
3
+> A library for efficiently walking a directory recursively.
4
+
5
+## :bulb: Highlights
6
+
7
+* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional).
8
+* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode).
9
+* :gear: Built-in directories/files and error filtering system.
10
+* :link: Can safely work with broken symbolic links.
11
+
12
+## Install
13
+
14
+```console
15
+npm install @nodelib/fs.walk
16
+```
17
+
18
+## Usage
19
+
20
+```ts
21
+import * as fsWalk from '@nodelib/fs.walk';
22
+
23
+fsWalk.walk('path', (error, entries) => { /* … */ });
24
+```
25
+
26
+## API
27
+
28
+### .walk(path, [optionsOrSettings], callback)
29
+
30
+Reads the directory recursively and asynchronously. Requires a callback function.
31
+
32
+> :book: If you want to use the Promise API, use `util.promisify`.
33
+
34
+```ts
35
+fsWalk.walk('path', (error, entries) => { /* … */ });
36
+fsWalk.walk('path', {}, (error, entries) => { /* … */ });
37
+fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ });
38
+```
39
+
40
+### .walkStream(path, [optionsOrSettings])
41
+
42
+Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider.
43
+
44
+```ts
45
+const stream = fsWalk.walkStream('path');
46
+const stream = fsWalk.walkStream('path', {});
47
+const stream = fsWalk.walkStream('path', new fsWalk.Settings());
48
+```
49
+
50
+### .walkSync(path, [optionsOrSettings])
51
+
52
+Reads the directory recursively and synchronously. Returns an array of entries.
53
+
54
+```ts
55
+const entries = fsWalk.walkSync('path');
56
+const entries = fsWalk.walkSync('path', {});
57
+const entries = fsWalk.walkSync('path', new fsWalk.Settings());
58
+```
59
+
60
+#### path
61
+
62
+* Required: `true`
63
+* Type: `string | Buffer | URL`
64
+
65
+A path to a file. If a URL is provided, it must use the `file:` protocol.
66
+
67
+#### optionsOrSettings
68
+
69
+* Required: `false`
70
+* Type: `Options | Settings`
71
+* Default: An instance of `Settings` class
72
+
73
+An [`Options`](#options) object or an instance of [`Settings`](#settings) class.
74
+
75
+> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
76
+
77
+### Settings([options])
78
+
79
+A class of full settings of the package.
80
+
81
+```ts
82
+const settings = new fsWalk.Settings({ followSymbolicLinks: true });
83
+
84
+const entries = fsWalk.walkSync('path', settings);
85
+```
86
+
87
+## Entry
88
+
89
+* `name` — The name of the entry (`unknown.txt`).
90
+* `path` — The path of the entry relative to call directory (`root/unknown.txt`).
91
+* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class.
92
+* [`stats`] — An instance of `fs.Stats` class.
93
+
94
+## Options
95
+
96
+### basePath
97
+
98
+* Type: `string`
99
+* Default: `undefined`
100
+
101
+By default, all paths are built relative to the root path. You can use this option to set custom root path.
102
+
103
+In the example below we read the files from the `root` directory, but in the results the root path will be `custom`.
104
+
105
+```ts
106
+fsWalk.walkSync('root'); // → ['root/file.txt']
107
+fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt']
108
+```
109
+
110
+### concurrency
111
+
112
+* Type: `number`
113
+* Default: `Infinity`
114
+
115
+The maximum number of concurrent calls to `fs.readdir`.
116
+
117
+> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)).
118
+
119
+### deepFilter
120
+
121
+* Type: [`DeepFilterFunction`](./src/settings.ts)
122
+* Default: `undefined`
123
+
124
+A function that indicates whether the directory will be read deep or not.
125
+
126
+```ts
127
+// Skip all directories that starts with `node_modules`
128
+const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules');
129
+```
130
+
131
+### entryFilter
132
+
133
+* Type: [`EntryFilterFunction`](./src/settings.ts)
134
+* Default: `undefined`
135
+
136
+A function that indicates whether the entry will be included to results or not.
137
+
138
+```ts
139
+// Exclude all `.js` files from results
140
+const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js');
141
+```
142
+
143
+### errorFilter
144
+
145
+* Type: [`ErrorFilterFunction`](./src/settings.ts)
146
+* Default: `undefined`
147
+
148
+A function that allows you to skip errors that occur when reading directories.
149
+
150
+For example, you can skip `ENOENT` errors if required:
151
+
152
+```ts
153
+// Skip all ENOENT errors
154
+const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT';
155
+```
156
+
157
+### stats
158
+
159
+* Type: `boolean`
160
+* Default: `false`
161
+
162
+Adds an instance of `fs.Stats` class to the [`Entry`](#entry).
163
+
164
+> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type.
165
+
166
+### followSymbolicLinks
167
+
168
+* Type: `boolean`
169
+* Default: `false`
170
+
171
+Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`.
172
+
173
+### `throwErrorOnBrokenSymbolicLink`
174
+
175
+* Type: `boolean`
176
+* Default: `true`
177
+
178
+Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.
179
+
180
+### `pathSegmentSeparator`
181
+
182
+* Type: `string`
183
+* Default: `path.sep`
184
+
185
+By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
186
+
187
+### `fs`
188
+
189
+* Type: `FileSystemAdapter`
190
+* Default: A default FS methods
191
+
192
+By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
193
+
194
+```ts
195
+interface FileSystemAdapter {
196
+	lstat: typeof fs.lstat;
197
+	stat: typeof fs.stat;
198
+	lstatSync: typeof fs.lstatSync;
199
+	statSync: typeof fs.statSync;
200
+	readdir: typeof fs.readdir;
201
+	readdirSync: typeof fs.readdirSync;
202
+}
203
+
204
+const settings = new fsWalk.Settings({
205
+	fs: { lstat: fakeLstat }
206
+});
207
+```
208
+
209
+## Changelog
210
+
211
+See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
212
+
213
+## License
214
+
215
+This software is released under the terms of the MIT license.

+ 15
- 0
node_modules/@nodelib/fs.walk/out/index.d.ts View File

@@ -0,0 +1,15 @@
1
+/// <reference types="node" />
2
+import { Readable } from 'stream';
3
+import { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir';
4
+import { AsyncCallback } from './providers/async';
5
+import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings';
6
+import { Entry } from './types';
7
+declare function walk(directory: string, callback: AsyncCallback): void;
8
+declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
9
+declare namespace walk {
10
+    function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
11
+}
12
+declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[];
13
+declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable;
14
+export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction };
15
+//# sourceMappingURL=index.d.ts.map

+ 32
- 0
node_modules/@nodelib/fs.walk/out/index.js View File

@@ -0,0 +1,32 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const async_1 = require("./providers/async");
4
+const stream_1 = require("./providers/stream");
5
+const sync_1 = require("./providers/sync");
6
+const settings_1 = require("./settings");
7
+exports.Settings = settings_1.default;
8
+function walk(directory, optionsOrSettingsOrCallback, callback) {
9
+    if (typeof optionsOrSettingsOrCallback === 'function') {
10
+        return new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
11
+    }
12
+    new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
13
+}
14
+exports.walk = walk;
15
+function walkSync(directory, optionsOrSettings) {
16
+    const settings = getSettings(optionsOrSettings);
17
+    const provider = new sync_1.default(directory, settings);
18
+    return provider.read();
19
+}
20
+exports.walkSync = walkSync;
21
+function walkStream(directory, optionsOrSettings) {
22
+    const settings = getSettings(optionsOrSettings);
23
+    const provider = new stream_1.default(directory, settings);
24
+    return provider.read();
25
+}
26
+exports.walkStream = walkStream;
27
+function getSettings(settingsOrOptions = {}) {
28
+    if (settingsOrOptions instanceof settings_1.default) {
29
+        return settingsOrOptions;
30
+    }
31
+    return new settings_1.default(settingsOrOptions);
32
+}

+ 13
- 0
node_modules/@nodelib/fs.walk/out/providers/async.d.ts View File

@@ -0,0 +1,13 @@
1
+import AsyncReader from '../readers/async';
2
+import Settings from '../settings';
3
+import { Entry, Errno } from '../types';
4
+export declare type AsyncCallback = (err: Errno, entries: Entry[]) => void;
5
+export default class AsyncProvider {
6
+    private readonly _root;
7
+    private readonly _settings;
8
+    protected readonly _reader: AsyncReader;
9
+    private readonly _storage;
10
+    constructor(_root: string, _settings: Settings);
11
+    read(callback: AsyncCallback): void;
12
+}
13
+//# sourceMappingURL=async.d.ts.map

+ 30
- 0
node_modules/@nodelib/fs.walk/out/providers/async.js View File

@@ -0,0 +1,30 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const async_1 = require("../readers/async");
4
+class AsyncProvider {
5
+    constructor(_root, _settings) {
6
+        this._root = _root;
7
+        this._settings = _settings;
8
+        this._reader = new async_1.default(this._root, this._settings);
9
+        this._storage = new Set();
10
+    }
11
+    read(callback) {
12
+        this._reader.onError((error) => {
13
+            callFailureCallback(callback, error);
14
+        });
15
+        this._reader.onEntry((entry) => {
16
+            this._storage.add(entry);
17
+        });
18
+        this._reader.onEnd(() => {
19
+            callSuccessCallback(callback, [...this._storage]);
20
+        });
21
+        this._reader.read();
22
+    }
23
+}
24
+exports.default = AsyncProvider;
25
+function callFailureCallback(callback, error) {
26
+    callback(error);
27
+}
28
+function callSuccessCallback(callback, entries) {
29
+    callback(null, entries);
30
+}

+ 5
- 0
node_modules/@nodelib/fs.walk/out/providers/index.d.ts View File

@@ -0,0 +1,5 @@
1
+import AsyncProvider from './async';
2
+import StreamProvider from './stream';
3
+import SyncProvider from './sync';
4
+export { AsyncProvider, StreamProvider, SyncProvider };
5
+//# sourceMappingURL=index.d.ts.map

+ 8
- 0
node_modules/@nodelib/fs.walk/out/providers/index.js View File

@@ -0,0 +1,8 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const async_1 = require("./async");
4
+exports.AsyncProvider = async_1.default;
5
+const stream_1 = require("./stream");
6
+exports.StreamProvider = stream_1.default;
7
+const sync_1 = require("./sync");
8
+exports.SyncProvider = sync_1.default;

+ 13
- 0
node_modules/@nodelib/fs.walk/out/providers/stream.d.ts View File

@@ -0,0 +1,13 @@
1
+/// <reference types="node" />
2
+import { Readable } from 'stream';
3
+import AsyncReader from '../readers/async';
4
+import Settings from '../settings';
5
+export default class StreamProvider {
6
+    private readonly _root;
7
+    private readonly _settings;
8
+    protected readonly _reader: AsyncReader;
9
+    protected readonly _stream: Readable;
10
+    constructor(_root: string, _settings: Settings);
11
+    read(): Readable;
12
+}
13
+//# sourceMappingURL=stream.d.ts.map

+ 30
- 0
node_modules/@nodelib/fs.walk/out/providers/stream.js View File

@@ -0,0 +1,30 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const stream_1 = require("stream");
4
+const async_1 = require("../readers/async");
5
+class StreamProvider {
6
+    constructor(_root, _settings) {
7
+        this._root = _root;
8
+        this._settings = _settings;
9
+        this._reader = new async_1.default(this._root, this._settings);
10
+        this._stream = new stream_1.Readable({
11
+            objectMode: true,
12
+            read: () => { },
13
+            destroy: this._reader.destroy.bind(this._reader)
14
+        });
15
+    }
16
+    read() {
17
+        this._reader.onError((error) => {
18
+            this._stream.emit('error', error);
19
+        });
20
+        this._reader.onEntry((entry) => {
21
+            this._stream.push(entry);
22
+        });
23
+        this._reader.onEnd(() => {
24
+            this._stream.push(null);
25
+        });
26
+        this._reader.read();
27
+        return this._stream;
28
+    }
29
+}
30
+exports.default = StreamProvider;

+ 11
- 0
node_modules/@nodelib/fs.walk/out/providers/sync.d.ts View File

@@ -0,0 +1,11 @@
1
+import SyncReader from '../readers/sync';
2
+import Settings from '../settings';
3
+import { Entry } from '../types';
4
+export default class SyncProvider {
5
+    private readonly _root;
6
+    private readonly _settings;
7
+    protected readonly _reader: SyncReader;
8
+    constructor(_root: string, _settings: Settings);
9
+    read(): Entry[];
10
+}
11
+//# sourceMappingURL=sync.d.ts.map

+ 14
- 0
node_modules/@nodelib/fs.walk/out/providers/sync.js View File

@@ -0,0 +1,14 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const sync_1 = require("../readers/sync");
4
+class SyncProvider {
5
+    constructor(_root, _settings) {
6
+        this._root = _root;
7
+        this._settings = _settings;
8
+        this._reader = new sync_1.default(this._root, this._settings);
9
+    }
10
+    read() {
11
+        return this._reader.read();
12
+    }
13
+}
14
+exports.default = SyncProvider;

+ 30
- 0
node_modules/@nodelib/fs.walk/out/readers/async.d.ts View File

@@ -0,0 +1,30 @@
1
+/// <reference types="node" />
2
+import { EventEmitter } from 'events';
3
+import * as fsScandir from '@nodelib/fs.scandir';
4
+import Settings from '../settings';
5
+import { Entry, Errno } from '../types';
6
+import Reader from './reader';
7
+declare type EntryEventCallback = (entry: Entry) => void;
8
+declare type ErrorEventCallback = (error: Errno) => void;
9
+declare type EndEventCallback = () => void;
10
+export default class AsyncReader extends Reader {
11
+    protected readonly _settings: Settings;
12
+    protected readonly _scandir: typeof fsScandir.scandir;
13
+    protected readonly _emitter: EventEmitter;
14
+    private readonly _queue;
15
+    private _isFatalError;
16
+    private _isDestroyed;
17
+    constructor(_root: string, _settings: Settings);
18
+    read(): EventEmitter;
19
+    destroy(): void;
20
+    onEntry(callback: EntryEventCallback): void;
21
+    onError(callback: ErrorEventCallback): void;
22
+    onEnd(callback: EndEventCallback): void;
23
+    private _pushToQueue;
24
+    private _worker;
25
+    private _handleError;
26
+    private _handleEntry;
27
+    private _emitEntry;
28
+}
29
+export {};
30
+//# sourceMappingURL=async.d.ts.map

+ 93
- 0
node_modules/@nodelib/fs.walk/out/readers/async.js View File

@@ -0,0 +1,93 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const events_1 = require("events");
4
+const fsScandir = require("@nodelib/fs.scandir");
5
+const fastq = require("fastq");
6
+const common = require("./common");
7
+const reader_1 = require("./reader");
8
+class AsyncReader extends reader_1.default {
9
+    constructor(_root, _settings) {
10
+        super(_root, _settings);
11
+        this._settings = _settings;
12
+        this._scandir = fsScandir.scandir;
13
+        this._emitter = new events_1.EventEmitter();
14
+        this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
15
+        this._isFatalError = false;
16
+        this._isDestroyed = false;
17
+        this._queue.drain = () => {
18
+            if (!this._isFatalError) {
19
+                this._emitter.emit('end');
20
+            }
21
+        };
22
+    }
23
+    read() {
24
+        this._isFatalError = false;
25
+        this._isDestroyed = false;
26
+        setImmediate(() => {
27
+            this._pushToQueue(this._root, this._settings.basePath);
28
+        });
29
+        return this._emitter;
30
+    }
31
+    destroy() {
32
+        if (this._isDestroyed) {
33
+            throw new Error('The reader is already destroyed');
34
+        }
35
+        this._isDestroyed = true;
36
+        this._queue.killAndDrain();
37
+    }
38
+    onEntry(callback) {
39
+        this._emitter.on('entry', callback);
40
+    }
41
+    onError(callback) {
42
+        this._emitter.once('error', callback);
43
+    }
44
+    onEnd(callback) {
45
+        this._emitter.once('end', callback);
46
+    }
47
+    _pushToQueue(directory, base) {
48
+        const queueItem = { directory, base };
49
+        this._queue.push(queueItem, (error) => {
50
+            if (error !== null) {
51
+                this._handleError(error);
52
+            }
53
+        });
54
+    }
55
+    _worker(item, done) {
56
+        this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
57
+            if (error !== null) {
58
+                return done(error, undefined);
59
+            }
60
+            for (const entry of entries) {
61
+                this._handleEntry(entry, item.base);
62
+            }
63
+            done(null, undefined);
64
+        });
65
+    }
66
+    _handleError(error) {
67
+        if (!common.isFatalError(this._settings, error)) {
68
+            return;
69
+        }
70
+        this._isFatalError = true;
71
+        this._isDestroyed = true;
72
+        this._emitter.emit('error', error);
73
+    }
74
+    _handleEntry(entry, base) {
75
+        if (this._isDestroyed || this._isFatalError) {
76
+            return;
77
+        }
78
+        const fullpath = entry.path;
79
+        if (base !== undefined) {
80
+            entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
81
+        }
82
+        if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
83
+            this._emitEntry(entry);
84
+        }
85
+        if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
86
+            this._pushToQueue(fullpath, entry.path);
87
+        }
88
+    }
89
+    _emitEntry(entry) {
90
+        this._emitter.emit('entry', entry);
91
+    }
92
+}
93
+exports.default = AsyncReader;

+ 7
- 0
node_modules/@nodelib/fs.walk/out/readers/common.d.ts View File

@@ -0,0 +1,7 @@
1
+import Settings, { FilterFunction } from '../settings';
2
+import { Errno } from '../types';
3
+export declare function isFatalError(settings: Settings, error: Errno): boolean;
4
+export declare function isAppliedFilter<T>(filter: FilterFunction<T> | null, value: T): boolean;
5
+export declare function replacePathSegmentSeparator(filepath: string, separator: string): string;
6
+export declare function joinPathSegments(a: string, b: string, separator: string): string;
7
+//# sourceMappingURL=common.d.ts.map

+ 24
- 0
node_modules/@nodelib/fs.walk/out/readers/common.js View File

@@ -0,0 +1,24 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+function isFatalError(settings, error) {
4
+    if (settings.errorFilter === null) {
5
+        return true;
6
+    }
7
+    return !settings.errorFilter(error);
8
+}
9
+exports.isFatalError = isFatalError;
10
+function isAppliedFilter(filter, value) {
11
+    return filter === null || filter(value);
12
+}
13
+exports.isAppliedFilter = isAppliedFilter;
14
+function replacePathSegmentSeparator(filepath, separator) {
15
+    return filepath.split(/[\\/]/).join(separator);
16
+}
17
+exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
18
+function joinPathSegments(a, b, separator) {
19
+    if (a === '') {
20
+        return b;
21
+    }
22
+    return a + separator + b;
23
+}
24
+exports.joinPathSegments = joinPathSegments;

+ 7
- 0
node_modules/@nodelib/fs.walk/out/readers/reader.d.ts View File

@@ -0,0 +1,7 @@
1
+import Settings from '../settings';
2
+export default class Reader {
3
+    protected readonly _root: string;
4
+    protected readonly _settings: Settings;
5
+    constructor(_root: string, _settings: Settings);
6
+}
7
+//# sourceMappingURL=reader.d.ts.map

+ 11
- 0
node_modules/@nodelib/fs.walk/out/readers/reader.js View File

@@ -0,0 +1,11 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const common = require("./common");
4
+class Reader {
5
+    constructor(_root, _settings) {
6
+        this._root = _root;
7
+        this._settings = _settings;
8
+        this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
9
+    }
10
+}
11
+exports.default = Reader;

+ 16
- 0
node_modules/@nodelib/fs.walk/out/readers/sync.d.ts View File

@@ -0,0 +1,16 @@
1
+import * as fsScandir from '@nodelib/fs.scandir';
2
+import { Entry } from '../types';
3
+import Reader from './reader';
4
+export default class SyncReader extends Reader {
5
+    protected readonly _scandir: typeof fsScandir.scandirSync;
6
+    private readonly _storage;
7
+    private readonly _queue;
8
+    read(): Entry[];
9
+    private _pushToQueue;
10
+    private _handleQueue;
11
+    private _handleDirectory;
12
+    private _handleError;
13
+    private _handleEntry;
14
+    private _pushToStorage;
15
+}
16
+//# sourceMappingURL=sync.d.ts.map

+ 59
- 0
node_modules/@nodelib/fs.walk/out/readers/sync.js View File

@@ -0,0 +1,59 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const fsScandir = require("@nodelib/fs.scandir");
4
+const common = require("./common");
5
+const reader_1 = require("./reader");
6
+class SyncReader extends reader_1.default {
7
+    constructor() {
8
+        super(...arguments);
9
+        this._scandir = fsScandir.scandirSync;
10
+        this._storage = new Set();
11
+        this._queue = new Set();
12
+    }
13
+    read() {
14
+        this._pushToQueue(this._root, this._settings.basePath);
15
+        this._handleQueue();
16
+        return [...this._storage];
17
+    }
18
+    _pushToQueue(directory, base) {
19
+        this._queue.add({ directory, base });
20
+    }
21
+    _handleQueue() {
22
+        for (const item of this._queue.values()) {
23
+            this._handleDirectory(item.directory, item.base);
24
+        }
25
+    }
26
+    _handleDirectory(directory, base) {
27
+        try {
28
+            const entries = this._scandir(directory, this._settings.fsScandirSettings);
29
+            for (const entry of entries) {
30
+                this._handleEntry(entry, base);
31
+            }
32
+        }
33
+        catch (error) {
34
+            this._handleError(error);
35
+        }
36
+    }
37
+    _handleError(error) {
38
+        if (!common.isFatalError(this._settings, error)) {
39
+            return;
40
+        }
41
+        throw error;
42
+    }
43
+    _handleEntry(entry, base) {
44
+        const fullpath = entry.path;
45
+        if (base !== undefined) {
46
+            entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
47
+        }
48
+        if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
49
+            this._pushToStorage(entry);
50
+        }
51
+        if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
52
+            this._pushToQueue(fullpath, entry.path);
53
+        }
54
+    }
55
+    _pushToStorage(entry) {
56
+        this._storage.add(entry);
57
+    }
58
+}
59
+exports.default = SyncReader;

+ 31
- 0
node_modules/@nodelib/fs.walk/out/settings.d.ts View File

@@ -0,0 +1,31 @@
1
+import * as fsScandir from '@nodelib/fs.scandir';
2
+import { Entry, Errno } from './types';
3
+export declare type FilterFunction<T> = (value: T) => boolean;
4
+export declare type DeepFilterFunction = FilterFunction<Entry>;
5
+export declare type EntryFilterFunction = FilterFunction<Entry>;
6
+export declare type ErrorFilterFunction = FilterFunction<Errno>;
7
+export declare type Options = {
8
+    basePath?: string;
9
+    concurrency?: number;
10
+    deepFilter?: DeepFilterFunction;
11
+    entryFilter?: EntryFilterFunction;
12
+    errorFilter?: ErrorFilterFunction;
13
+    followSymbolicLinks?: boolean;
14
+    fs?: Partial<fsScandir.FileSystemAdapter>;
15
+    pathSegmentSeparator?: string;
16
+    stats?: boolean;
17
+    throwErrorOnBrokenSymbolicLink?: boolean;
18
+};
19
+export default class Settings {
20
+    private readonly _options;
21
+    readonly basePath?: string;
22
+    readonly concurrency: number;
23
+    readonly deepFilter: DeepFilterFunction | null;
24
+    readonly entryFilter: EntryFilterFunction | null;
25
+    readonly errorFilter: ErrorFilterFunction | null;
26
+    readonly pathSegmentSeparator: string;
27
+    readonly fsScandirSettings: fsScandir.Settings;
28
+    constructor(_options?: Options);
29
+    private _getValue;
30
+}
31
+//# sourceMappingURL=settings.d.ts.map

+ 26
- 0
node_modules/@nodelib/fs.walk/out/settings.js View File

@@ -0,0 +1,26 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });
3
+const path = require("path");
4
+const fsScandir = require("@nodelib/fs.scandir");
5
+class Settings {
6
+    constructor(_options = {}) {
7
+        this._options = _options;
8
+        this.basePath = this._getValue(this._options.basePath, undefined);
9
+        this.concurrency = this._getValue(this._options.concurrency, Infinity);
10
+        this.deepFilter = this._getValue(this._options.deepFilter, null);
11
+        this.entryFilter = this._getValue(this._options.entryFilter, null);
12
+        this.errorFilter = this._getValue(this._options.errorFilter, null);
13
+        this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
14
+        this.fsScandirSettings = new fsScandir.Settings({
15
+            followSymbolicLinks: this._options.followSymbolicLinks,
16
+            fs: this._options.fs,
17
+            pathSegmentSeparator: this._options.pathSegmentSeparator,
18
+            stats: this._options.stats,
19
+            throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
20
+        });
21
+    }
22
+    _getValue(option, value) {
23
+        return option === undefined ? value : option;
24
+    }
25
+}
26
+exports.default = Settings;

+ 9
- 0
node_modules/@nodelib/fs.walk/out/types/index.d.ts View File

@@ -0,0 +1,9 @@
1
+/// <reference types="node" />
2
+import * as scandir from '@nodelib/fs.scandir';
3
+export declare type Entry = scandir.Entry;
4
+export declare type Errno = NodeJS.ErrnoException;
5
+export declare type QueueItem = {
6
+    directory: string;
7
+    base?: string;
8
+};
9
+//# sourceMappingURL=index.d.ts.map

+ 2
- 0
node_modules/@nodelib/fs.walk/out/types/index.js View File

@@ -0,0 +1,2 @@
1
+"use strict";
2
+Object.defineProperty(exports, "__esModule", { value: true });

+ 64
- 0
node_modules/@nodelib/fs.walk/package.json View File

@@ -0,0 +1,64 @@
1
+{
2
+  "_from": "@nodelib/fs.walk@^1.2.3",
3
+  "_id": "@nodelib/fs.walk@1.2.4",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==",
6
+  "_location": "/@nodelib/fs.walk",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@nodelib/fs.walk@^1.2.3",
12
+    "name": "@nodelib/fs.walk",
13
+    "escapedName": "@nodelib%2ffs.walk",
14
+    "scope": "@nodelib",
15
+    "rawSpec": "^1.2.3",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^1.2.3"
18
+  },
19
+  "_requiredBy": [
20
+    "/fast-glob"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz",
23
+  "_shasum": "011b9202a70a6366e436ca5c065844528ab04976",
24
+  "_spec": "@nodelib/fs.walk@^1.2.3",
25
+  "_where": "/Users/christian/Documents/artesanias/node_modules/fast-glob",
26
+  "bundleDependencies": false,
27
+  "dependencies": {
28
+    "@nodelib/fs.scandir": "2.1.3",
29
+    "fastq": "^1.6.0"
30
+  },
31
+  "deprecated": false,
32
+  "description": "A library for efficiently walking a directory recursively",
33
+  "engines": {
34
+    "node": ">= 8"
35
+  },
36
+  "gitHead": "3b1ef7554ad7c061b3580858101d483fba847abf",
37
+  "keywords": [
38
+    "NodeLib",
39
+    "fs",
40
+    "FileSystem",
41
+    "file system",
42
+    "walk",
43
+    "scanner",
44
+    "crawler"
45
+  ],
46
+  "license": "MIT",
47
+  "main": "out/index.js",
48
+  "name": "@nodelib/fs.walk",
49
+  "repository": {
50
+    "type": "git",
51
+    "url": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk"
52
+  },
53
+  "scripts": {
54
+    "build": "npm run clean && npm run compile && npm run lint && npm test",
55
+    "clean": "rimraf {tsconfig.tsbuildinfo,out}",
56
+    "compile": "tsc -b .",
57
+    "compile:watch": "tsc -p . --watch --sourceMap",
58
+    "lint": "eslint \"src/**/*.ts\" --cache",
59
+    "test": "mocha \"out/**/*.spec.js\" -s 0",
60
+    "watch": "npm run clean && npm run compile:watch"
61
+  },
62
+  "typings": "out/index.d.ts",
63
+  "version": "1.2.4"
64
+}

+ 6
- 0
node_modules/assert-plus/AUTHORS View File

@@ -0,0 +1,6 @@
1
+Dave Eddy <dave@daveeddy.com>
2
+Fred Kuo <fred.kuo@joyent.com>
3
+Lars-Magnus Skog <ralphtheninja@riseup.net>
4
+Mark Cavage <mcavage@gmail.com>
5
+Patrick Mooney <pmooney@pfmooney.com>
6
+Rob Gulewich <robert.gulewich@joyent.com>

+ 14
- 0
node_modules/assert-plus/CHANGES.md View File

@@ -0,0 +1,14 @@
1
+# assert-plus Changelog
2
+
3
+## 1.0.0
4
+
5
+- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input
6
+- Add assert.finite check.  Previous assert.number callers should use this if
7
+  they expect Infinity inputs to throw.
8
+
9
+## 0.2.0
10
+
11
+- Fix `assert.object(null)` so it throws
12
+- Fix optional/arrayOf exports for non-type-of asserts
13
+- Add optiona/arrayOf exports for Stream/Date/Regex/uuid
14
+- Add basic unit test coverage

+ 162
- 0
node_modules/assert-plus/README.md View File

@@ -0,0 +1,162 @@
1
+# assert-plus
2
+
3
+This library is a super small wrapper over node's assert module that has two
4
+things: (1) the ability to disable assertions with the environment variable
5
+NODE\_NDEBUG, and (2) some API wrappers for argument testing.  Like
6
+`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks
7
+like this:
8
+
9
+```javascript
10
+    var assert = require('assert-plus');
11
+
12
+    function fooAccount(options, callback) {
13
+        assert.object(options, 'options');
14
+        assert.number(options.id, 'options.id');
15
+        assert.bool(options.isManager, 'options.isManager');
16
+        assert.string(options.name, 'options.name');
17
+        assert.arrayOfString(options.email, 'options.email');
18
+        assert.func(callback, 'callback');
19
+
20
+        // Do stuff
21
+        callback(null, {});
22
+    }
23
+```
24
+
25
+# API
26
+
27
+All methods that *aren't* part of node's core assert API are simply assumed to
28
+take an argument, and then a string 'name' that's not a message; `AssertionError`
29
+will be thrown if the assertion fails with a message like:
30
+
31
+    AssertionError: foo (string) is required
32
+    at test (/home/mark/work/foo/foo.js:3:9)
33
+    at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
34
+    at Module._compile (module.js:446:26)
35
+    at Object..js (module.js:464:10)
36
+    at Module.load (module.js:353:31)
37
+    at Function._load (module.js:311:12)
38
+    at Array.0 (module.js:484:10)
39
+    at EventEmitter._tickCallback (node.js:190:38)
40
+
41
+from:
42
+
43
+```javascript
44
+    function test(foo) {
45
+        assert.string(foo, 'foo');
46
+    }
47
+```
48
+
49
+There you go.  You can check that arrays are of a homogeneous type with `Arrayof$Type`:
50
+
51
+```javascript
52
+    function test(foo) {
53
+        assert.arrayOfString(foo, 'foo');
54
+    }
55
+```
56
+
57
+You can assert IFF an argument is not `undefined` (i.e., an optional arg):
58
+
59
+```javascript
60
+    assert.optionalString(foo, 'foo');
61
+```
62
+
63
+Lastly, you can opt-out of assertion checking altogether by setting the
64
+environment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have
65
+lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
66
+production.  Be advised:  The standard functions re-exported from `assert` are
67
+also disabled in assert-plus if NDEBUG is specified.  Using them directly from
68
+the `assert` module avoids this behavior.
69
+
70
+The complete list of APIs is:
71
+
72
+* assert.array
73
+* assert.bool
74
+* assert.buffer
75
+* assert.func
76
+* assert.number
77
+* assert.finite
78
+* assert.object
79
+* assert.string
80
+* assert.stream
81
+* assert.date
82
+* assert.regexp
83
+* assert.uuid
84
+* assert.arrayOfArray
85
+* assert.arrayOfBool
86
+* assert.arrayOfBuffer
87
+* assert.arrayOfFunc
88
+* assert.arrayOfNumber
89
+* assert.arrayOfFinite
90
+* assert.arrayOfObject
91
+* assert.arrayOfString
92
+* assert.arrayOfStream
93
+* assert.arrayOfDate
94
+* assert.arrayOfRegexp
95
+* assert.arrayOfUuid
96
+* assert.optionalArray
97
+* assert.optionalBool
98
+* assert.optionalBuffer
99
+* assert.optionalFunc
100
+* assert.optionalNumber
101
+* assert.optionalFinite
102
+* assert.optionalObject
103
+* assert.optionalString
104
+* assert.optionalStream
105
+* assert.optionalDate
106
+* assert.optionalRegexp
107
+* assert.optionalUuid
108
+* assert.optionalArrayOfArray
109
+* assert.optionalArrayOfBool
110
+* assert.optionalArrayOfBuffer
111
+* assert.optionalArrayOfFunc
112
+* assert.optionalArrayOfNumber
113
+* assert.optionalArrayOfFinite
114
+* assert.optionalArrayOfObject
115
+* assert.optionalArrayOfString
116
+* assert.optionalArrayOfStream
117
+* assert.optionalArrayOfDate
118
+* assert.optionalArrayOfRegexp
119
+* assert.optionalArrayOfUuid
120
+* assert.AssertionError
121
+* assert.fail
122
+* assert.ok
123
+* assert.equal
124
+* assert.notEqual
125
+* assert.deepEqual
126
+* assert.notDeepEqual
127
+* assert.strictEqual
128
+* assert.notStrictEqual
129
+* assert.throws
130
+* assert.doesNotThrow
131
+* assert.ifError
132
+
133
+# Installation
134
+
135
+    npm install assert-plus
136
+
137
+## License
138
+
139
+The MIT License (MIT)
140
+Copyright (c) 2012 Mark Cavage
141
+
142
+Permission is hereby granted, free of charge, to any person obtaining a copy of
143
+this software and associated documentation files (the "Software"), to deal in
144
+the Software without restriction, including without limitation the rights to
145
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
146
+the Software, and to permit persons to whom the Software is furnished to do so,
147
+subject to the following conditions:
148
+
149
+The above copyright notice and this permission notice shall be included in all
150
+copies or substantial portions of the Software.
151
+
152
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
153
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
154
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
155
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
156
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
157
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
158
+SOFTWARE.
159
+
160
+## Bugs
161
+
162
+See <https://github.com/mcavage/node-assert-plus/issues>.

+ 211
- 0
node_modules/assert-plus/assert.js View File

@@ -0,0 +1,211 @@
1
+// Copyright (c) 2012, Mark Cavage. All rights reserved.
2
+// Copyright 2015 Joyent, Inc.
3
+
4
+var assert = require('assert');
5
+var Stream = require('stream').Stream;
6
+var util = require('util');
7
+
8
+
9
+///--- Globals
10
+
11
+/* JSSTYLED */
12
+var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
13
+
14
+
15
+///--- Internal
16
+
17
+function _capitalize(str) {
18
+    return (str.charAt(0).toUpperCase() + str.slice(1));
19
+}
20
+
21
+function _toss(name, expected, oper, arg, actual) {
22
+    throw new assert.AssertionError({
23
+        message: util.format('%s (%s) is required', name, expected),
24
+        actual: (actual === undefined) ? typeof (arg) : actual(arg),
25
+        expected: expected,
26
+        operator: oper || '===',
27
+        stackStartFunction: _toss.caller
28
+    });
29
+}
30
+
31
+function _getClass(arg) {
32
+    return (Object.prototype.toString.call(arg).slice(8, -1));
33
+}
34
+
35
+function noop() {
36
+    // Why even bother with asserts?
37
+}
38
+
39
+
40
+///--- Exports
41
+
42
+var types = {
43
+    bool: {
44
+        check: function (arg) { return typeof (arg) === 'boolean'; }
45
+    },
46
+    func: {
47
+        check: function (arg) { return typeof (arg) === 'function'; }
48
+    },
49
+    string: {
50
+        check: function (arg) { return typeof (arg) === 'string'; }
51
+    },
52
+    object: {
53
+        check: function (arg) {
54
+            return typeof (arg) === 'object' && arg !== null;
55
+        }
56
+    },
57
+    number: {
58
+        check: function (arg) {
59
+            return typeof (arg) === 'number' && !isNaN(arg);
60
+        }
61
+    },
62
+    finite: {
63
+        check: function (arg) {
64
+            return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
65
+        }
66
+    },
67
+    buffer: {
68
+        check: function (arg) { return Buffer.isBuffer(arg); },
69
+        operator: 'Buffer.isBuffer'
70
+    },
71
+    array: {
72
+        check: function (arg) { return Array.isArray(arg); },
73
+        operator: 'Array.isArray'
74
+    },
75
+    stream: {
76
+        check: function (arg) { return arg instanceof Stream; },
77
+        operator: 'instanceof',
78
+        actual: _getClass
79
+    },
80
+    date: {
81
+        check: function (arg) { return arg instanceof Date; },
82
+        operator: 'instanceof',
83
+        actual: _getClass
84
+    },
85
+    regexp: {
86
+        check: function (arg) { return arg instanceof RegExp; },
87
+        operator: 'instanceof',
88
+        actual: _getClass
89
+    },
90
+    uuid: {
91
+        check: function (arg) {
92
+            return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
93
+        },
94
+        operator: 'isUUID'
95
+    }
96
+};
97
+
98
+function _setExports(ndebug) {
99
+    var keys = Object.keys(types);
100
+    var out;
101
+
102
+    /* re-export standard assert */
103
+    if (process.env.NODE_NDEBUG) {
104
+        out = noop;
105
+    } else {
106
+        out = function (arg, msg) {
107
+            if (!arg) {
108
+                _toss(msg, 'true', arg);
109
+            }
110
+        };
111
+    }
112
+
113
+    /* standard checks */
114
+    keys.forEach(function (k) {
115
+        if (ndebug) {
116
+            out[k] = noop;
117
+            return;
118
+        }
119
+        var type = types[k];
120
+        out[k] = function (arg, msg) {
121
+            if (!type.check(arg)) {
122
+                _toss(msg, k, type.operator, arg, type.actual);
123
+            }
124
+        };
125
+    });
126
+
127
+    /* optional checks */
128
+    keys.forEach(function (k) {
129
+        var name = 'optional' + _capitalize(k);
130
+        if (ndebug) {
131
+            out[name] = noop;
132
+            return;
133
+        }
134
+        var type = types[k];
135
+        out[name] = function (arg, msg) {
136
+            if (arg === undefined || arg === null) {
137
+                return;
138
+            }
139
+            if (!type.check(arg)) {
140
+                _toss(msg, k, type.operator, arg, type.actual);
141
+            }
142
+        };
143
+    });
144
+
145
+    /* arrayOf checks */
146
+    keys.forEach(function (k) {
147
+        var name = 'arrayOf' + _capitalize(k);
148
+        if (ndebug) {
149
+            out[name] = noop;
150
+            return;
151
+        }
152
+        var type = types[k];
153
+        var expected = '[' + k + ']';
154
+        out[name] = function (arg, msg) {
155
+            if (!Array.isArray(arg)) {
156
+                _toss(msg, expected, type.operator, arg, type.actual);
157
+            }
158
+            var i;
159
+            for (i = 0; i < arg.length; i++) {
160
+                if (!type.check(arg[i])) {
161
+                    _toss(msg, expected, type.operator, arg, type.actual);
162
+                }
163
+            }
164
+        };
165
+    });
166
+
167
+    /* optionalArrayOf checks */
168
+    keys.forEach(function (k) {
169
+        var name = 'optionalArrayOf' + _capitalize(k);
170
+        if (ndebug) {
171
+            out[name] = noop;
172
+            return;
173
+        }
174
+        var type = types[k];
175
+        var expected = '[' + k + ']';
176
+        out[name] = function (arg, msg) {
177
+            if (arg === undefined || arg === null) {
178
+                return;
179
+            }
180
+            if (!Array.isArray(arg)) {
181
+                _toss(msg, expected, type.operator, arg, type.actual);
182
+            }
183
+            var i;
184
+            for (i = 0; i < arg.length; i++) {
185
+                if (!type.check(arg[i])) {
186
+                    _toss(msg, expected, type.operator, arg, type.actual);
187
+                }
188
+            }
189
+        };
190
+    });
191
+
192
+    /* re-export built-in assertions */
193
+    Object.keys(assert).forEach(function (k) {
194
+        if (k === 'AssertionError') {
195
+            out[k] = assert[k];
196
+            return;
197
+        }
198
+        if (ndebug) {
199
+            out[k] = noop;
200
+            return;
201
+        }
202
+        out[k] = assert[k];
203
+    });
204
+
205
+    /* export ourselves (for unit tests _only_) */
206
+    out._setExports = _setExports;
207
+
208
+    return out;
209
+}
210
+
211
+module.exports = _setExports(process.env.NODE_NDEBUG);

+ 82
- 0
node_modules/assert-plus/package.json View File

@@ -0,0 +1,82 @@
1
+{
2
+  "_from": "assert-plus@^1.0.0",
3
+  "_id": "assert-plus@1.0.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
6
+  "_location": "/assert-plus",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "assert-plus@^1.0.0",
12
+    "name": "assert-plus",
13
+    "escapedName": "assert-plus",
14
+    "rawSpec": "^1.0.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.0.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/@netflix/nerror"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
22
+  "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
23
+  "_spec": "assert-plus@^1.0.0",
24
+  "_where": "/Users/christian/Documents/artesanias/node_modules/@netflix/nerror",
25
+  "author": {
26
+    "name": "Mark Cavage",
27
+    "email": "mcavage@gmail.com"
28
+  },
29
+  "bugs": {
30
+    "url": "https://github.com/mcavage/node-assert-plus/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "contributors": [
34
+    {
35
+      "name": "Dave Eddy",
36
+      "email": "dave@daveeddy.com"
37
+    },
38
+    {
39
+      "name": "Fred Kuo",
40
+      "email": "fred.kuo@joyent.com"
41
+    },
42
+    {
43
+      "name": "Lars-Magnus Skog",
44
+      "email": "ralphtheninja@riseup.net"
45
+    },
46
+    {
47
+      "name": "Mark Cavage",
48
+      "email": "mcavage@gmail.com"
49
+    },
50
+    {
51
+      "name": "Patrick Mooney",
52
+      "email": "pmooney@pfmooney.com"
53
+    },
54
+    {
55
+      "name": "Rob Gulewich",
56
+      "email": "robert.gulewich@joyent.com"
57
+    }
58
+  ],
59
+  "dependencies": {},
60
+  "deprecated": false,
61
+  "description": "Extra assertions on top of node's assert module",
62
+  "devDependencies": {
63
+    "faucet": "0.0.1",
64
+    "tape": "4.2.2"
65
+  },
66
+  "engines": {
67
+    "node": ">=0.8"
68
+  },
69
+  "homepage": "https://github.com/mcavage/node-assert-plus#readme",
70
+  "license": "MIT",
71
+  "main": "./assert.js",
72
+  "name": "assert-plus",
73
+  "optionalDependencies": {},
74
+  "repository": {
75
+    "type": "git",
76
+    "url": "git+https://github.com/mcavage/node-assert-plus.git"
77
+  },
78
+  "scripts": {
79
+    "test": "tape tests/*.js | ./node_modules/.bin/faucet"
80
+  },
81
+  "version": "1.0.0"
82
+}

+ 6
- 0
node_modules/at-least-node/LICENSE View File

@@ -0,0 +1,6 @@
1
+The ISC License
2
+Copyright (c) 2020 Ryan Zimmerman <opensrc@ryanzim.com>
3
+
4
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
5
+
6
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+ 25
- 0
node_modules/at-least-node/README.md View File

@@ -0,0 +1,25 @@
1
+# at-least-node
2
+
3
+![npm](https://img.shields.io/npm/v/at-least-node)
4
+![node](https://img.shields.io/node/v/at-least-node)
5
+![NPM](https://img.shields.io/npm/l/at-least-node)
6
+
7
+Sometimes you need to check if you're on _at least_ a given Node.js version, but you don't want to pull in the whole [`semver`](https://www.npmjs.com/package/semver) kitchen sink. That's what `at-least-node` is for.
8
+
9
+| Package         | Size    |
10
+| --------------- | ------- |
11
+| `at-least-node` | 2.6 kB  |
12
+| `semver`        | 75.5 kB |
13
+
14
+```js
15
+const atLeastNode = require('at-least-node')
16
+atLeastNode('10.12.0')
17
+// -> true on Node 10.12.0+, false on anything below that
18
+```
19
+
20
+When passing in a version string:
21
+
22
+- You cannot include a leading `v` (i.e. `v10.12.0`)
23
+- You cannot omit sections (i.e. `10.12`)
24
+- You cannot use pre-releases (i.e. `1.0.0-beta`)
25
+- There is no input validation, if you make a mistake, the resulting behavior is undefined

+ 5
- 0
node_modules/at-least-node/index.js View File

@@ -0,0 +1,5 @@
1
+module.exports = r => {
2
+  const n = process.versions.node.split('.').map(x => parseInt(x, 10))
3
+  r = r.split('.').map(x => parseInt(x, 10))
4
+  return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2])))
5
+}

+ 60
- 0
node_modules/at-least-node/package.json View File

@@ -0,0 +1,60 @@
1
+{
2
+  "_from": "at-least-node@^1.0.0",
3
+  "_id": "at-least-node@1.0.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
6
+  "_location": "/at-least-node",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "at-least-node@^1.0.0",
12
+    "name": "at-least-node",
13
+    "escapedName": "at-least-node",
14
+    "rawSpec": "^1.0.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.0.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/cordova-ios/fs-extra"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
22
+  "_shasum": "602cd4b46e844ad4effc92a8011a3c46e0238dc2",
23
+  "_spec": "at-least-node@^1.0.0",
24
+  "_where": "/Users/christian/Documents/artesanias/node_modules/cordova-ios/node_modules/fs-extra",
25
+  "author": {
26
+    "name": "Ryan Zimmerman",
27
+    "email": "opensrc@ryanzim.com"
28
+  },
29
+  "bugs": {
30
+    "url": "https://github.com/RyanZim/at-least-node/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "deprecated": false,
34
+  "description": "Lightweight Node.js version sniffing/comparison",
35
+  "devDependencies": {
36
+    "ava": "^3.1.0",
37
+    "rewire": "^4.0.1",
38
+    "semver": "^7.1.2"
39
+  },
40
+  "engines": {
41
+    "node": ">= 4.0.0"
42
+  },
43
+  "files": [],
44
+  "homepage": "https://github.com/RyanZim/at-least-node#readme",
45
+  "keywords": [
46
+    "semver",
47
+    "feature"
48
+  ],
49
+  "license": "ISC",
50
+  "main": "index.js",
51
+  "name": "at-least-node",
52
+  "repository": {
53
+    "type": "git",
54
+    "url": "git+https://github.com/RyanZim/at-least-node.git"
55
+  },
56
+  "scripts": {
57
+    "test": "ava"
58
+  },
59
+  "version": "1.0.0"
60
+}

+ 18
- 0
node_modules/bplist-creator/LICENSE View File

@@ -0,0 +1,18 @@
1
+(The MIT License)
2
+
3
+Copyright (c) 2012 Near Infinity Corporation
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
6
+and associated documentation files (the "Software"), to deal in the Software without restriction,
7
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9
+subject to the following conditions:
10
+
11
+The above copyright notice and this permission notice shall be included in all copies or substantial 
12
+portions of the Software.
13
+
14
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
18
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 64
- 0
node_modules/bplist-creator/README.md View File

@@ -0,0 +1,64 @@
1
+bplist-creator
2
+==============
3
+
4
+Binary Mac OS X Plist (property list) creator.
5
+
6
+## Installation
7
+
8
+```bash
9
+$ npm install bplist-creator
10
+```
11
+
12
+## Quick Examples
13
+
14
+```javascript
15
+var bplist = require('bplist-creator');
16
+
17
+var buffer = bplist({
18
+  key1: [1, 2, 3]
19
+});
20
+```
21
+
22
+## Real/Double/Float handling
23
+
24
+Javascript don't have different types for `1` and `1.0`. This package
25
+will automatically store numbers as the appropriate type, but can't
26
+detect floats that is also integers.
27
+
28
+If you need to force a value to be written with the `real` type pass
29
+an instance of `Real`.
30
+
31
+```javascript
32
+var buffer = bplist({
33
+  backgroundRed: new bplist.Real(1),
34
+  backgroundGreen: new bplist.Real(0),
35
+  backgroundBlue: new bplist.Real(0)
36
+});
37
+```
38
+
39
+In `xml` the corresponding tags is `<integer>` and `<real>`.
40
+
41
+## License
42
+
43
+(The MIT License)
44
+
45
+Copyright (c) 2012 Near Infinity Corporation
46
+
47
+Permission is hereby granted, free of charge, to any person obtaining
48
+a copy of this software and associated documentation files (the
49
+"Software"), to deal in the Software without restriction, including
50
+without limitation the rights to use, copy, modify, merge, publish,
51
+distribute, sublicense, and/or sell copies of the Software, and to
52
+permit persons to whom the Software is furnished to do so, subject to
53
+the following conditions:
54
+
55
+The above copyright notice and this permission notice shall be
56
+included in all copies or substantial portions of the Software.
57
+
58
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
59
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
61
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
62
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
63
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
64
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 456
- 0
node_modules/bplist-creator/bplistCreator.js View File

@@ -0,0 +1,456 @@
1
+'use strict';
2
+
3
+// adapted from http://code.google.com/p/plist/source/browse/trunk/src/main/java/com/dd/plist/BinaryPropertyListWriter.java
4
+
5
+var streamBuffers = require("stream-buffers");
6
+
7
+var debug = false;
8
+
9
+function Real(value) {
10
+  this.value = value;
11
+}
12
+
13
+module.exports = function(dicts) {
14
+  var buffer = new streamBuffers.WritableStreamBuffer();
15
+  buffer.write(new Buffer("bplist00"));
16
+
17
+  if (debug) {
18
+    console.log('create', require('util').inspect(dicts, false, 10));
19
+  }
20
+
21
+  if (dicts instanceof Array && dicts.length === 1) {
22
+    dicts = dicts[0];
23
+  }
24
+
25
+  var entries = toEntries(dicts);
26
+  if (debug) {
27
+    console.log('entries', entries);
28
+  }
29
+  var idSizeInBytes = computeIdSizeInBytes(entries.length);
30
+  var offsets = [];
31
+  var offsetSizeInBytes;
32
+  var offsetTableOffset;
33
+
34
+  updateEntryIds();
35
+
36
+  entries.forEach(function(entry, entryIdx) {
37
+    offsets[entryIdx] = buffer.size();
38
+    if (!entry) {
39
+      buffer.write(0x00);
40
+    } else {
41
+      write(entry);
42
+    }
43
+  });
44
+
45
+  writeOffsetTable();
46
+  writeTrailer();
47
+  return buffer.getContents();
48
+
49
+  function updateEntryIds() {
50
+    var strings = {};
51
+    var entryId = 0;
52
+    entries.forEach(function(entry) {
53
+      if (entry.id) {
54
+        return;
55
+      }
56
+      if (entry.type === 'string') {
57
+        if (!entry.bplistOverride && strings.hasOwnProperty(entry.value)) {
58
+          entry.type = 'stringref';
59
+          entry.id = strings[entry.value];
60
+        } else {
61
+          strings[entry.value] = entry.id = entryId++;
62
+        }
63
+      } else {
64
+        entry.id = entryId++;
65
+      }
66
+    });
67
+
68
+    entries = entries.filter(function(entry) {
69
+      return (entry.type !== 'stringref');
70
+    });
71
+  }
72
+
73
+  function writeTrailer() {
74
+    if (debug) {
75
+      console.log('0x' + buffer.size().toString(16), 'writeTrailer');
76
+    }
77
+    // 6 null bytes
78
+    buffer.write(new Buffer([0, 0, 0, 0, 0, 0]));
79
+
80
+    // size of an offset
81
+    if (debug) {
82
+      console.log('0x' + buffer.size().toString(16), 'writeTrailer(offsetSizeInBytes):', offsetSizeInBytes);
83
+    }
84
+    writeByte(offsetSizeInBytes);
85
+
86
+    // size of a ref
87
+    if (debug) {
88
+      console.log('0x' + buffer.size().toString(16), 'writeTrailer(offsetSizeInBytes):', idSizeInBytes);
89
+    }
90
+    writeByte(idSizeInBytes);
91
+
92
+    // number of objects
93
+    if (debug) {
94
+      console.log('0x' + buffer.size().toString(16), 'writeTrailer(number of objects):', entries.length);
95
+    }
96
+    writeLong(entries.length);
97
+
98
+    // top object
99
+    if (debug) {
100
+      console.log('0x' + buffer.size().toString(16), 'writeTrailer(top object)');
101
+    }
102
+    writeLong(0);
103
+
104
+    // offset table offset
105
+    if (debug) {
106
+      console.log('0x' + buffer.size().toString(16), 'writeTrailer(offset table offset):', offsetTableOffset);
107
+    }
108
+    writeLong(offsetTableOffset);
109
+  }
110
+
111
+  function writeOffsetTable() {
112
+    if (debug) {
113
+      console.log('0x' + buffer.size().toString(16), 'writeOffsetTable');
114
+    }
115
+    offsetTableOffset = buffer.size();
116
+    offsetSizeInBytes = computeOffsetSizeInBytes(offsetTableOffset);
117
+    offsets.forEach(function(offset) {
118
+      writeBytes(offset, offsetSizeInBytes);
119
+    });
120
+  }
121
+
122
+  function write(entry) {
123
+    switch (entry.type) {
124
+    case 'dict':
125
+      writeDict(entry);
126
+      break;
127
+    case 'number':
128
+    case 'double':
129
+      writeNumber(entry);
130
+      break;
131
+    case 'UID':
132
+      writeUID(entry);
133
+      break;
134
+    case 'array':
135
+      writeArray(entry);
136
+      break;
137
+    case 'boolean':
138
+      writeBoolean(entry);
139
+      break;
140
+    case 'string':
141
+    case 'string-utf16':
142
+      writeString(entry);
143
+      break;
144
+    case 'date':
145
+      writeDate(entry);
146
+      break;
147
+    case 'data':
148
+      writeData(entry);
149
+      break;
150
+    default:
151
+      throw new Error("unhandled entry type: " + entry.type);
152
+    }
153
+  }
154
+
155
+  function writeDate(entry) {
156
+    writeByte(0x33);
157
+    var date = (Date.parse(entry.value)/1000) - 978307200
158
+    writeDouble(date)
159
+  }
160
+
161
+  function writeDict(entry) {
162
+    if (debug) {
163
+      var keysStr = entry.entryKeys.map(function(k) {return k.id;});
164
+      var valsStr = entry.entryValues.map(function(k) {return k.id;});
165
+      console.log('0x' + buffer.size().toString(16), 'writeDict', '(id: ' + entry.id + ')', '(keys: ' + keysStr + ')', '(values: ' + valsStr + ')');
166
+    }
167
+    writeIntHeader(0xD, entry.entryKeys.length);
168
+    entry.entryKeys.forEach(function(entry) {
169
+      writeID(entry.id);
170
+    });
171
+    entry.entryValues.forEach(function(entry) {
172
+      writeID(entry.id);
173
+    });
174
+  }
175
+
176
+  function writeNumber(entry) {
177
+    if (debug) {
178
+      console.log('0x' + buffer.size().toString(16), 'writeNumber', entry.value, ' (type: ' + entry.type + ')', '(id: ' + entry.id + ')');
179
+    }
180
+
181
+    if (entry.type !== 'double' && parseFloat(entry.value.toFixed()) == entry.value) {
182
+      if (entry.value < 0) {
183
+        writeByte(0x13);
184
+        writeBytes(entry.value, 8, true);
185
+      } else if (entry.value <= 0xff) {
186
+        writeByte(0x10);
187
+        writeBytes(entry.value, 1);
188
+      } else if (entry.value <= 0xffff) {
189
+        writeByte(0x11);
190
+        writeBytes(entry.value, 2);
191
+      } else if (entry.value <= 0xffffffff) {
192
+        writeByte(0x12);
193
+        writeBytes(entry.value, 4);
194
+      } else {
195
+        writeByte(0x14);
196
+        writeBytes(entry.value, 8);
197
+      }
198
+    } else {
199
+      writeByte(0x23);
200
+      writeDouble(entry.value);
201
+    }
202
+  }
203
+
204
+  function writeUID(entry) {
205
+    if (debug) {
206
+      console.log('0x' + buffer.size().toString(16), 'writeUID', entry.value, ' (type: ' + entry.type + ')', '(id: ' + entry.id + ')');
207
+    }
208
+
209
+    writeIntHeader(0x8, 0x0);
210
+    writeID(entry.value);
211
+  }
212
+
213
+  function writeArray(entry) {
214
+    if (debug) {
215
+      console.log('0x' + buffer.size().toString(16), 'writeArray (length: ' + entry.entries.length + ')', '(id: ' + entry.id + ')');
216
+    }
217
+    writeIntHeader(0xA, entry.entries.length);
218
+    entry.entries.forEach(function(e) {
219
+      writeID(e.id);
220
+    });
221
+  }
222
+
223
+  function writeBoolean(entry) {
224
+    if (debug) {
225
+      console.log('0x' + buffer.size().toString(16), 'writeBoolean', entry.value, '(id: ' + entry.id + ')');
226
+    }
227
+    writeByte(entry.value ? 0x09 : 0x08);
228
+  }
229
+
230
+  function writeString(entry) {
231
+    if (debug) {
232
+      console.log('0x' + buffer.size().toString(16), 'writeString', entry.value, '(id: ' + entry.id + ')');
233
+    }
234
+    if (entry.type === 'string-utf16' || mustBeUtf16(entry.value)) {
235
+      var utf16 = new Buffer(entry.value, 'ucs2');
236
+      writeIntHeader(0x6, utf16.length / 2);
237
+      // needs to be big endian so swap the bytes
238
+      for (var i = 0; i < utf16.length; i += 2) {
239
+        var t = utf16[i + 0];
240
+        utf16[i + 0] = utf16[i + 1];
241
+        utf16[i + 1] = t;
242
+      }
243
+      buffer.write(utf16);
244
+    } else {
245
+      var utf8 = new Buffer(entry.value, 'ascii');
246
+      writeIntHeader(0x5, utf8.length);
247
+      buffer.write(utf8);
248
+    }
249
+  }
250
+
251
+  function writeData(entry) {
252
+    if (debug) {
253
+      console.log('0x' + buffer.size().toString(16), 'writeData', entry.value, '(id: ' + entry.id + ')');
254
+    }
255
+    writeIntHeader(0x4, entry.value.length);
256
+    buffer.write(entry.value);
257
+  }
258
+
259
+  function writeLong(l) {
260
+    writeBytes(l, 8);
261
+  }
262
+
263
+  function writeByte(b) {
264
+    buffer.write(new Buffer([b]));
265
+  }
266
+
267
+  function writeDouble(v) {
268
+    var buf = new Buffer(8);
269
+    buf.writeDoubleBE(v, 0);
270
+    buffer.write(buf);
271
+  }
272
+
273
+  function writeIntHeader(kind, value) {
274
+    if (value < 15) {
275
+      writeByte((kind << 4) + value);
276
+    } else if (value < 256) {
277
+      writeByte((kind << 4) + 15);
278
+      writeByte(0x10);
279
+      writeBytes(value, 1);
280
+    } else if (value < 65536) {
281
+      writeByte((kind << 4) + 15);
282
+      writeByte(0x11);
283
+      writeBytes(value, 2);
284
+    } else {
285
+      writeByte((kind << 4) + 15);
286
+      writeByte(0x12);
287
+      writeBytes(value, 4);
288
+    }
289
+  }
290
+
291
+  function writeID(id) {
292
+    writeBytes(id, idSizeInBytes);
293
+  }
294
+
295
+  function writeBytes(value, bytes, is_signedint) {
296
+    // write low-order bytes big-endian style
297
+    var buf = new Buffer(bytes);
298
+    var z = 0;
299
+
300
+    // javascript doesn't handle large numbers
301
+    if(!is_signedint) {
302
+      while (bytes > 4) {
303
+        buf[z++] = 0;
304
+        bytes--;
305
+      }
306
+    }
307
+
308
+    for (var i = bytes - 1; i >= 0; i--) {
309
+      buf[z++] = value >> (8 * i);
310
+    }
311
+    buffer.write(buf);
312
+  }
313
+
314
+  function mustBeUtf16(string) {
315
+    return Buffer.byteLength(string, 'utf8') != string.length;
316
+  }
317
+};
318
+
319
+function toEntries(dicts) {
320
+  if (dicts.bplistOverride) {
321
+    return [dicts];
322
+  }
323
+
324
+  if (dicts instanceof Array) {
325
+    return toEntriesArray(dicts);
326
+  } else if (dicts instanceof Buffer) {
327
+    return [
328
+      {
329
+        type: 'data',
330
+        value: dicts
331
+      }
332
+    ];
333
+  } else if (dicts instanceof Real) {
334
+    return [
335
+      {
336
+        type: 'double',
337
+        value: dicts.value
338
+      }
339
+    ];
340
+  } else if (typeof(dicts) === 'object') {
341
+    if (dicts instanceof Date) {
342
+      return [
343
+        {
344
+          type: 'date',
345
+          value: dicts
346
+        }
347
+      ]
348
+    } else if (Object.keys(dicts).length == 1 && typeof(dicts.UID) === 'number') {
349
+      return [
350
+        {
351
+          type: 'UID',
352
+          value: dicts.UID
353
+        }
354
+      ]
355
+    } else {
356
+      return toEntriesObject(dicts);
357
+    }
358
+  } else if (typeof(dicts) === 'string') {
359
+    return [
360
+      {
361
+        type: 'string',
362
+        value: dicts
363
+      }
364
+    ];
365
+  } else if (typeof(dicts) === 'number') {
366
+    return [
367
+      {
368
+        type: 'number',
369
+        value: dicts
370
+      }
371
+    ];
372
+  } else if (typeof(dicts) === 'boolean') {
373
+    return [
374
+      {
375
+        type: 'boolean',
376
+        value: dicts
377
+      }
378
+    ];
379
+  } else if (typeof(dicts) === 'bigint') {
380
+    return [
381
+      {
382
+        type: 'number',
383
+        value: Number(BigInt.asIntN(32, dicts))
384
+      }
385
+    ];
386
+  } else {
387
+    throw new Error('unhandled entry: ' + dicts);
388
+  }
389
+}
390
+
391
+function toEntriesArray(arr) {
392
+  if (debug) {
393
+    console.log('toEntriesArray');
394
+  }
395
+  var results = [
396
+    {
397
+      type: 'array',
398
+      entries: []
399
+    }
400
+  ];
401
+  arr.forEach(function(v) {
402
+    var entry = toEntries(v);
403
+    results[0].entries.push(entry[0]);
404
+    results = results.concat(entry);
405
+  });
406
+  return results;
407
+}
408
+
409
+function toEntriesObject(dict) {
410
+  if (debug) {
411
+    console.log('toEntriesObject');
412
+  }
413
+  var results = [
414
+    {
415
+      type: 'dict',
416
+      entryKeys: [],
417
+      entryValues: []
418
+    }
419
+  ];
420
+  Object.keys(dict).forEach(function(key) {
421
+    var entryKey = toEntries(key);
422
+    results[0].entryKeys.push(entryKey[0]);
423
+    results = results.concat(entryKey[0]);
424
+  });
425
+  Object.keys(dict).forEach(function(key) {
426
+    var entryValue = toEntries(dict[key]);
427
+    results[0].entryValues.push(entryValue[0]);
428
+    results = results.concat(entryValue);
429
+  });
430
+  return results;
431
+}
432
+
433
+function computeOffsetSizeInBytes(maxOffset) {
434
+  if (maxOffset < 256) {
435
+    return 1;
436
+  }
437
+  if (maxOffset < 65536) {
438
+    return 2;
439
+  }
440
+  if (maxOffset < 4294967296) {
441
+    return 4;
442
+  }
443
+  return 8;
444
+}
445
+
446
+function computeIdSizeInBytes(numberOfIds) {
447
+  if (numberOfIds < 256) {
448
+    return 1;
449
+  }
450
+  if (numberOfIds < 65536) {
451
+    return 2;
452
+  }
453
+  return 4;
454
+}
455
+
456
+module.exports.Real = Real;

+ 59
- 0
node_modules/bplist-creator/package.json View File

@@ -0,0 +1,59 @@
1
+{
2
+  "_from": "bplist-creator@0.0.8",
3
+  "_id": "bplist-creator@0.0.8",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==",
6
+  "_location": "/bplist-creator",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "version",
10
+    "registry": true,
11
+    "raw": "bplist-creator@0.0.8",
12
+    "name": "bplist-creator",
13
+    "escapedName": "bplist-creator",
14
+    "rawSpec": "0.0.8",
15
+    "saveSpec": null,
16
+    "fetchSpec": "0.0.8"
17
+  },
18
+  "_requiredBy": [
19
+    "/simple-plist"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz",
22
+  "_shasum": "56b2a6e79e9aec3fc33bf831d09347d73794e79c",
23
+  "_spec": "bplist-creator@0.0.8",
24
+  "_where": "/Users/christian/Documents/artesanias/node_modules/simple-plist",
25
+  "author": {
26
+    "name": "Joe Ferner"
27
+  },
28
+  "bugs": {
29
+    "url": "https://github.com/nearinfinity/node-bplist-creator/issues"
30
+  },
31
+  "bundleDependencies": false,
32
+  "dependencies": {
33
+    "stream-buffers": "~2.2.0"
34
+  },
35
+  "deprecated": false,
36
+  "description": "Binary Mac OS X Plist (property list) creator.",
37
+  "devDependencies": {
38
+    "bplist-parser": "~0.1.0",
39
+    "is-buffer": "1.1.4",
40
+    "nodeunit": "0.9.1"
41
+  },
42
+  "homepage": "https://github.com/nearinfinity/node-bplist-creator#readme",
43
+  "keywords": [
44
+    "bplist",
45
+    "plist",
46
+    "creator"
47
+  ],
48
+  "license": "MIT",
49
+  "main": "bplistCreator.js",
50
+  "name": "bplist-creator",
51
+  "repository": {
52
+    "type": "git",
53
+    "url": "git+https://github.com/nearinfinity/node-bplist-creator.git"
54
+  },
55
+  "scripts": {
56
+    "test": "./node_modules/nodeunit/bin/nodeunit test"
57
+  },
58
+  "version": "0.0.8"
59
+}

BIN
node_modules/bplist-creator/test/airplay.bplist View File


BIN
node_modules/bplist-creator/test/binaryData.bplist View File


+ 197
- 0
node_modules/bplist-creator/test/creatorTest.js View File

@@ -0,0 +1,197 @@
1
+'use strict';
2
+
3
+var fs = require('fs');
4
+var path = require('path');
5
+var nodeunit = require('nodeunit');
6
+var bplistParser = require('bplist-parser');
7
+var bplistCreator = require('../');
8
+
9
+module.exports = {
10
+//  'iTunes Small': function(test) {
11
+//    var file = path.join(__dirname, "iTunes-small.bplist");
12
+//    testFile(test, file);
13
+//  },
14
+
15
+  'sample1': function(test) {
16
+    var file = path.join(__dirname, "sample1.bplist");
17
+    testFile(test, file);
18
+  },
19
+
20
+  'sample2': function(test) {
21
+    var file = path.join(__dirname, "sample2.bplist");
22
+    testFile(test, file);
23
+  },
24
+
25
+  'binary data': function(test) {
26
+    var file = path.join(__dirname, "binaryData.bplist");
27
+    testFile(test, file);
28
+  },
29
+
30
+  'airplay': function(test) {
31
+    var file = path.join(__dirname, "airplay.bplist");
32
+    testFile(test, file);
33
+  },
34
+
35
+//  'utf16': function(test) {
36
+//    var file = path.join(__dirname, "utf16.bplist");
37
+//    testFile(test, file);
38
+//  },
39
+
40
+//  'uid': function(test) {
41
+//    var file = path.join(__dirname, "uid.bplist");
42
+//    testFile(test, file);
43
+//  }
44
+};
45
+
46
+function testFile(test, file) {
47
+  fs.readFile(file, function(err, fileData) {
48
+    if (err) {
49
+      return test.done(err);
50
+    }
51
+
52
+    bplistParser.parseFile(file, function(err, dicts) {
53
+      if (err) {
54
+        return test.done(err);
55
+      }
56
+
57
+      // airplay overrides
58
+      if (dicts && dicts[0] && dicts[0].loadedTimeRanges && dicts[0].loadedTimeRanges[0] && dicts[0].loadedTimeRanges[0].hasOwnProperty('start')) {
59
+        dicts[0].loadedTimeRanges[0].start = {
60
+          bplistOverride: true,
61
+          type: 'double',
62
+          value: dicts[0].loadedTimeRanges[0].start
63
+        };
64
+      }
65
+      if (dicts && dicts[0] && dicts[0].loadedTimeRanges && dicts[0].seekableTimeRanges[0] && dicts[0].seekableTimeRanges[0].hasOwnProperty('start')) {
66
+        dicts[0].seekableTimeRanges[0].start = {
67
+          bplistOverride: true,
68
+          type: 'double',
69
+          value: dicts[0].seekableTimeRanges[0].start
70
+        };
71
+      }
72
+      if (dicts && dicts[0] && dicts[0].hasOwnProperty('rate')) {
73
+        dicts[0].rate = {
74
+          bplistOverride: true,
75
+          type: 'double',
76
+          value: dicts[0].rate
77
+        };
78
+      }
79
+
80
+      // utf16
81
+      if (dicts && dicts[0] && dicts[0].hasOwnProperty('NSHumanReadableCopyright')) {
82
+        dicts[0].NSHumanReadableCopyright = {
83
+          bplistOverride: true,
84
+          type: 'string-utf16',
85
+          value: dicts[0].NSHumanReadableCopyright
86
+        };
87
+      }
88
+      if (dicts && dicts[0] && dicts[0].hasOwnProperty('CFBundleExecutable')) {
89
+        dicts[0].CFBundleExecutable = {
90
+          bplistOverride: true,
91
+          type: 'string',
92
+          value: dicts[0].CFBundleExecutable
93
+        };
94
+      }
95
+      if (dicts && dicts[0] && dicts[0].CFBundleURLTypes && dicts[0].CFBundleURLTypes[0] && dicts[0].CFBundleURLTypes[0].hasOwnProperty('CFBundleURLSchemes')) {
96
+        dicts[0].CFBundleURLTypes[0].CFBundleURLSchemes[0] = {
97
+          bplistOverride: true,
98
+          type: 'string',
99
+          value: dicts[0].CFBundleURLTypes[0].CFBundleURLSchemes[0]
100
+        };
101
+      }
102
+      if (dicts && dicts[0] && dicts[0].hasOwnProperty('CFBundleDisplayName')) {
103
+        dicts[0].CFBundleDisplayName = {
104
+          bplistOverride: true,
105
+          type: 'string',
106
+          value: dicts[0].CFBundleDisplayName
107
+        };
108
+      }
109
+      if (dicts && dicts[0] && dicts[0].hasOwnProperty('DTPlatformBuild')) {
110
+        dicts[0].DTPlatformBuild = {
111
+          bplistOverride: true,
112
+          type: 'string',
113
+          value: dicts[0].DTPlatformBuild
114
+        };
115
+      }
116
+
117
+      var buf = bplistCreator(dicts);
118
+      compareBuffers(test, buf, fileData);
119
+      return test.done();
120
+    });
121
+  });
122
+}
123
+
124
+function compareBuffers(test, buf1, buf2) {
125
+  if (buf1.length !== buf2.length) {
126
+    printBuffers(buf1, buf2);
127
+    return test.fail("buffer size mismatch. found: " + buf1.length + ", expected: " + buf2.length + ".");
128
+  }
129
+  for (var i = 0; i < buf1.length; i++) {
130
+    if (buf1[i] !== buf2[i]) {
131
+      printBuffers(buf1, buf2);
132
+      return test.fail("buffer mismatch at offset 0x" + i.toString(16) + ". found: 0x" + buf1[i].toString(16) + ", expected: 0x" + buf2[i].toString(16) + ".");
133
+    }
134
+  }
135
+}
136
+
137
+function printBuffers(buf1, buf2) {
138
+  var i, t;
139
+  for (var lineOffset = 0; lineOffset < buf1.length || lineOffset < buf2.length; lineOffset += 16) {
140
+    var line = '';
141
+
142
+    t = ('000000000' + lineOffset.toString(16));
143
+    line += t.substr(t.length - 8) + ': ';
144
+
145
+    for (i = 0; i < 16; i++) {
146
+      if (i == 8) {
147
+        line += ' ';
148
+      }
149
+      if (lineOffset + i < buf1.length) {
150
+        t = ('00' + buf1[lineOffset + i].toString(16));
151
+        line += t.substr(t.length - 2) + ' ';
152
+      } else {
153
+        line += '   ';
154
+      }
155
+    }
156
+    line += ' ';
157
+    for (i = 0; i < 16; i++) {
158
+      if (lineOffset + i < buf1.length) {
159
+        t = String.fromCharCode(buf1[lineOffset + i]);
160
+        if (t < ' ' || t > '~') {
161
+          t = '.';
162
+        }
163
+        line += t;
164
+      } else {
165
+        line += ' ';
166
+      }
167
+    }
168
+
169
+    line += ' - ';
170
+
171
+    for (i = 0; i < 16; i++) {
172
+      if (i == 8) {
173
+        line += ' ';
174
+      }
175
+      if (lineOffset + i < buf2.length) {
176
+        t = ('00' + buf2[lineOffset + i].toString(16));
177
+        line += t.substr(t.length - 2) + ' ';
178
+      } else {
179
+        line += '   ';
180
+      }
181
+    }
182
+    line += ' ';
183
+    for (i = 0; i < 16; i++) {
184
+      if (lineOffset + i < buf2.length) {
185
+        t = String.fromCharCode(buf2[lineOffset + i]);
186
+        if (t < ' ' || t > '~') {
187
+          t = '.';
188
+        }
189
+        line += t;
190
+      } else {
191
+        line += ' ';
192
+      }
193
+    }
194
+
195
+    console.log(line);
196
+  }
197
+}

BIN
node_modules/bplist-creator/test/iTunes-small.bplist View File


BIN
node_modules/bplist-creator/test/sample1.bplist View File


BIN
node_modules/bplist-creator/test/sample2.bplist View File


BIN
node_modules/bplist-creator/test/uid.bplist View File


BIN
node_modules/bplist-creator/test/utf16.bplist View File


+ 184
- 0
node_modules/braces/CHANGELOG.md View File

@@ -0,0 +1,184 @@
1
+# Release history
2
+
3
+All notable changes to this project will be documented in this file.
4
+
5
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+<details>
9
+  <summary><strong>Guiding Principles</strong></summary>
10
+
11
+- Changelogs are for humans, not machines.
12
+- There should be an entry for every single version.
13
+- The same types of changes should be grouped.
14
+- Versions and sections should be linkable.
15
+- The latest version comes first.
16
+- The release date of each versions is displayed.
17
+- Mention whether you follow Semantic Versioning.
18
+
19
+</details>
20
+
21
+<details>
22
+  <summary><strong>Types of changes</strong></summary>
23
+
24
+Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
25
+
26
+- `Added` for new features.
27
+- `Changed` for changes in existing functionality.
28
+- `Deprecated` for soon-to-be removed features.
29
+- `Removed` for now removed features.
30
+- `Fixed` for any bug fixes.
31
+- `Security` in case of vulnerabilities.
32
+
33
+</details>
34
+
35
+## [3.0.0] - 2018-04-08
36
+
37
+v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler. 
38
+
39
+**Breaking Changes**
40
+
41
+- The undocumented `.makeRe` method was removed
42
+
43
+**Non-breaking changes**
44
+
45
+- Caching was removed
46
+
47
+## [2.3.2] - 2018-04-08
48
+
49
+- start refactoring
50
+- cover sets
51
+- better range handling
52
+
53
+## [2.3.1] - 2018-02-17
54
+
55
+- Remove unnecessary escape in Regex. (#14)
56
+
57
+## [2.3.0] - 2017-10-19
58
+
59
+- minor code reorganization
60
+- optimize regex
61
+- expose `maxLength` option
62
+
63
+## [2.2.1] - 2017-05-30
64
+
65
+- don't condense when braces contain extglobs
66
+
67
+## [2.2.0] - 2017-05-28
68
+
69
+- ensure word boundaries are preserved
70
+- fixes edge case where extglob characters precede a brace pattern
71
+
72
+## [2.1.1] - 2017-04-27
73
+
74
+- use snapdragon-node
75
+- handle edge case
76
+- optimizations, lint
77
+
78
+## [2.0.4] - 2017-04-11
79
+
80
+- pass opts to compiler
81
+- minor optimization in create method
82
+- re-write parser handlers to remove negation regex
83
+
84
+## [2.0.3] - 2016-12-10
85
+
86
+- use split-string
87
+- clear queue at the end
88
+- adds sequences example
89
+- add unit tests
90
+
91
+## [2.0.2] - 2016-10-21
92
+
93
+- fix comma handling in nested extglobs
94
+
95
+## [2.0.1] - 2016-10-20
96
+
97
+- add comments
98
+- more tests, ensure quotes are stripped
99
+
100
+## [2.0.0] - 2016-10-19
101
+
102
+- don't expand braces inside character classes
103
+- add quantifier pattern
104
+
105
+## [1.8.5] - 2016-05-21
106
+
107
+- Refactor (#10)
108
+
109
+## [1.8.4] - 2016-04-20
110
+
111
+- fixes https://github.com/jonschlinkert/micromatch/issues/66
112
+
113
+## [1.8.0] - 2015-03-18
114
+
115
+- adds exponent examples, tests
116
+- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38
117
+
118
+## [1.6.0] - 2015-01-30
119
+
120
+- optimizations, `bash` mode:
121
+- improve path escaping
122
+
123
+## [1.5.0] - 2015-01-28
124
+
125
+- Merge pull request #5 from eush77/lib-files
126
+
127
+## [1.4.0] - 2015-01-24
128
+
129
+- add extglob tests
130
+- externalize exponent function
131
+- better whitespace handling
132
+
133
+## [1.3.0] - 2015-01-24
134
+
135
+- make regex patterns explicity
136
+
137
+## [1.1.0] - 2015-01-11
138
+
139
+- don't create a match group with `makeRe`
140
+
141
+## [1.0.0] - 2014-12-23
142
+
143
+- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e'
144
+- support empty brace syntax
145
+- better bash coverage
146
+- better support for regex strings
147
+
148
+## [0.1.4] - 2014-11-14
149
+
150
+- improve recognition of bad args, recognize mismatched argument types
151
+- support escaping
152
+- remove pathname-expansion
153
+- support whitespace in patterns
154
+
155
+## [0.1.0]
156
+
157
+- first commit
158
+
159
+[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2
160
+[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1
161
+[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0
162
+[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1
163
+[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0
164
+[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1
165
+[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0
166
+[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4
167
+[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3
168
+[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2
169
+[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1
170
+[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0
171
+[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5
172
+[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4
173
+[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0
174
+[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0
175
+[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0
176
+[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0
177
+[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0
178
+[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0
179
+[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0
180
+[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0
181
+[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4
182
+
183
+[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD
184
+[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog

+ 21
- 0
node_modules/braces/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2014-2018, Jon Schlinkert.
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.

+ 593
- 0
node_modules/braces/README.md View File

@@ -0,0 +1,593 @@
1
+# braces [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces)
2
+
3
+> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.
4
+
5
+Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
6
+
7
+## Install
8
+
9
+Install with [npm](https://www.npmjs.com/):
10
+
11
+```sh
12
+$ npm install --save braces
13
+```
14
+
15
+## v3.0.0 Released!!
16
+
17
+See the [changelog](CHANGELOG.md) for details.
18
+
19
+## Why use braces?
20
+
21
+Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters.
22
+
23
+* **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
24
+* **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
25
+* **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up.
26
+* **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written).
27
+* **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)).
28
+* [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
29
+* [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']`
30
+* [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']`
31
+* [Supports escaping](#escaping) - To prevent evaluation of special characters.
32
+
33
+## Usage
34
+
35
+The main export is a function that takes one or more brace `patterns` and `options`.
36
+
37
+```js
38
+const braces = require('braces');
39
+// braces(patterns[, options]);
40
+
41
+console.log(braces(['{01..05}', '{a..e}']));
42
+//=> ['(0[1-5])', '([a-e])']
43
+
44
+console.log(braces(['{01..05}', '{a..e}'], { expand: true }));
45
+//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e']
46
+```
47
+
48
+### Brace Expansion vs. Compilation
49
+
50
+By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching.
51
+
52
+**Compiled**
53
+
54
+```js
55
+console.log(braces('a/{x,y,z}/b')); 
56
+//=> ['a/(x|y|z)/b']
57
+console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); 
58
+//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ]
59
+```
60
+
61
+**Expanded**
62
+
63
+Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)):
64
+
65
+```js
66
+console.log(braces('a/{x,y,z}/b', { expand: true }));
67
+//=> ['a/x/b', 'a/y/b', 'a/z/b']
68
+
69
+console.log(braces.expand('{01..10}'));
70
+//=> ['01','02','03','04','05','06','07','08','09','10']
71
+```
72
+
73
+### Lists
74
+
75
+Expand lists (like Bash "sets"):
76
+
77
+```js
78
+console.log(braces('a/{foo,bar,baz}/*.js'));
79
+//=> ['a/(foo|bar|baz)/*.js']
80
+
81
+console.log(braces.expand('a/{foo,bar,baz}/*.js'));
82
+//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js']
83
+```
84
+
85
+### Sequences
86
+
87
+Expand ranges of characters (like Bash "sequences"):
88
+
89
+```js
90
+console.log(braces.expand('{1..3}'));                // ['1', '2', '3']
91
+console.log(braces.expand('a/{1..3}/b'));            // ['a/1/b', 'a/2/b', 'a/3/b']
92
+console.log(braces('{a..c}', { expand: true }));     // ['a', 'b', 'c']
93
+console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c']
94
+
95
+// supports zero-padded ranges
96
+console.log(braces('a/{01..03}/b'));   //=> ['a/(0[1-3])/b']
97
+console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b']
98
+```
99
+
100
+See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options.
101
+
102
+### Steppped ranges
103
+
104
+Steps, or increments, may be used with ranges:
105
+
106
+```js
107
+console.log(braces.expand('{2..10..2}'));
108
+//=> ['2', '4', '6', '8', '10']
109
+
110
+console.log(braces('{2..10..2}'));
111
+//=> ['(2|4|6|8|10)']
112
+```
113
+
114
+When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion.
115
+
116
+### Nesting
117
+
118
+Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved.
119
+
120
+**"Expanded" braces**
121
+
122
+```js
123
+console.log(braces.expand('a{b,c,/{x,y}}/e'));
124
+//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e']
125
+
126
+console.log(braces.expand('a/{x,{1..5},y}/c'));
127
+//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c']
128
+```
129
+
130
+**"Optimized" braces**
131
+
132
+```js
133
+console.log(braces('a{b,c,/{x,y}}/e'));
134
+//=> ['a(b|c|/(x|y))/e']
135
+
136
+console.log(braces('a/{x,{1..5},y}/c'));
137
+//=> ['a/(x|([1-5])|y)/c']
138
+```
139
+
140
+### Escaping
141
+
142
+**Escaping braces**
143
+
144
+A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_:
145
+
146
+```js
147
+console.log(braces.expand('a\\{d,c,b}e'));
148
+//=> ['a{d,c,b}e']
149
+
150
+console.log(braces.expand('a{d,c,b\\}e'));
151
+//=> ['a{d,c,b}e']
152
+```
153
+
154
+**Escaping commas**
155
+
156
+Commas inside braces may also be escaped:
157
+
158
+```js
159
+console.log(braces.expand('a{b\\,c}d'));
160
+//=> ['a{b,c}d']
161
+
162
+console.log(braces.expand('a{d\\,c,b}e'));
163
+//=> ['ad,ce', 'abe']
164
+```
165
+
166
+**Single items**
167
+
168
+Following bash conventions, a brace pattern is also not expanded when it contains a single character:
169
+
170
+```js
171
+console.log(braces.expand('a{b}c'));
172
+//=> ['a{b}c']
173
+```
174
+
175
+## Options
176
+
177
+### options.maxLength
178
+
179
+**Type**: `Number`
180
+
181
+**Default**: `65,536`
182
+
183
+**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera.
184
+
185
+```js
186
+console.log(braces('a/{b,c}/d', { maxLength: 3 }));  //=> throws an error
187
+```
188
+
189
+### options.expand
190
+
191
+**Type**: `Boolean`
192
+
193
+**Default**: `undefined`
194
+
195
+**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing).
196
+
197
+```js
198
+console.log(braces('a/{b,c}/d', { expand: true }));
199
+//=> [ 'a/b/d', 'a/c/d' ]
200
+```
201
+
202
+### options.nodupes
203
+
204
+**Type**: `Boolean`
205
+
206
+**Default**: `undefined`
207
+
208
+**Description**: Remove duplicates from the returned array.
209
+
210
+### options.rangeLimit
211
+
212
+**Type**: `Number`
213
+
214
+**Default**: `1000`
215
+
216
+**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`.
217
+
218
+You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether.
219
+
220
+**Examples**
221
+
222
+```js
223
+// pattern exceeds the "rangeLimit", so it's optimized automatically
224
+console.log(braces.expand('{1..1000}'));
225
+//=> ['([1-9]|[1-9][0-9]{1,2}|1000)']
226
+
227
+// pattern does not exceed "rangeLimit", so it's NOT optimized
228
+console.log(braces.expand('{1..100}'));
229
+//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100']
230
+```
231
+
232
+### options.transform
233
+
234
+**Type**: `Function`
235
+
236
+**Default**: `undefined`
237
+
238
+**Description**: Customize range expansion.
239
+
240
+**Example: Transforming non-numeric values**
241
+
242
+```js
243
+const alpha = braces.expand('x/{a..e}/y', {
244
+  transform(value, index) {
245
+    // When non-numeric values are passed, "value" is a character code.
246
+    return 'foo/' + String.fromCharCode(value) + '-' + index;
247
+  }
248
+});
249
+console.log(alpha);
250
+//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ]
251
+```
252
+
253
+**Example: Transforming numeric values**
254
+
255
+```js
256
+const numeric = braces.expand('{1..5}', {
257
+  transform(value) {
258
+    // when numeric values are passed, "value" is a number
259
+    return 'foo/' + value * 2;
260
+  }
261
+});
262
+console.log(numeric); 
263
+//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ]
264
+```
265
+
266
+### options.quantifiers
267
+
268
+**Type**: `Boolean`
269
+
270
+**Default**: `undefined`
271
+
272
+**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times.
273
+
274
+Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists)
275
+
276
+The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists.
277
+
278
+**Examples**
279
+
280
+```js
281
+const braces = require('braces');
282
+console.log(braces('a/b{1,3}/{x,y,z}'));
283
+//=> [ 'a/b(1|3)/(x|y|z)' ]
284
+console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true}));
285
+//=> [ 'a/b{1,3}/(x|y|z)' ]
286
+console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true}));
287
+//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ]
288
+```
289
+
290
+### options.unescape
291
+
292
+**Type**: `Boolean`
293
+
294
+**Default**: `undefined`
295
+
296
+**Description**: Strip backslashes that were used for escaping from the result.
297
+
298
+## What is "brace expansion"?
299
+
300
+Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs).
301
+
302
+In addition to "expansion", braces are also used for matching. In other words:
303
+
304
+* [brace expansion](#brace-expansion) is for generating new lists
305
+* [brace matching](#brace-matching) is for filtering existing lists
306
+
307
+<details>
308
+<summary><strong>More about brace expansion</strong> (click to expand)</summary>
309
+
310
+There are two main types of brace expansion:
311
+
312
+1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}`
313
+2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges".
314
+
315
+Here are some example brace patterns to illustrate how they work:
316
+
317
+**Sets**
318
+
319
+```
320
+{a,b,c}       => a b c
321
+{a,b,c}{1,2}  => a1 a2 b1 b2 c1 c2
322
+```
323
+
324
+**Sequences**
325
+
326
+```
327
+{1..9}        => 1 2 3 4 5 6 7 8 9
328
+{4..-4}       => 4 3 2 1 0 -1 -2 -3 -4
329
+{1..20..3}    => 1 4 7 10 13 16 19
330
+{a..j}        => a b c d e f g h i j
331
+{j..a}        => j i h g f e d c b a
332
+{a..z..3}     => a d g j m p s v y
333
+```
334
+
335
+**Combination**
336
+
337
+Sets and sequences can be mixed together or used along with any other strings.
338
+
339
+```
340
+{a,b,c}{1..3}   => a1 a2 a3 b1 b2 b3 c1 c2 c3
341
+foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar
342
+```
343
+
344
+The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases.
345
+
346
+## Brace matching
347
+
348
+In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching.
349
+
350
+For example, the pattern `foo/{1..3}/bar` would match any of following strings:
351
+
352
+```
353
+foo/1/bar
354
+foo/2/bar
355
+foo/3/bar
356
+```
357
+
358
+But not:
359
+
360
+```
361
+baz/1/qux
362
+baz/2/qux
363
+baz/3/qux
364
+```
365
+
366
+Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings:
367
+
368
+```
369
+foo/1/bar
370
+foo/2/bar
371
+foo/3/bar
372
+baz/1/qux
373
+baz/2/qux
374
+baz/3/qux
375
+```
376
+
377
+## Brace matching pitfalls
378
+
379
+Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of.
380
+
381
+### tldr
382
+
383
+**"brace bombs"**
384
+
385
+* brace expansion can eat up a huge amount of processing resources
386
+* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
387
+* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
388
+
389
+For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section.
390
+
391
+### The solution
392
+
393
+Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries.
394
+
395
+### Geometric complexity
396
+
397
+At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`.
398
+
399
+For example, the following sets demonstrate quadratic (`O(n^2)`) complexity:
400
+
401
+```
402
+{1,2}{3,4}      => (2X2)    => 13 14 23 24
403
+{1,2}{3,4}{5,6} => (2X2X2)  => 135 136 145 146 235 236 245 246
404
+```
405
+
406
+But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity:
407
+
408
+```
409
+{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 
410
+                                    249 257 258 259 267 268 269 347 348 349 357 
411
+                                    358 359 367 368 369
412
+```
413
+
414
+Now, imagine how this complexity grows given that each element is a n-tuple:
415
+
416
+```
417
+{1..100}{1..100}         => (100X100)     => 10,000 elements (38.4 kB)
418
+{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB)
419
+```
420
+
421
+Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control.
422
+
423
+**More information**
424
+
425
+Interested in learning more about brace expansion?
426
+
427
+* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
428
+* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
429
+* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
430
+
431
+</details>
432
+
433
+## Performance
434
+
435
+Braces is not only screaming fast, it's also more accurate the other brace expansion libraries.
436
+
437
+### Better algorithms
438
+
439
+Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_.
440
+
441
+Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently.
442
+
443
+**The proof is in the numbers**
444
+
445
+Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively.
446
+
447
+| **Pattern**                 | **braces**         | **[minimatch][]**            |
448
+| ---                         | ---                | ---                          |
449
+| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs)|  N/A (freezes)               |
450
+| `{1..1000000000000000}`     | `41 B` (1ms 15μs)  |  N/A (freezes)               |
451
+| `{1..100000000000000}`      | `40 B` (890μs)     |  N/A (freezes)               |
452
+| `{1..10000000000000}`       | `39 B` (2ms 49μs)  |  N/A (freezes)               |
453
+| `{1..1000000000000}`        | `38 B` (608μs)     |  N/A (freezes)               |
454
+| `{1..100000000000}`         | `37 B` (397μs)     |  N/A (freezes)               |
455
+| `{1..10000000000}`          | `35 B` (983μs)     |  N/A (freezes)               |
456
+| `{1..1000000000}`           | `34 B` (798μs)     |  N/A (freezes)               |
457
+| `{1..100000000}`            | `33 B` (733μs)     |  N/A (freezes)               |
458
+| `{1..10000000}`             | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) |
459
+| `{1..1000000}`              | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs)   |
460
+| `{1..100000}`               | `30 B` (950μs)     | `588.89 kB` (146ms 921μs)    |
461
+| `{1..10000}`                | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs)      |
462
+| `{1..1000}`                 | `28 B` (760μs)     | `3.89 kB` (1ms 453μs)        |
463
+| `{1..100}`                  | `22 B` (345μs)     | `291 B` (196μs)              |
464
+| `{1..10}`                   | `10 B` (533μs)     | `20 B` (37μs)                |
465
+| `{1..3}`                    | `7 B` (190μs)      | `5 B` (27μs)                 |
466
+
467
+### Faster algorithms
468
+
469
+When you need expansion, braces is still much faster.
470
+
471
+_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_
472
+
473
+| **Pattern**     | **braces**                  | **[minimatch][]**            |
474
+| ---             | ---                         | ---                          |
475
+| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) |
476
+| `{1..1000000}`  | `6.89 MB` (458ms 576μs)     | `6.89 MB` (1s 491ms 621μs)   |
477
+| `{1..100000}`   | `588.89 kB` (20ms 728μs)    | `588.89 kB` (156ms 919μs)    |
478
+| `{1..10000}`    | `48.89 kB` (2ms 202μs)      | `48.89 kB` (13ms 641μs)      |
479
+| `{1..1000}`     | `3.89 kB` (1ms 796μs)       | `3.89 kB` (1ms 958μs)        |
480
+| `{1..100}`      | `291 B` (424μs)             | `291 B` (211μs)              |
481
+| `{1..10}`       | `20 B` (487μs)              | `20 B` (72μs)                |
482
+| `{1..3}`        | `5 B` (166μs)               | `5 B` (27μs)                 |
483
+
484
+If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js).
485
+
486
+## Benchmarks
487
+
488
+### Running benchmarks
489
+
490
+Install dev dependencies:
491
+
492
+```bash
493
+npm i -d && npm benchmark
494
+```
495
+
496
+### Latest results
497
+
498
+Braces is more accurate, without sacrificing performance.
499
+
500
+```bash
501
+# range (expanded)
502
+  braces x 29,040 ops/sec ±3.69% (91 runs sampled))
503
+  minimatch x 4,735 ops/sec ±1.28% (90 runs sampled)
504
+
505
+# range (optimized for regex)
506
+  braces x 382,878 ops/sec ±0.56% (94 runs sampled)
507
+  minimatch x 1,040 ops/sec ±0.44% (93 runs sampled)
508
+
509
+# nested ranges (expanded)
510
+  braces x 19,744 ops/sec ±2.27% (92 runs sampled))
511
+  minimatch x 4,579 ops/sec ±0.50% (93 runs sampled)
512
+
513
+# nested ranges (optimized for regex)
514
+  braces x 246,019 ops/sec ±2.02% (93 runs sampled)
515
+  minimatch x 1,028 ops/sec ±0.39% (94 runs sampled)
516
+
517
+# set (expanded) 
518
+  braces x 138,641 ops/sec ±0.53% (95 runs sampled)
519
+  minimatch x 219,582 ops/sec ±0.98% (94 runs sampled)
520
+
521
+# set (optimized for regex)
522
+  braces x 388,408 ops/sec ±0.41% (95 runs sampled)
523
+  minimatch x 44,724 ops/sec ±0.91% (89 runs sampled)
524
+
525
+# nested sets (expanded)
526
+  braces x 84,966 ops/sec ±0.48% (94 runs sampled)
527
+  minimatch x 140,720 ops/sec ±0.37% (95 runs sampled)
528
+
529
+# nested sets (optimized for regex)
530
+  braces x 263,340 ops/sec ±2.06% (92 runs sampled)
531
+  minimatch x 28,714 ops/sec ±0.40% (90 runs sampled)
532
+```
533
+
534
+## About
535
+
536
+<details>
537
+<summary><strong>Contributing</strong></summary>
538
+
539
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
540
+
541
+</details>
542
+
543
+<details>
544
+<summary><strong>Running Tests</strong></summary>
545
+
546
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
547
+
548
+```sh
549
+$ npm install && npm test
550
+```
551
+
552
+</details>
553
+
554
+<details>
555
+<summary><strong>Building docs</strong></summary>
556
+
557
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
558
+
559
+To generate the readme, run the following command:
560
+
561
+```sh
562
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
563
+```
564
+
565
+</details>
566
+
567
+### Contributors
568
+
569
+| **Commits** | **Contributor** |  
570
+| --- | --- |  
571
+| 197 | [jonschlinkert](https://github.com/jonschlinkert) |  
572
+| 4   | [doowb](https://github.com/doowb) |  
573
+| 1   | [es128](https://github.com/es128) |  
574
+| 1   | [eush77](https://github.com/eush77) |  
575
+| 1   | [hemanth](https://github.com/hemanth) |  
576
+| 1   | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |  
577
+
578
+### Author
579
+
580
+**Jon Schlinkert**
581
+
582
+* [GitHub Profile](https://github.com/jonschlinkert)
583
+* [Twitter Profile](https://twitter.com/jonschlinkert)
584
+* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
585
+
586
+### License
587
+
588
+Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
589
+Released under the [MIT License](LICENSE).
590
+
591
+***
592
+
593
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._

+ 170
- 0
node_modules/braces/index.js View File

@@ -0,0 +1,170 @@
1
+'use strict';
2
+
3
+const stringify = require('./lib/stringify');
4
+const compile = require('./lib/compile');
5
+const expand = require('./lib/expand');
6
+const parse = require('./lib/parse');
7
+
8
+/**
9
+ * Expand the given pattern or create a regex-compatible string.
10
+ *
11
+ * ```js
12
+ * const braces = require('braces');
13
+ * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
14
+ * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
15
+ * ```
16
+ * @param {String} `str`
17
+ * @param {Object} `options`
18
+ * @return {String}
19
+ * @api public
20
+ */
21
+
22
+const braces = (input, options = {}) => {
23
+  let output = [];
24
+
25
+  if (Array.isArray(input)) {
26
+    for (let pattern of input) {
27
+      let result = braces.create(pattern, options);
28
+      if (Array.isArray(result)) {
29
+        output.push(...result);
30
+      } else {
31
+        output.push(result);
32
+      }
33
+    }
34
+  } else {
35
+    output = [].concat(braces.create(input, options));
36
+  }
37
+
38
+  if (options && options.expand === true && options.nodupes === true) {
39
+    output = [...new Set(output)];
40
+  }
41
+  return output;
42
+};
43
+
44
+/**
45
+ * Parse the given `str` with the given `options`.
46
+ *
47
+ * ```js
48
+ * // braces.parse(pattern, [, options]);
49
+ * const ast = braces.parse('a/{b,c}/d');
50
+ * console.log(ast);
51
+ * ```
52
+ * @param {String} pattern Brace pattern to parse
53
+ * @param {Object} options
54
+ * @return {Object} Returns an AST
55
+ * @api public
56
+ */
57
+
58
+braces.parse = (input, options = {}) => parse(input, options);
59
+
60
+/**
61
+ * Creates a braces string from an AST, or an AST node.
62
+ *
63
+ * ```js
64
+ * const braces = require('braces');
65
+ * let ast = braces.parse('foo/{a,b}/bar');
66
+ * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
67
+ * ```
68
+ * @param {String} `input` Brace pattern or AST.
69
+ * @param {Object} `options`
70
+ * @return {Array} Returns an array of expanded values.
71
+ * @api public
72
+ */
73
+
74
+braces.stringify = (input, options = {}) => {
75
+  if (typeof input === 'string') {
76
+    return stringify(braces.parse(input, options), options);
77
+  }
78
+  return stringify(input, options);
79
+};
80
+
81
+/**
82
+ * Compiles a brace pattern into a regex-compatible, optimized string.
83
+ * This method is called by the main [braces](#braces) function by default.
84
+ *
85
+ * ```js
86
+ * const braces = require('braces');
87
+ * console.log(braces.compile('a/{b,c}/d'));
88
+ * //=> ['a/(b|c)/d']
89
+ * ```
90
+ * @param {String} `input` Brace pattern or AST.
91
+ * @param {Object} `options`
92
+ * @return {Array} Returns an array of expanded values.
93
+ * @api public
94
+ */
95
+
96
+braces.compile = (input, options = {}) => {
97
+  if (typeof input === 'string') {
98
+    input = braces.parse(input, options);
99
+  }
100
+  return compile(input, options);
101
+};
102
+
103
+/**
104
+ * Expands a brace pattern into an array. This method is called by the
105
+ * main [braces](#braces) function when `options.expand` is true. Before
106
+ * using this method it's recommended that you read the [performance notes](#performance))
107
+ * and advantages of using [.compile](#compile) instead.
108
+ *
109
+ * ```js
110
+ * const braces = require('braces');
111
+ * console.log(braces.expand('a/{b,c}/d'));
112
+ * //=> ['a/b/d', 'a/c/d'];
113
+ * ```
114
+ * @param {String} `pattern` Brace pattern
115
+ * @param {Object} `options`
116
+ * @return {Array} Returns an array of expanded values.
117
+ * @api public
118
+ */
119
+
120
+braces.expand = (input, options = {}) => {
121
+  if (typeof input === 'string') {
122
+    input = braces.parse(input, options);
123
+  }
124
+
125
+  let result = expand(input, options);
126
+
127
+  // filter out empty strings if specified
128
+  if (options.noempty === true) {
129
+    result = result.filter(Boolean);
130
+  }
131
+
132
+  // filter out duplicates if specified
133
+  if (options.nodupes === true) {
134
+    result = [...new Set(result)];
135
+  }
136
+
137
+  return result;
138
+};
139
+
140
+/**
141
+ * Processes a brace pattern and returns either an expanded array
142
+ * (if `options.expand` is true), a highly optimized regex-compatible string.
143
+ * This method is called by the main [braces](#braces) function.
144
+ *
145
+ * ```js
146
+ * const braces = require('braces');
147
+ * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
148
+ * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
149
+ * ```
150
+ * @param {String} `pattern` Brace pattern
151
+ * @param {Object} `options`
152
+ * @return {Array} Returns an array of expanded values.
153
+ * @api public
154
+ */
155
+
156
+braces.create = (input, options = {}) => {
157
+  if (input === '' || input.length < 3) {
158
+    return [input];
159
+  }
160
+
161
+ return options.expand !== true
162
+    ? braces.compile(input, options)
163
+    : braces.expand(input, options);
164
+};
165
+
166
+/**
167
+ * Expose "braces"
168
+ */
169
+
170
+module.exports = braces;

+ 57
- 0
node_modules/braces/lib/compile.js View File

@@ -0,0 +1,57 @@
1
+'use strict';
2
+
3
+const fill = require('fill-range');
4
+const utils = require('./utils');
5
+
6
+const compile = (ast, options = {}) => {
7
+  let walk = (node, parent = {}) => {
8
+    let invalidBlock = utils.isInvalidBrace(parent);
9
+    let invalidNode = node.invalid === true && options.escapeInvalid === true;
10
+    let invalid = invalidBlock === true || invalidNode === true;
11
+    let prefix = options.escapeInvalid === true ? '\\' : '';
12
+    let output = '';
13
+
14
+    if (node.isOpen === true) {
15
+      return prefix + node.value;
16
+    }
17
+    if (node.isClose === true) {
18
+      return prefix + node.value;
19
+    }
20
+
21
+    if (node.type === 'open') {
22
+      return invalid ? (prefix + node.value) : '(';
23
+    }
24
+
25
+    if (node.type === 'close') {
26
+      return invalid ? (prefix + node.value) : ')';
27
+    }
28
+
29
+    if (node.type === 'comma') {
30
+      return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
31
+    }
32
+
33
+    if (node.value) {
34
+      return node.value;
35
+    }
36
+
37
+    if (node.nodes && node.ranges > 0) {
38
+      let args = utils.reduce(node.nodes);
39
+      let range = fill(...args, { ...options, wrap: false, toRegex: true });
40
+
41
+      if (range.length !== 0) {
42
+        return args.length > 1 && range.length > 1 ? `(${range})` : range;
43
+      }
44
+    }
45
+
46
+    if (node.nodes) {
47
+      for (let child of node.nodes) {
48
+        output += walk(child, node);
49
+      }
50
+    }
51
+    return output;
52
+  };
53
+
54
+  return walk(ast);
55
+};
56
+
57
+module.exports = compile;

+ 57
- 0
node_modules/braces/lib/constants.js View File

@@ -0,0 +1,57 @@
1
+'use strict';
2
+
3
+module.exports = {
4
+  MAX_LENGTH: 1024 * 64,
5
+
6
+  // Digits
7
+  CHAR_0: '0', /* 0 */
8
+  CHAR_9: '9', /* 9 */
9
+
10
+  // Alphabet chars.
11
+  CHAR_UPPERCASE_A: 'A', /* A */
12
+  CHAR_LOWERCASE_A: 'a', /* a */
13
+  CHAR_UPPERCASE_Z: 'Z', /* Z */
14
+  CHAR_LOWERCASE_Z: 'z', /* z */
15
+
16
+  CHAR_LEFT_PARENTHESES: '(', /* ( */
17
+  CHAR_RIGHT_PARENTHESES: ')', /* ) */
18
+
19
+  CHAR_ASTERISK: '*', /* * */
20
+
21
+  // Non-alphabetic chars.
22
+  CHAR_AMPERSAND: '&', /* & */
23
+  CHAR_AT: '@', /* @ */
24
+  CHAR_BACKSLASH: '\\', /* \ */
25
+  CHAR_BACKTICK: '`', /* ` */
26
+  CHAR_CARRIAGE_RETURN: '\r', /* \r */
27
+  CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */
28
+  CHAR_COLON: ':', /* : */
29
+  CHAR_COMMA: ',', /* , */
30
+  CHAR_DOLLAR: '$', /* . */
31
+  CHAR_DOT: '.', /* . */
32
+  CHAR_DOUBLE_QUOTE: '"', /* " */
33
+  CHAR_EQUAL: '=', /* = */
34
+  CHAR_EXCLAMATION_MARK: '!', /* ! */
35
+  CHAR_FORM_FEED: '\f', /* \f */
36
+  CHAR_FORWARD_SLASH: '/', /* / */
37
+  CHAR_HASH: '#', /* # */
38
+  CHAR_HYPHEN_MINUS: '-', /* - */
39
+  CHAR_LEFT_ANGLE_BRACKET: '<', /* < */
40
+  CHAR_LEFT_CURLY_BRACE: '{', /* { */
41
+  CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */
42
+  CHAR_LINE_FEED: '\n', /* \n */
43
+  CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */
44
+  CHAR_PERCENT: '%', /* % */
45
+  CHAR_PLUS: '+', /* + */
46
+  CHAR_QUESTION_MARK: '?', /* ? */
47
+  CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */
48
+  CHAR_RIGHT_CURLY_BRACE: '}', /* } */
49
+  CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */
50
+  CHAR_SEMICOLON: ';', /* ; */
51
+  CHAR_SINGLE_QUOTE: '\'', /* ' */
52
+  CHAR_SPACE: ' ', /*   */
53
+  CHAR_TAB: '\t', /* \t */
54
+  CHAR_UNDERSCORE: '_', /* _ */
55
+  CHAR_VERTICAL_LINE: '|', /* | */
56
+  CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */
57
+};

+ 113
- 0
node_modules/braces/lib/expand.js View File

@@ -0,0 +1,113 @@
1
+'use strict';
2
+
3
+const fill = require('fill-range');
4
+const stringify = require('./stringify');
5
+const utils = require('./utils');
6
+
7
+const append = (queue = '', stash = '', enclose = false) => {
8
+  let result = [];
9
+
10
+  queue = [].concat(queue);
11
+  stash = [].concat(stash);
12
+
13
+  if (!stash.length) return queue;
14
+  if (!queue.length) {
15
+    return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
16
+  }
17
+
18
+  for (let item of queue) {
19
+    if (Array.isArray(item)) {
20
+      for (let value of item) {
21
+        result.push(append(value, stash, enclose));
22
+      }
23
+    } else {
24
+      for (let ele of stash) {
25
+        if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
26
+        result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
27
+      }
28
+    }
29
+  }
30
+  return utils.flatten(result);
31
+};
32
+
33
+const expand = (ast, options = {}) => {
34
+  let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
35
+
36
+  let walk = (node, parent = {}) => {
37
+    node.queue = [];
38
+
39
+    let p = parent;
40
+    let q = parent.queue;
41
+
42
+    while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
43
+      p = p.parent;
44
+      q = p.queue;
45
+    }
46
+
47
+    if (node.invalid || node.dollar) {
48
+      q.push(append(q.pop(), stringify(node, options)));
49
+      return;
50
+    }
51
+
52
+    if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
53
+      q.push(append(q.pop(), ['{}']));
54
+      return;
55
+    }
56
+
57
+    if (node.nodes && node.ranges > 0) {
58
+      let args = utils.reduce(node.nodes);
59
+
60
+      if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
61
+        throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
62
+      }
63
+
64
+      let range = fill(...args, options);
65
+      if (range.length === 0) {
66
+        range = stringify(node, options);
67
+      }
68
+
69
+      q.push(append(q.pop(), range));
70
+      node.nodes = [];
71
+      return;
72
+    }
73
+
74
+    let enclose = utils.encloseBrace(node);
75
+    let queue = node.queue;
76
+    let block = node;
77
+
78
+    while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
79
+      block = block.parent;
80
+      queue = block.queue;
81
+    }
82
+
83
+    for (let i = 0; i < node.nodes.length; i++) {
84
+      let child = node.nodes[i];
85
+
86
+      if (child.type === 'comma' && node.type === 'brace') {
87
+        if (i === 1) queue.push('');
88
+        queue.push('');
89
+        continue;
90
+      }
91
+
92
+      if (child.type === 'close') {
93
+        q.push(append(q.pop(), queue, enclose));
94
+        continue;
95
+      }
96
+
97
+      if (child.value && child.type !== 'open') {
98
+        queue.push(append(queue.pop(), child.value));
99
+        continue;
100
+      }
101
+
102
+      if (child.nodes) {
103
+        walk(child, node);
104
+      }
105
+    }
106
+
107
+    return queue;
108
+  };
109
+
110
+  return utils.flatten(walk(ast));
111
+};
112
+
113
+module.exports = expand;

+ 0
- 0
node_modules/braces/lib/parse.js View File


Some files were not shown because too many files changed in this diff