@vercel/node 2.2.1-canary.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/dev-server.js +151 -50
  2. package/dist/index.js +364 -2777
  3. package/package.json +6 -5
package/dist/index.js CHANGED
@@ -48552,7 +48552,7 @@ const mocking = exports.mockS3Http('get');
48552
48552
 
48553
48553
  const fs = __webpack_require__(35747);
48554
48554
  const path = __webpack_require__(85622);
48555
- const nopt = __webpack_require__(51400);
48555
+ const nopt = __webpack_require__(56689);
48556
48556
  const log = __webpack_require__(79658);
48557
48557
  log.disableProgress();
48558
48558
  const napi = __webpack_require__(55677);
@@ -49953,454 +49953,6 @@ const forEachStep = (self, fn, node, thisp) => {
49953
49953
  module.exports = LRUCache
49954
49954
 
49955
49955
 
49956
- /***/ }),
49957
-
49958
- /***/ 51400:
49959
- /***/ ((module, exports, __webpack_require__) => {
49960
-
49961
- // info about each config option.
49962
-
49963
- var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
49964
- ? function () { console.error.apply(console, arguments) }
49965
- : function () {}
49966
-
49967
- var url = __webpack_require__(78835)
49968
- , path = __webpack_require__(85622)
49969
- , Stream = __webpack_require__(92413).Stream
49970
- , abbrev = __webpack_require__(85920)
49971
- , os = __webpack_require__(12087)
49972
-
49973
- module.exports = exports = nopt
49974
- exports.clean = clean
49975
-
49976
- exports.typeDefs =
49977
- { String : { type: String, validate: validateString }
49978
- , Boolean : { type: Boolean, validate: validateBoolean }
49979
- , url : { type: url, validate: validateUrl }
49980
- , Number : { type: Number, validate: validateNumber }
49981
- , path : { type: path, validate: validatePath }
49982
- , Stream : { type: Stream, validate: validateStream }
49983
- , Date : { type: Date, validate: validateDate }
49984
- }
49985
-
49986
- function nopt (types, shorthands, args, slice) {
49987
- args = args || process.argv
49988
- types = types || {}
49989
- shorthands = shorthands || {}
49990
- if (typeof slice !== "number") slice = 2
49991
-
49992
- debug(types, shorthands, args, slice)
49993
-
49994
- args = args.slice(slice)
49995
- var data = {}
49996
- , key
49997
- , argv = {
49998
- remain: [],
49999
- cooked: args,
50000
- original: args.slice(0)
50001
- }
50002
-
50003
- parse(args, data, argv.remain, types, shorthands)
50004
- // now data is full
50005
- clean(data, types, exports.typeDefs)
50006
- data.argv = argv
50007
- Object.defineProperty(data.argv, 'toString', { value: function () {
50008
- return this.original.map(JSON.stringify).join(" ")
50009
- }, enumerable: false })
50010
- return data
50011
- }
50012
-
50013
- function clean (data, types, typeDefs) {
50014
- typeDefs = typeDefs || exports.typeDefs
50015
- var remove = {}
50016
- , typeDefault = [false, true, null, String, Array]
50017
-
50018
- Object.keys(data).forEach(function (k) {
50019
- if (k === "argv") return
50020
- var val = data[k]
50021
- , isArray = Array.isArray(val)
50022
- , type = types[k]
50023
- if (!isArray) val = [val]
50024
- if (!type) type = typeDefault
50025
- if (type === Array) type = typeDefault.concat(Array)
50026
- if (!Array.isArray(type)) type = [type]
50027
-
50028
- debug("val=%j", val)
50029
- debug("types=", type)
50030
- val = val.map(function (val) {
50031
- // if it's an unknown value, then parse false/true/null/numbers/dates
50032
- if (typeof val === "string") {
50033
- debug("string %j", val)
50034
- val = val.trim()
50035
- if ((val === "null" && ~type.indexOf(null))
50036
- || (val === "true" &&
50037
- (~type.indexOf(true) || ~type.indexOf(Boolean)))
50038
- || (val === "false" &&
50039
- (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
50040
- val = JSON.parse(val)
50041
- debug("jsonable %j", val)
50042
- } else if (~type.indexOf(Number) && !isNaN(val)) {
50043
- debug("convert to number", val)
50044
- val = +val
50045
- } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
50046
- debug("convert to date", val)
50047
- val = new Date(val)
50048
- }
50049
- }
50050
-
50051
- if (!types.hasOwnProperty(k)) {
50052
- return val
50053
- }
50054
-
50055
- // allow `--no-blah` to set 'blah' to null if null is allowed
50056
- if (val === false && ~type.indexOf(null) &&
50057
- !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
50058
- val = null
50059
- }
50060
-
50061
- var d = {}
50062
- d[k] = val
50063
- debug("prevalidated val", d, val, types[k])
50064
- if (!validate(d, k, val, types[k], typeDefs)) {
50065
- if (exports.invalidHandler) {
50066
- exports.invalidHandler(k, val, types[k], data)
50067
- } else if (exports.invalidHandler !== false) {
50068
- debug("invalid: "+k+"="+val, types[k])
50069
- }
50070
- return remove
50071
- }
50072
- debug("validated val", d, val, types[k])
50073
- return d[k]
50074
- }).filter(function (val) { return val !== remove })
50075
-
50076
- // if we allow Array specifically, then an empty array is how we
50077
- // express 'no value here', not null. Allow it.
50078
- if (!val.length && type.indexOf(Array) === -1) {
50079
- debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array))
50080
- delete data[k]
50081
- }
50082
- else if (isArray) {
50083
- debug(isArray, data[k], val)
50084
- data[k] = val
50085
- } else data[k] = val[0]
50086
-
50087
- debug("k=%s val=%j", k, val, data[k])
50088
- })
50089
- }
50090
-
50091
- function validateString (data, k, val) {
50092
- data[k] = String(val)
50093
- }
50094
-
50095
- function validatePath (data, k, val) {
50096
- if (val === true) return false
50097
- if (val === null) return true
50098
-
50099
- val = String(val)
50100
-
50101
- var isWin = process.platform === 'win32'
50102
- , homePattern = isWin ? /^~(\/|\\)/ : /^~\//
50103
- , home = os.homedir()
50104
-
50105
- if (home && val.match(homePattern)) {
50106
- data[k] = path.resolve(home, val.substr(2))
50107
- } else {
50108
- data[k] = path.resolve(val)
50109
- }
50110
- return true
50111
- }
50112
-
50113
- function validateNumber (data, k, val) {
50114
- debug("validate Number %j %j %j", k, val, isNaN(val))
50115
- if (isNaN(val)) return false
50116
- data[k] = +val
50117
- }
50118
-
50119
- function validateDate (data, k, val) {
50120
- var s = Date.parse(val)
50121
- debug("validate Date %j %j %j", k, val, s)
50122
- if (isNaN(s)) return false
50123
- data[k] = new Date(val)
50124
- }
50125
-
50126
- function validateBoolean (data, k, val) {
50127
- if (val instanceof Boolean) val = val.valueOf()
50128
- else if (typeof val === "string") {
50129
- if (!isNaN(val)) val = !!(+val)
50130
- else if (val === "null" || val === "false") val = false
50131
- else val = true
50132
- } else val = !!val
50133
- data[k] = val
50134
- }
50135
-
50136
- function validateUrl (data, k, val) {
50137
- val = url.parse(String(val))
50138
- if (!val.host) return false
50139
- data[k] = val.href
50140
- }
50141
-
50142
- function validateStream (data, k, val) {
50143
- if (!(val instanceof Stream)) return false
50144
- data[k] = val
50145
- }
50146
-
50147
- function validate (data, k, val, type, typeDefs) {
50148
- // arrays are lists of types.
50149
- if (Array.isArray(type)) {
50150
- for (var i = 0, l = type.length; i < l; i ++) {
50151
- if (type[i] === Array) continue
50152
- if (validate(data, k, val, type[i], typeDefs)) return true
50153
- }
50154
- delete data[k]
50155
- return false
50156
- }
50157
-
50158
- // an array of anything?
50159
- if (type === Array) return true
50160
-
50161
- // NaN is poisonous. Means that something is not allowed.
50162
- if (type !== type) {
50163
- debug("Poison NaN", k, val, type)
50164
- delete data[k]
50165
- return false
50166
- }
50167
-
50168
- // explicit list of values
50169
- if (val === type) {
50170
- debug("Explicitly allowed %j", val)
50171
- // if (isArray) (data[k] = data[k] || []).push(val)
50172
- // else data[k] = val
50173
- data[k] = val
50174
- return true
50175
- }
50176
-
50177
- // now go through the list of typeDefs, validate against each one.
50178
- var ok = false
50179
- , types = Object.keys(typeDefs)
50180
- for (var i = 0, l = types.length; i < l; i ++) {
50181
- debug("test type %j %j %j", k, val, types[i])
50182
- var t = typeDefs[types[i]]
50183
- if (t &&
50184
- ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) {
50185
- var d = {}
50186
- ok = false !== t.validate(d, k, val)
50187
- val = d[k]
50188
- if (ok) {
50189
- // if (isArray) (data[k] = data[k] || []).push(val)
50190
- // else data[k] = val
50191
- data[k] = val
50192
- break
50193
- }
50194
- }
50195
- }
50196
- debug("OK? %j (%j %j %j)", ok, k, val, types[i])
50197
-
50198
- if (!ok) delete data[k]
50199
- return ok
50200
- }
50201
-
50202
- function parse (args, data, remain, types, shorthands) {
50203
- debug("parse", args, data, remain)
50204
-
50205
- var key = null
50206
- , abbrevs = abbrev(Object.keys(types))
50207
- , shortAbbr = abbrev(Object.keys(shorthands))
50208
-
50209
- for (var i = 0; i < args.length; i ++) {
50210
- var arg = args[i]
50211
- debug("arg", arg)
50212
-
50213
- if (arg.match(/^-{2,}$/)) {
50214
- // done with keys.
50215
- // the rest are args.
50216
- remain.push.apply(remain, args.slice(i + 1))
50217
- args[i] = "--"
50218
- break
50219
- }
50220
- var hadEq = false
50221
- if (arg.charAt(0) === "-" && arg.length > 1) {
50222
- var at = arg.indexOf('=')
50223
- if (at > -1) {
50224
- hadEq = true
50225
- var v = arg.substr(at + 1)
50226
- arg = arg.substr(0, at)
50227
- args.splice(i, 1, arg, v)
50228
- }
50229
-
50230
- // see if it's a shorthand
50231
- // if so, splice and back up to re-parse it.
50232
- var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
50233
- debug("arg=%j shRes=%j", arg, shRes)
50234
- if (shRes) {
50235
- debug(arg, shRes)
50236
- args.splice.apply(args, [i, 1].concat(shRes))
50237
- if (arg !== shRes[0]) {
50238
- i --
50239
- continue
50240
- }
50241
- }
50242
- arg = arg.replace(/^-+/, "")
50243
- var no = null
50244
- while (arg.toLowerCase().indexOf("no-") === 0) {
50245
- no = !no
50246
- arg = arg.substr(3)
50247
- }
50248
-
50249
- if (abbrevs[arg]) arg = abbrevs[arg]
50250
-
50251
- var argType = types[arg]
50252
- var isTypeArray = Array.isArray(argType)
50253
- if (isTypeArray && argType.length === 1) {
50254
- isTypeArray = false
50255
- argType = argType[0]
50256
- }
50257
-
50258
- var isArray = argType === Array ||
50259
- isTypeArray && argType.indexOf(Array) !== -1
50260
-
50261
- // allow unknown things to be arrays if specified multiple times.
50262
- if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
50263
- if (!Array.isArray(data[arg]))
50264
- data[arg] = [data[arg]]
50265
- isArray = true
50266
- }
50267
-
50268
- var val
50269
- , la = args[i + 1]
50270
-
50271
- var isBool = typeof no === 'boolean' ||
50272
- argType === Boolean ||
50273
- isTypeArray && argType.indexOf(Boolean) !== -1 ||
50274
- (typeof argType === 'undefined' && !hadEq) ||
50275
- (la === "false" &&
50276
- (argType === null ||
50277
- isTypeArray && ~argType.indexOf(null)))
50278
-
50279
- if (isBool) {
50280
- // just set and move along
50281
- val = !no
50282
- // however, also support --bool true or --bool false
50283
- if (la === "true" || la === "false") {
50284
- val = JSON.parse(la)
50285
- la = null
50286
- if (no) val = !val
50287
- i ++
50288
- }
50289
-
50290
- // also support "foo":[Boolean, "bar"] and "--foo bar"
50291
- if (isTypeArray && la) {
50292
- if (~argType.indexOf(la)) {
50293
- // an explicit type
50294
- val = la
50295
- i ++
50296
- } else if ( la === "null" && ~argType.indexOf(null) ) {
50297
- // null allowed
50298
- val = null
50299
- i ++
50300
- } else if ( !la.match(/^-{2,}[^-]/) &&
50301
- !isNaN(la) &&
50302
- ~argType.indexOf(Number) ) {
50303
- // number
50304
- val = +la
50305
- i ++
50306
- } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) {
50307
- // string
50308
- val = la
50309
- i ++
50310
- }
50311
- }
50312
-
50313
- if (isArray) (data[arg] = data[arg] || []).push(val)
50314
- else data[arg] = val
50315
-
50316
- continue
50317
- }
50318
-
50319
- if (argType === String) {
50320
- if (la === undefined) {
50321
- la = ""
50322
- } else if (la.match(/^-{1,2}[^-]+/)) {
50323
- la = ""
50324
- i --
50325
- }
50326
- }
50327
-
50328
- if (la && la.match(/^-{2,}$/)) {
50329
- la = undefined
50330
- i --
50331
- }
50332
-
50333
- val = la === undefined ? true : la
50334
- if (isArray) (data[arg] = data[arg] || []).push(val)
50335
- else data[arg] = val
50336
-
50337
- i ++
50338
- continue
50339
- }
50340
- remain.push(arg)
50341
- }
50342
- }
50343
-
50344
- function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
50345
- // handle single-char shorthands glommed together, like
50346
- // npm ls -glp, but only if there is one dash, and only if
50347
- // all of the chars are single-char shorthands, and it's
50348
- // not a match to some other abbrev.
50349
- arg = arg.replace(/^-+/, '')
50350
-
50351
- // if it's an exact known option, then don't go any further
50352
- if (abbrevs[arg] === arg)
50353
- return null
50354
-
50355
- // if it's an exact known shortopt, same deal
50356
- if (shorthands[arg]) {
50357
- // make it an array, if it's a list of words
50358
- if (shorthands[arg] && !Array.isArray(shorthands[arg]))
50359
- shorthands[arg] = shorthands[arg].split(/\s+/)
50360
-
50361
- return shorthands[arg]
50362
- }
50363
-
50364
- // first check to see if this arg is a set of single-char shorthands
50365
- var singles = shorthands.___singles
50366
- if (!singles) {
50367
- singles = Object.keys(shorthands).filter(function (s) {
50368
- return s.length === 1
50369
- }).reduce(function (l,r) {
50370
- l[r] = true
50371
- return l
50372
- }, {})
50373
- shorthands.___singles = singles
50374
- debug('shorthand singles', singles)
50375
- }
50376
-
50377
- var chrs = arg.split("").filter(function (c) {
50378
- return singles[c]
50379
- })
50380
-
50381
- if (chrs.join("") === arg) return chrs.map(function (c) {
50382
- return shorthands[c]
50383
- }).reduce(function (l, r) {
50384
- return l.concat(r)
50385
- }, [])
50386
-
50387
-
50388
- // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
50389
- if (abbrevs[arg] && !shorthands[arg])
50390
- return null
50391
-
50392
- // if it's an abbr for a shorthand, then use that
50393
- if (shortAbbr[arg])
50394
- arg = shortAbbr[arg]
50395
-
50396
- // make it an array, if it's a list of words
50397
- if (shorthands[arg] && !Array.isArray(shorthands[arg]))
50398
- shorthands[arg] = shorthands[arg].split(/\s+/)
50399
-
50400
- return shorthands[arg]
50401
- }
50402
-
50403
-
50404
49956
  /***/ }),
50405
49957
 
50406
49958
  /***/ 6286:
@@ -227820,10 +227372,7 @@ async function nodeFileTrace(files, opts = {}) {
227820
227372
  await Promise.all(files.map(async (file) => {
227821
227373
  const path = path_1.resolve(file);
227822
227374
  await job.emitFile(path, 'initial');
227823
- if (path.endsWith('.js') || path.endsWith('.cjs') || path.endsWith('.mjs') || path.endsWith('.node') || job.ts && (path.endsWith('.ts') || path.endsWith('.tsx'))) {
227824
- return job.emitDependency(path);
227825
- }
227826
- return undefined;
227375
+ return job.emitDependency(path);
227827
227376
  }));
227828
227377
  const result = {
227829
227378
  fileList: job.fileList,
@@ -228483,8 +228032,8 @@ exports.nbind = exports.pregyp = void 0;
228483
228032
  const path_1 = __importDefault(__webpack_require__(85622));
228484
228033
  const graceful_fs_1 = __importDefault(__webpack_require__(2029));
228485
228034
  // pregyp
228486
- const versioning = __webpack_require__(25574);
228487
- const napi = __webpack_require__(29248);
228035
+ const versioning = __webpack_require__(30302);
228036
+ const napi = __webpack_require__(55677);
228488
228037
  const pregypFind = (package_json_path, opts) => {
228489
228038
  const package_json = JSON.parse(graceful_fs_1.default.readFileSync(package_json_path).toString());
228490
228039
  versioning.validate_config(package_json, opts);
@@ -240037,7 +239586,7 @@ module.exports = baseIsEqual;
240037
239586
  var Stack = __webpack_require__(15531),
240038
239587
  equalArrays = __webpack_require__(87509),
240039
239588
  equalByTag = __webpack_require__(10092),
240040
- equalObjects = __webpack_require__(20102),
239589
+ equalObjects = __webpack_require__(25574),
240041
239590
  getTag = __webpack_require__(41704),
240042
239591
  isArray = __webpack_require__(68635),
240043
239592
  isBuffer = __webpack_require__(1236),
@@ -241868,7 +241417,7 @@ module.exports = equalByTag;
241868
241417
 
241869
241418
  /***/ }),
241870
241419
 
241871
- /***/ 20102:
241420
+ /***/ 25574:
241872
241421
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
241873
241422
 
241874
241423
  var getAllKeys = __webpack_require__(39346);
@@ -249859,2041 +249408,449 @@ load.compareTags = compareTags
249859
249408
 
249860
249409
  /***/ }),
249861
249410
 
249862
- /***/ 29248:
249411
+ /***/ 56689:
249863
249412
  /***/ ((module, exports, __webpack_require__) => {
249864
249413
 
249865
- "use strict";
249866
-
249867
-
249868
- var fs = __webpack_require__(35747);
249869
- var rm = __webpack_require__(2780);
249870
- var log = __webpack_require__(79658);
249871
-
249872
- module.exports = exports;
249873
-
249874
- var versionArray = process.version
249875
- .substr(1)
249876
- .replace(/-.*$/, '')
249877
- .split('.')
249878
- .map(function(item) {
249879
- return +item;
249880
- });
249881
-
249882
- var napi_multiple_commands = [
249883
- 'build',
249884
- 'clean',
249885
- 'configure',
249886
- 'package',
249887
- 'publish',
249888
- 'reveal',
249889
- 'testbinary',
249890
- 'testpackage',
249891
- 'unpublish'
249892
- ];
249893
-
249894
- var napi_build_version_tag = 'napi_build_version=';
249895
-
249896
- module.exports.get_napi_version = function(target) { // target may be undefined
249897
- // returns the non-zero numeric napi version or undefined if napi is not supported.
249898
- // correctly supporting target requires an updated cross-walk
249899
- var version = process.versions.napi; // can be undefined
249900
- if (!version) { // this code should never need to be updated
249901
- if (versionArray[0] === 9 && versionArray[1] >= 3) version = 2; // 9.3.0+
249902
- else if (versionArray[0] === 8) version = 1; // 8.0.0+
249903
- }
249904
- return version;
249905
- };
249906
-
249907
- module.exports.get_napi_version_as_string = function(target) {
249908
- // returns the napi version as a string or an empty string if napi is not supported.
249909
- var version = module.exports.get_napi_version(target);
249910
- return version ? ''+version : '';
249911
- };
249912
-
249913
- module.exports.validate_package_json = function(package_json, opts) { // throws Error
249914
-
249915
- var binary = package_json.binary;
249916
- var module_path_ok = pathOK(binary.module_path);
249917
- var remote_path_ok = pathOK(binary.remote_path);
249918
- var package_name_ok = pathOK(binary.package_name);
249919
- var napi_build_versions = module.exports.get_napi_build_versions(package_json,opts,true);
249920
- var napi_build_versions_raw = module.exports.get_napi_build_versions_raw(package_json);
249921
-
249922
- if (napi_build_versions) {
249923
- napi_build_versions.forEach(function(napi_build_version){
249924
- if (!(parseInt(napi_build_version,10) === napi_build_version && napi_build_version > 0)) {
249925
- throw new Error("All values specified in napi_versions must be positive integers.");
249926
- }
249927
- });
249928
- }
249929
-
249930
- if (napi_build_versions && (!module_path_ok || (!remote_path_ok && !package_name_ok))) {
249931
- throw new Error("When napi_versions is specified; module_path and either remote_path or " +
249932
- "package_name must contain the substitution string '{napi_build_version}`.");
249933
- }
249934
-
249935
- if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions_raw) {
249936
- throw new Error("When the substitution string '{napi_build_version}` is specified in " +
249937
- "module_path, remote_path, or package_name; napi_versions must also be specified.");
249938
- }
249939
-
249940
- if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json, opts) &&
249941
- module.exports.build_napi_only(package_json)) {
249942
- throw new Error(
249943
- 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
249944
- 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
249945
- 'This Node instance cannot run this module.');
249946
- }
249947
-
249948
- if (napi_build_versions_raw && !napi_build_versions && module.exports.build_napi_only(package_json)) {
249949
- throw new Error(
249950
- 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
249951
- 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
249952
- 'This Node instance cannot run this module.');
249953
- }
249954
-
249955
- };
249956
-
249957
- function pathOK (path) {
249958
- return path && (path.indexOf('{napi_build_version}') !== -1 || path.indexOf('{node_napi_label}') !== -1);
249959
- }
249960
-
249961
- module.exports.expand_commands = function(package_json, opts, commands) {
249962
- var expanded_commands = [];
249963
- var napi_build_versions = module.exports.get_napi_build_versions(package_json, opts);
249964
- commands.forEach(function(command){
249965
- if (napi_build_versions && command.name === 'install') {
249966
- var napi_build_version = module.exports.get_best_napi_build_version(package_json, opts);
249967
- var args = napi_build_version ? [ napi_build_version_tag+napi_build_version ] : [ ];
249968
- expanded_commands.push ({ name: command.name, args: args });
249969
- } else if (napi_build_versions && napi_multiple_commands.indexOf(command.name) !== -1) {
249970
- napi_build_versions.forEach(function(napi_build_version){
249971
- var args = command.args.slice();
249972
- args.push (napi_build_version_tag+napi_build_version);
249973
- expanded_commands.push ({ name: command.name, args: args });
249974
- });
249975
- } else {
249976
- expanded_commands.push (command);
249977
- }
249978
- });
249979
- return expanded_commands;
249980
- };
249981
-
249982
- module.exports.get_napi_build_versions = function(package_json, opts, warnings) { // opts may be undefined
249983
- var napi_build_versions = [];
249984
- var supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
249985
- // remove duplicates, verify each napi version can actaully be built
249986
- if (package_json.binary && package_json.binary.napi_versions) {
249987
- package_json.binary.napi_versions.forEach(function(napi_version) {
249988
- var duplicated = napi_build_versions.indexOf(napi_version) !== -1;
249989
- if (!duplicated && supported_napi_version && napi_version <= supported_napi_version) {
249990
- napi_build_versions.push(napi_version);
249991
- } else if (warnings && !duplicated && supported_napi_version) {
249992
- log.info('This Node instance does not support builds for N-API version', napi_version);
249993
- }
249994
- });
249995
- }
249996
- if (opts && opts["build-latest-napi-version-only"]) {
249997
- var latest_version = 0;
249998
- napi_build_versions.forEach(function(napi_version) {
249999
- if (napi_version > latest_version) latest_version = napi_version;
250000
- });
250001
- napi_build_versions = latest_version ? [ latest_version ] : [];
250002
- }
250003
- return napi_build_versions.length ? napi_build_versions : undefined;
250004
- };
250005
-
250006
- module.exports.get_napi_build_versions_raw = function(package_json) {
250007
- var napi_build_versions = [];
250008
- // remove duplicates
250009
- if (package_json.binary && package_json.binary.napi_versions) {
250010
- package_json.binary.napi_versions.forEach(function(napi_version) {
250011
- if (napi_build_versions.indexOf(napi_version) === -1) {
250012
- napi_build_versions.push(napi_version);
250013
- }
250014
- });
250015
- }
250016
- return napi_build_versions.length ? napi_build_versions : undefined;
250017
- };
250018
-
250019
- module.exports.get_command_arg = function(napi_build_version) {
250020
- return napi_build_version_tag + napi_build_version;
250021
- };
250022
-
250023
- module.exports.get_napi_build_version_from_command_args = function(command_args) {
250024
- for (var i = 0; i < command_args.length; i++) {
250025
- var arg = command_args[i];
250026
- if (arg.indexOf(napi_build_version_tag) === 0) {
250027
- return parseInt(arg.substr(napi_build_version_tag.length),10);
250028
- }
250029
- }
250030
- return undefined;
250031
- };
250032
-
250033
- module.exports.swap_build_dir_out = function(napi_build_version) {
250034
- if (napi_build_version) {
250035
- rm.sync(module.exports.get_build_dir(napi_build_version));
250036
- fs.renameSync('build', module.exports.get_build_dir(napi_build_version));
250037
- }
250038
- };
250039
-
250040
- module.exports.swap_build_dir_in = function(napi_build_version) {
250041
- if (napi_build_version) {
250042
- rm.sync('build');
250043
- fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build');
250044
- }
250045
- };
250046
-
250047
- module.exports.get_build_dir = function(napi_build_version) {
250048
- return 'build-tmp-napi-v'+napi_build_version;
250049
- };
250050
-
250051
- module.exports.get_best_napi_build_version = function(package_json, opts) {
250052
- var best_napi_build_version = 0;
250053
- var napi_build_versions = module.exports.get_napi_build_versions (package_json, opts);
250054
- if (napi_build_versions) {
250055
- var our_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
250056
- napi_build_versions.forEach(function(napi_build_version){
250057
- if (napi_build_version > best_napi_build_version &&
250058
- napi_build_version <= our_napi_version) {
250059
- best_napi_build_version = napi_build_version;
250060
- }
250061
- });
250062
- }
250063
- return best_napi_build_version === 0 ? undefined : best_napi_build_version;
250064
- };
250065
-
250066
- module.exports.build_napi_only = function(package_json) {
250067
- return package_json.binary && package_json.binary.package_name &&
250068
- package_json.binary.package_name.indexOf('{node_napi_label}') === -1;
250069
- };
250070
-
250071
- /***/ }),
250072
-
250073
- /***/ 25574:
250074
- /***/ ((module, exports, __webpack_require__) => {
250075
-
250076
- "use strict";
250077
-
250078
-
250079
- module.exports = exports;
250080
-
250081
- var path = __webpack_require__(85622);
250082
- var semver = __webpack_require__(55720);
250083
- var url = __webpack_require__(78835);
250084
- var detect_libc = __webpack_require__(32157);
250085
- var napi = __webpack_require__(29248);
250086
-
250087
- var abi_crosswalk;
250088
-
250089
- // This is used for unit testing to provide a fake
250090
- // ABI crosswalk that emulates one that is not updated
250091
- // for the current version
250092
- if (process.env.NODE_PRE_GYP_ABI_CROSSWALK) {
250093
- abi_crosswalk = require(process.env.NODE_PRE_GYP_ABI_CROSSWALK);
250094
- } else {
250095
- abi_crosswalk = __webpack_require__(90772);
250096
- }
250097
-
250098
- var major_versions = {};
250099
- Object.keys(abi_crosswalk).forEach(function(v) {
250100
- var major = v.split('.')[0];
250101
- if (!major_versions[major]) {
250102
- major_versions[major] = v;
250103
- }
250104
- });
250105
-
250106
- function get_electron_abi(runtime, target_version) {
250107
- if (!runtime) {
250108
- throw new Error("get_electron_abi requires valid runtime arg");
250109
- }
250110
- if (typeof target_version === 'undefined') {
250111
- // erroneous CLI call
250112
- throw new Error("Empty target version is not supported if electron is the target.");
250113
- }
250114
- // Electron guarantees that patch version update won't break native modules.
250115
- var sem_ver = semver.parse(target_version);
250116
- return runtime + '-v' + sem_ver.major + '.' + sem_ver.minor;
250117
- }
250118
- module.exports.get_electron_abi = get_electron_abi;
250119
-
250120
- function get_node_webkit_abi(runtime, target_version) {
250121
- if (!runtime) {
250122
- throw new Error("get_node_webkit_abi requires valid runtime arg");
250123
- }
250124
- if (typeof target_version === 'undefined') {
250125
- // erroneous CLI call
250126
- throw new Error("Empty target version is not supported if node-webkit is the target.");
250127
- }
250128
- return runtime + '-v' + target_version;
250129
- }
250130
- module.exports.get_node_webkit_abi = get_node_webkit_abi;
250131
-
250132
- function get_node_abi(runtime, versions) {
250133
- if (!runtime) {
250134
- throw new Error("get_node_abi requires valid runtime arg");
250135
- }
250136
- if (!versions) {
250137
- throw new Error("get_node_abi requires valid process.versions object");
250138
- }
250139
- var sem_ver = semver.parse(versions.node);
250140
- if (sem_ver.major === 0 && sem_ver.minor % 2) { // odd series
250141
- // https://github.com/mapbox/node-pre-gyp/issues/124
250142
- return runtime+'-v'+versions.node;
250143
- } else {
250144
- // process.versions.modules added in >= v0.10.4 and v0.11.7
250145
- // https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e
250146
- return versions.modules ? runtime+'-v' + (+versions.modules) :
250147
- 'v8-' + versions.v8.split('.').slice(0,2).join('.');
250148
- }
250149
- }
250150
- module.exports.get_node_abi = get_node_abi;
250151
-
250152
- function get_runtime_abi(runtime, target_version) {
250153
- if (!runtime) {
250154
- throw new Error("get_runtime_abi requires valid runtime arg");
250155
- }
250156
- if (runtime === 'node-webkit') {
250157
- return get_node_webkit_abi(runtime, target_version || process.versions['node-webkit']);
250158
- } else if (runtime === 'electron') {
250159
- return get_electron_abi(runtime, target_version || process.versions.electron);
250160
- } else {
250161
- if (runtime != 'node') {
250162
- throw new Error("Unknown Runtime: '" + runtime + "'");
250163
- }
250164
- if (!target_version) {
250165
- return get_node_abi(runtime,process.versions);
250166
- } else {
250167
- var cross_obj;
250168
- // abi_crosswalk generated with ./scripts/abi_crosswalk.js
250169
- if (abi_crosswalk[target_version]) {
250170
- cross_obj = abi_crosswalk[target_version];
250171
- } else {
250172
- var target_parts = target_version.split('.').map(function(i) { return +i; });
250173
- if (target_parts.length != 3) { // parse failed
250174
- throw new Error("Unknown target version: " + target_version);
250175
- }
250176
- /*
250177
- The below code tries to infer the last known ABI compatible version
250178
- that we have recorded in the abi_crosswalk.json when an exact match
250179
- is not possible. The reasons for this to exist are complicated:
250180
-
250181
- - We support passing --target to be able to allow developers to package binaries for versions of node
250182
- that are not the same one as they are running. This might also be used in combination with the
250183
- --target_arch or --target_platform flags to also package binaries for alternative platforms
250184
- - When --target is passed we can't therefore determine the ABI (process.versions.modules) from the node
250185
- version that is running in memory
250186
- - So, therefore node-pre-gyp keeps an "ABI crosswalk" (lib/util/abi_crosswalk.json) to be able to look
250187
- this info up for all versions
250188
- - But we cannot easily predict what the future ABI will be for released versions
250189
- - And node-pre-gyp needs to be a `bundledDependency` in apps that depend on it in order to work correctly
250190
- by being fully available at install time.
250191
- - So, the speed of node releases and the bundled nature of node-pre-gyp mean that a new node-pre-gyp release
250192
- need to happen for every node.js/io.js/node-webkit/nw.js/atom-shell/etc release that might come online if
250193
- you want the `--target` flag to keep working for the latest version
250194
- - Which is impractical ^^
250195
- - Hence the below code guesses about future ABI to make the need to update node-pre-gyp less demanding.
250196
-
250197
- In practice then you can have a dependency of your app like `node-sqlite3` that bundles a `node-pre-gyp` that
250198
- only knows about node v0.10.33 in the `abi_crosswalk.json` but target node v0.10.34 (which is assumed to be
250199
- ABI compatible with v0.10.33).
250200
-
250201
- TODO: use semver module instead of custom version parsing
250202
- */
250203
- var major = target_parts[0];
250204
- var minor = target_parts[1];
250205
- var patch = target_parts[2];
250206
- // io.js: yeah if node.js ever releases 1.x this will break
250207
- // but that is unlikely to happen: https://github.com/iojs/io.js/pull/253#issuecomment-69432616
250208
- if (major === 1) {
250209
- // look for last release that is the same major version
250210
- // e.g. we assume io.js 1.x is ABI compatible with >= 1.0.0
250211
- while (true) {
250212
- if (minor > 0) --minor;
250213
- if (patch > 0) --patch;
250214
- var new_iojs_target = '' + major + '.' + minor + '.' + patch;
250215
- if (abi_crosswalk[new_iojs_target]) {
250216
- cross_obj = abi_crosswalk[new_iojs_target];
250217
- console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
250218
- console.log('Warning: but node-pre-gyp successfully choose ' + new_iojs_target + ' as ABI compatible target');
250219
- break;
250220
- }
250221
- if (minor === 0 && patch === 0) {
250222
- break;
250223
- }
250224
- }
250225
- } else if (major >= 2) {
250226
- // look for last release that is the same major version
250227
- if (major_versions[major]) {
250228
- cross_obj = abi_crosswalk[major_versions[major]];
250229
- console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
250230
- console.log('Warning: but node-pre-gyp successfully choose ' + major_versions[major] + ' as ABI compatible target');
250231
- }
250232
- } else if (major === 0) { // node.js
250233
- if (target_parts[1] % 2 === 0) { // for stable/even node.js series
250234
- // look for the last release that is the same minor release
250235
- // e.g. we assume node 0.10.x is ABI compatible with >= 0.10.0
250236
- while (--patch > 0) {
250237
- var new_node_target = '' + major + '.' + minor + '.' + patch;
250238
- if (abi_crosswalk[new_node_target]) {
250239
- cross_obj = abi_crosswalk[new_node_target];
250240
- console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
250241
- console.log('Warning: but node-pre-gyp successfully choose ' + new_node_target + ' as ABI compatible target');
250242
- break;
250243
- }
250244
- }
250245
- }
250246
- }
250247
- }
250248
- if (!cross_obj) {
250249
- throw new Error("Unsupported target version: " + target_version);
250250
- }
250251
- // emulate process.versions
250252
- var versions_obj = {
250253
- node: target_version,
250254
- v8: cross_obj.v8+'.0',
250255
- // abi_crosswalk uses 1 for node versions lacking process.versions.modules
250256
- // process.versions.modules added in >= v0.10.4 and v0.11.7
250257
- modules: cross_obj.node_abi > 1 ? cross_obj.node_abi : undefined
250258
- };
250259
- return get_node_abi(runtime, versions_obj);
250260
- }
250261
- }
250262
- }
250263
- module.exports.get_runtime_abi = get_runtime_abi;
250264
-
250265
- var required_parameters = [
250266
- 'module_name',
250267
- 'module_path',
250268
- 'host'
250269
- ];
250270
-
250271
- function validate_config(package_json,opts) {
250272
- var msg = package_json.name + ' package.json is not node-pre-gyp ready:\n';
250273
- var missing = [];
250274
- if (!package_json.main) {
250275
- missing.push('main');
250276
- }
250277
- if (!package_json.version) {
250278
- missing.push('version');
250279
- }
250280
- if (!package_json.name) {
250281
- missing.push('name');
250282
- }
250283
- if (!package_json.binary) {
250284
- missing.push('binary');
250285
- }
250286
- var o = package_json.binary;
250287
- required_parameters.forEach(function(p) {
250288
- if (missing.indexOf('binary') > -1) {
250289
- missing.pop('binary');
250290
- }
250291
- if (!o || o[p] === undefined || o[p] === "") {
250292
- missing.push('binary.' + p);
250293
- }
250294
- });
250295
- if (missing.length >= 1) {
250296
- throw new Error(msg+"package.json must declare these properties: \n" + missing.join('\n'));
250297
- }
250298
- if (o) {
250299
- // enforce https over http
250300
- var protocol = url.parse(o.host).protocol;
250301
- if (protocol === 'http:') {
250302
- throw new Error("'host' protocol ("+protocol+") is invalid - only 'https:' is accepted");
250303
- }
250304
- }
250305
- napi.validate_package_json(package_json,opts);
250306
- }
250307
-
250308
- module.exports.validate_config = validate_config;
250309
-
250310
- function eval_template(template,opts) {
250311
- Object.keys(opts).forEach(function(key) {
250312
- var pattern = '{'+key+'}';
250313
- while (template.indexOf(pattern) > -1) {
250314
- template = template.replace(pattern,opts[key]);
250315
- }
250316
- });
250317
- return template;
250318
- }
250319
-
250320
- // url.resolve needs single trailing slash
250321
- // to behave correctly, otherwise a double slash
250322
- // may end up in the url which breaks requests
250323
- // and a lacking slash may not lead to proper joining
250324
- function fix_slashes(pathname) {
250325
- if (pathname.slice(-1) != '/') {
250326
- return pathname + '/';
250327
- }
250328
- return pathname;
250329
- }
250330
-
250331
- // remove double slashes
250332
- // note: path.normalize will not work because
250333
- // it will convert forward to back slashes
250334
- function drop_double_slashes(pathname) {
250335
- return pathname.replace(/\/\//g,'/');
250336
- }
250337
-
250338
- function get_process_runtime(versions) {
250339
- var runtime = 'node';
250340
- if (versions['node-webkit']) {
250341
- runtime = 'node-webkit';
250342
- } else if (versions.electron) {
250343
- runtime = 'electron';
250344
- }
250345
- return runtime;
250346
- }
250347
-
250348
- module.exports.get_process_runtime = get_process_runtime;
250349
-
250350
- var default_package_name = '{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz';
250351
- var default_remote_path = '';
250352
-
250353
- module.exports.evaluate = function(package_json,options,napi_build_version) {
250354
- options = options || {};
250355
- validate_config(package_json,options); // options is a suitable substitute for opts in this case
250356
- var v = package_json.version;
250357
- var module_version = semver.parse(v);
250358
- var runtime = options.runtime || get_process_runtime(process.versions);
250359
- var opts = {
250360
- name: package_json.name,
250361
- configuration: Boolean(options.debug) ? 'Debug' : 'Release',
250362
- debug: options.debug,
250363
- module_name: package_json.binary.module_name,
250364
- version: module_version.version,
250365
- prerelease: module_version.prerelease.length ? module_version.prerelease.join('.') : '',
250366
- build: module_version.build.length ? module_version.build.join('.') : '',
250367
- major: module_version.major,
250368
- minor: module_version.minor,
250369
- patch: module_version.patch,
250370
- runtime: runtime,
250371
- node_abi: get_runtime_abi(runtime,options.target),
250372
- node_abi_napi: napi.get_napi_version(options.target) ? 'napi' : get_runtime_abi(runtime,options.target),
250373
- napi_version: napi.get_napi_version(options.target), // non-zero numeric, undefined if unsupported
250374
- napi_build_version: napi_build_version || '',
250375
- node_napi_label: napi_build_version ? 'napi-v' + napi_build_version : get_runtime_abi(runtime,options.target),
250376
- target: options.target || '',
250377
- platform: options.target_platform || process.platform,
250378
- target_platform: options.target_platform || process.platform,
250379
- arch: options.target_arch || process.arch,
250380
- target_arch: options.target_arch || process.arch,
250381
- libc: options.target_libc || detect_libc.family || 'unknown',
250382
- module_main: package_json.main,
250383
- toolset : options.toolset || '' // address https://github.com/mapbox/node-pre-gyp/issues/119
250384
- };
250385
- // support host mirror with npm config `--{module_name}_binary_host_mirror`
250386
- // e.g.: https://github.com/node-inspector/v8-profiler/blob/master/package.json#L25
250387
- // > npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/
250388
- var host = process.env['npm_config_' + opts.module_name + '_binary_host_mirror'] || package_json.binary.host;
250389
- opts.host = fix_slashes(eval_template(host,opts));
250390
- opts.module_path = eval_template(package_json.binary.module_path,opts);
250391
- // now we resolve the module_path to ensure it is absolute so that binding.gyp variables work predictably
250392
- if (options.module_root) {
250393
- // resolve relative to known module root: works for pre-binding require
250394
- opts.module_path = path.join(options.module_root,opts.module_path);
250395
- } else {
250396
- // resolve relative to current working directory: works for node-pre-gyp commands
250397
- opts.module_path = path.resolve(opts.module_path);
250398
- }
250399
- opts.module = path.join(opts.module_path,opts.module_name + '.node');
250400
- opts.remote_path = package_json.binary.remote_path ? drop_double_slashes(fix_slashes(eval_template(package_json.binary.remote_path,opts))) : default_remote_path;
250401
- var package_name = package_json.binary.package_name ? package_json.binary.package_name : default_package_name;
250402
- opts.package_name = eval_template(package_name,opts);
250403
- opts.staged_tarball = path.join('build/stage',opts.remote_path,opts.package_name);
250404
- opts.hosted_path = url.resolve(opts.host,opts.remote_path);
250405
- opts.hosted_tarball = url.resolve(opts.hosted_path,opts.package_name);
250406
- return opts;
250407
- };
250408
-
250409
-
250410
- /***/ }),
250411
-
250412
- /***/ 55720:
250413
- /***/ ((module, exports) => {
250414
-
250415
- exports = module.exports = SemVer
250416
-
250417
- var debug
250418
- /* istanbul ignore next */
250419
- if (typeof process === 'object' &&
250420
- process.env &&
250421
- process.env.NODE_DEBUG &&
250422
- /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
250423
- debug = function () {
250424
- var args = Array.prototype.slice.call(arguments, 0)
250425
- args.unshift('SEMVER')
250426
- console.log.apply(console, args)
250427
- }
250428
- } else {
250429
- debug = function () {}
250430
- }
250431
-
250432
- // Note: this is the semver.org version of the spec that it implements
250433
- // Not necessarily the package version of this code.
250434
- exports.SEMVER_SPEC_VERSION = '2.0.0'
250435
-
250436
- var MAX_LENGTH = 256
250437
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
250438
- /* istanbul ignore next */ 9007199254740991
250439
-
250440
- // Max safe segment length for coercion.
250441
- var MAX_SAFE_COMPONENT_LENGTH = 16
250442
-
250443
- // The actual regexps go on exports.re
250444
- var re = exports.re = []
250445
- var src = exports.src = []
250446
- var R = 0
250447
-
250448
- // The following Regular Expressions can be used for tokenizing,
250449
- // validating, and parsing SemVer version strings.
250450
-
250451
- // ## Numeric Identifier
250452
- // A single `0`, or a non-zero digit followed by zero or more digits.
250453
-
250454
- var NUMERICIDENTIFIER = R++
250455
- src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
250456
- var NUMERICIDENTIFIERLOOSE = R++
250457
- src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
250458
-
250459
- // ## Non-numeric Identifier
250460
- // Zero or more digits, followed by a letter or hyphen, and then zero or
250461
- // more letters, digits, or hyphens.
250462
-
250463
- var NONNUMERICIDENTIFIER = R++
250464
- src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
250465
-
250466
- // ## Main Version
250467
- // Three dot-separated numeric identifiers.
250468
-
250469
- var MAINVERSION = R++
250470
- src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
250471
- '(' + src[NUMERICIDENTIFIER] + ')\\.' +
250472
- '(' + src[NUMERICIDENTIFIER] + ')'
250473
-
250474
- var MAINVERSIONLOOSE = R++
250475
- src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
250476
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
250477
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
250478
-
250479
- // ## Pre-release Version Identifier
250480
- // A numeric identifier, or a non-numeric identifier.
250481
-
250482
- var PRERELEASEIDENTIFIER = R++
250483
- src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
250484
- '|' + src[NONNUMERICIDENTIFIER] + ')'
250485
-
250486
- var PRERELEASEIDENTIFIERLOOSE = R++
250487
- src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
250488
- '|' + src[NONNUMERICIDENTIFIER] + ')'
250489
-
250490
- // ## Pre-release Version
250491
- // Hyphen, followed by one or more dot-separated pre-release version
250492
- // identifiers.
250493
-
250494
- var PRERELEASE = R++
250495
- src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
250496
- '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
250497
-
250498
- var PRERELEASELOOSE = R++
250499
- src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
250500
- '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
250501
-
250502
- // ## Build Metadata Identifier
250503
- // Any combination of digits, letters, or hyphens.
250504
-
250505
- var BUILDIDENTIFIER = R++
250506
- src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
250507
-
250508
- // ## Build Metadata
250509
- // Plus sign, followed by one or more period-separated build metadata
250510
- // identifiers.
250511
-
250512
- var BUILD = R++
250513
- src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
250514
- '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
250515
-
250516
- // ## Full Version String
250517
- // A main version, followed optionally by a pre-release version and
250518
- // build metadata.
250519
-
250520
- // Note that the only major, minor, patch, and pre-release sections of
250521
- // the version string are capturing groups. The build metadata is not a
250522
- // capturing group, because it should not ever be used in version
250523
- // comparison.
250524
-
250525
- var FULL = R++
250526
- var FULLPLAIN = 'v?' + src[MAINVERSION] +
250527
- src[PRERELEASE] + '?' +
250528
- src[BUILD] + '?'
250529
-
250530
- src[FULL] = '^' + FULLPLAIN + '$'
250531
-
250532
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
250533
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
250534
- // common in the npm registry.
250535
- var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
250536
- src[PRERELEASELOOSE] + '?' +
250537
- src[BUILD] + '?'
250538
-
250539
- var LOOSE = R++
250540
- src[LOOSE] = '^' + LOOSEPLAIN + '$'
250541
-
250542
- var GTLT = R++
250543
- src[GTLT] = '((?:<|>)?=?)'
250544
-
250545
- // Something like "2.*" or "1.2.x".
250546
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
250547
- // Only the first item is strictly required.
250548
- var XRANGEIDENTIFIERLOOSE = R++
250549
- src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
250550
- var XRANGEIDENTIFIER = R++
250551
- src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
250552
-
250553
- var XRANGEPLAIN = R++
250554
- src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
250555
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
250556
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
250557
- '(?:' + src[PRERELEASE] + ')?' +
250558
- src[BUILD] + '?' +
250559
- ')?)?'
250560
-
250561
- var XRANGEPLAINLOOSE = R++
250562
- src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
250563
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
250564
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
250565
- '(?:' + src[PRERELEASELOOSE] + ')?' +
250566
- src[BUILD] + '?' +
250567
- ')?)?'
250568
-
250569
- var XRANGE = R++
250570
- src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
250571
- var XRANGELOOSE = R++
250572
- src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
250573
-
250574
- // Coercion.
250575
- // Extract anything that could conceivably be a part of a valid semver
250576
- var COERCE = R++
250577
- src[COERCE] = '(?:^|[^\\d])' +
250578
- '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
250579
- '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
250580
- '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
250581
- '(?:$|[^\\d])'
250582
-
250583
- // Tilde ranges.
250584
- // Meaning is "reasonably at or greater than"
250585
- var LONETILDE = R++
250586
- src[LONETILDE] = '(?:~>?)'
250587
-
250588
- var TILDETRIM = R++
250589
- src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
250590
- re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
250591
- var tildeTrimReplace = '$1~'
250592
-
250593
- var TILDE = R++
250594
- src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
250595
- var TILDELOOSE = R++
250596
- src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
250597
-
250598
- // Caret ranges.
250599
- // Meaning is "at least and backwards compatible with"
250600
- var LONECARET = R++
250601
- src[LONECARET] = '(?:\\^)'
250602
-
250603
- var CARETTRIM = R++
250604
- src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
250605
- re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
250606
- var caretTrimReplace = '$1^'
250607
-
250608
- var CARET = R++
250609
- src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
250610
- var CARETLOOSE = R++
250611
- src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
250612
-
250613
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
250614
- var COMPARATORLOOSE = R++
250615
- src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
250616
- var COMPARATOR = R++
250617
- src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
250618
-
250619
- // An expression to strip any whitespace between the gtlt and the thing
250620
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
250621
- var COMPARATORTRIM = R++
250622
- src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
250623
- '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
250624
-
250625
- // this one has to use the /g flag
250626
- re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
250627
- var comparatorTrimReplace = '$1$2$3'
250628
-
250629
- // Something like `1.2.3 - 1.2.4`
250630
- // Note that these all use the loose form, because they'll be
250631
- // checked against either the strict or loose comparator form
250632
- // later.
250633
- var HYPHENRANGE = R++
250634
- src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
250635
- '\\s+-\\s+' +
250636
- '(' + src[XRANGEPLAIN] + ')' +
250637
- '\\s*$'
250638
-
250639
- var HYPHENRANGELOOSE = R++
250640
- src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
250641
- '\\s+-\\s+' +
250642
- '(' + src[XRANGEPLAINLOOSE] + ')' +
250643
- '\\s*$'
250644
-
250645
- // Star ranges basically just allow anything at all.
250646
- var STAR = R++
250647
- src[STAR] = '(<|>)?=?\\s*\\*'
250648
-
250649
- // Compile to actual regexp objects.
250650
- // All are flag-free, unless they were created above with a flag.
250651
- for (var i = 0; i < R; i++) {
250652
- debug(i, src[i])
250653
- if (!re[i]) {
250654
- re[i] = new RegExp(src[i])
250655
- }
250656
- }
250657
-
250658
- exports.parse = parse
250659
- function parse (version, options) {
250660
- if (!options || typeof options !== 'object') {
250661
- options = {
250662
- loose: !!options,
250663
- includePrerelease: false
250664
- }
250665
- }
250666
-
250667
- if (version instanceof SemVer) {
250668
- return version
250669
- }
250670
-
250671
- if (typeof version !== 'string') {
250672
- return null
250673
- }
250674
-
250675
- if (version.length > MAX_LENGTH) {
250676
- return null
250677
- }
250678
-
250679
- var r = options.loose ? re[LOOSE] : re[FULL]
250680
- if (!r.test(version)) {
250681
- return null
250682
- }
249414
+ // info about each config option.
250683
249415
 
250684
- try {
250685
- return new SemVer(version, options)
250686
- } catch (er) {
250687
- return null
250688
- }
250689
- }
249416
+ var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
249417
+ ? function () { console.error.apply(console, arguments) }
249418
+ : function () {}
250690
249419
 
250691
- exports.valid = valid
250692
- function valid (version, options) {
250693
- var v = parse(version, options)
250694
- return v ? v.version : null
250695
- }
249420
+ var url = __webpack_require__(78835)
249421
+ , path = __webpack_require__(85622)
249422
+ , Stream = __webpack_require__(92413).Stream
249423
+ , abbrev = __webpack_require__(85920)
249424
+ , os = __webpack_require__(12087)
250696
249425
 
249426
+ module.exports = exports = nopt
250697
249427
  exports.clean = clean
250698
- function clean (version, options) {
250699
- var s = parse(version.trim().replace(/^[=v]+/, ''), options)
250700
- return s ? s.version : null
250701
- }
250702
-
250703
- exports.SemVer = SemVer
250704
249428
 
250705
- function SemVer (version, options) {
250706
- if (!options || typeof options !== 'object') {
250707
- options = {
250708
- loose: !!options,
250709
- includePrerelease: false
250710
- }
250711
- }
250712
- if (version instanceof SemVer) {
250713
- if (version.loose === options.loose) {
250714
- return version
250715
- } else {
250716
- version = version.version
250717
- }
250718
- } else if (typeof version !== 'string') {
250719
- throw new TypeError('Invalid Version: ' + version)
250720
- }
250721
-
250722
- if (version.length > MAX_LENGTH) {
250723
- throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
250724
- }
250725
-
250726
- if (!(this instanceof SemVer)) {
250727
- return new SemVer(version, options)
250728
- }
250729
-
250730
- debug('SemVer', version, options)
250731
- this.options = options
250732
- this.loose = !!options.loose
250733
-
250734
- var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
250735
-
250736
- if (!m) {
250737
- throw new TypeError('Invalid Version: ' + version)
250738
- }
250739
-
250740
- this.raw = version
250741
-
250742
- // these are actually numbers
250743
- this.major = +m[1]
250744
- this.minor = +m[2]
250745
- this.patch = +m[3]
250746
-
250747
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
250748
- throw new TypeError('Invalid major version')
249429
+ exports.typeDefs =
249430
+ { String : { type: String, validate: validateString }
249431
+ , Boolean : { type: Boolean, validate: validateBoolean }
249432
+ , url : { type: url, validate: validateUrl }
249433
+ , Number : { type: Number, validate: validateNumber }
249434
+ , path : { type: path, validate: validatePath }
249435
+ , Stream : { type: Stream, validate: validateStream }
249436
+ , Date : { type: Date, validate: validateDate }
250749
249437
  }
250750
249438
 
250751
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
250752
- throw new TypeError('Invalid minor version')
250753
- }
249439
+ function nopt (types, shorthands, args, slice) {
249440
+ args = args || process.argv
249441
+ types = types || {}
249442
+ shorthands = shorthands || {}
249443
+ if (typeof slice !== "number") slice = 2
250754
249444
 
250755
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
250756
- throw new TypeError('Invalid patch version')
250757
- }
249445
+ debug(types, shorthands, args, slice)
250758
249446
 
250759
- // numberify any prerelease numeric ids
250760
- if (!m[4]) {
250761
- this.prerelease = []
250762
- } else {
250763
- this.prerelease = m[4].split('.').map(function (id) {
250764
- if (/^[0-9]+$/.test(id)) {
250765
- var num = +id
250766
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
250767
- return num
250768
- }
249447
+ args = args.slice(slice)
249448
+ var data = {}
249449
+ , key
249450
+ , argv = {
249451
+ remain: [],
249452
+ cooked: args,
249453
+ original: args.slice(0)
250769
249454
  }
250770
- return id
250771
- })
250772
- }
250773
-
250774
- this.build = m[5] ? m[5].split('.') : []
250775
- this.format()
250776
- }
250777
-
250778
- SemVer.prototype.format = function () {
250779
- this.version = this.major + '.' + this.minor + '.' + this.patch
250780
- if (this.prerelease.length) {
250781
- this.version += '-' + this.prerelease.join('.')
250782
- }
250783
- return this.version
250784
- }
250785
-
250786
- SemVer.prototype.toString = function () {
250787
- return this.version
250788
- }
250789
-
250790
- SemVer.prototype.compare = function (other) {
250791
- debug('SemVer.compare', this.version, this.options, other)
250792
- if (!(other instanceof SemVer)) {
250793
- other = new SemVer(other, this.options)
250794
- }
250795
-
250796
- return this.compareMain(other) || this.comparePre(other)
250797
- }
250798
-
250799
- SemVer.prototype.compareMain = function (other) {
250800
- if (!(other instanceof SemVer)) {
250801
- other = new SemVer(other, this.options)
250802
- }
250803
249455
 
250804
- return compareIdentifiers(this.major, other.major) ||
250805
- compareIdentifiers(this.minor, other.minor) ||
250806
- compareIdentifiers(this.patch, other.patch)
249456
+ parse(args, data, argv.remain, types, shorthands)
249457
+ // now data is full
249458
+ clean(data, types, exports.typeDefs)
249459
+ data.argv = argv
249460
+ Object.defineProperty(data.argv, 'toString', { value: function () {
249461
+ return this.original.map(JSON.stringify).join(" ")
249462
+ }, enumerable: false })
249463
+ return data
250807
249464
  }
250808
249465
 
250809
- SemVer.prototype.comparePre = function (other) {
250810
- if (!(other instanceof SemVer)) {
250811
- other = new SemVer(other, this.options)
250812
- }
250813
-
250814
- // NOT having a prerelease is > having one
250815
- if (this.prerelease.length && !other.prerelease.length) {
250816
- return -1
250817
- } else if (!this.prerelease.length && other.prerelease.length) {
250818
- return 1
250819
- } else if (!this.prerelease.length && !other.prerelease.length) {
250820
- return 0
250821
- }
250822
-
250823
- var i = 0
250824
- do {
250825
- var a = this.prerelease[i]
250826
- var b = other.prerelease[i]
250827
- debug('prerelease compare', i, a, b)
250828
- if (a === undefined && b === undefined) {
250829
- return 0
250830
- } else if (b === undefined) {
250831
- return 1
250832
- } else if (a === undefined) {
250833
- return -1
250834
- } else if (a === b) {
250835
- continue
250836
- } else {
250837
- return compareIdentifiers(a, b)
250838
- }
250839
- } while (++i)
250840
- }
249466
+ function clean (data, types, typeDefs) {
249467
+ typeDefs = typeDefs || exports.typeDefs
249468
+ var remove = {}
249469
+ , typeDefault = [false, true, null, String, Array]
250841
249470
 
250842
- // preminor will bump the version up to the next minor release, and immediately
250843
- // down to pre-release. premajor and prepatch work the same way.
250844
- SemVer.prototype.inc = function (release, identifier) {
250845
- switch (release) {
250846
- case 'premajor':
250847
- this.prerelease.length = 0
250848
- this.patch = 0
250849
- this.minor = 0
250850
- this.major++
250851
- this.inc('pre', identifier)
250852
- break
250853
- case 'preminor':
250854
- this.prerelease.length = 0
250855
- this.patch = 0
250856
- this.minor++
250857
- this.inc('pre', identifier)
250858
- break
250859
- case 'prepatch':
250860
- // If this is already a prerelease, it will bump to the next version
250861
- // drop any prereleases that might already exist, since they are not
250862
- // relevant at this point.
250863
- this.prerelease.length = 0
250864
- this.inc('patch', identifier)
250865
- this.inc('pre', identifier)
250866
- break
250867
- // If the input is a non-prerelease version, this acts the same as
250868
- // prepatch.
250869
- case 'prerelease':
250870
- if (this.prerelease.length === 0) {
250871
- this.inc('patch', identifier)
250872
- }
250873
- this.inc('pre', identifier)
250874
- break
249471
+ Object.keys(data).forEach(function (k) {
249472
+ if (k === "argv") return
249473
+ var val = data[k]
249474
+ , isArray = Array.isArray(val)
249475
+ , type = types[k]
249476
+ if (!isArray) val = [val]
249477
+ if (!type) type = typeDefault
249478
+ if (type === Array) type = typeDefault.concat(Array)
249479
+ if (!Array.isArray(type)) type = [type]
250875
249480
 
250876
- case 'major':
250877
- // If this is a pre-major version, bump up to the same major version.
250878
- // Otherwise increment major.
250879
- // 1.0.0-5 bumps to 1.0.0
250880
- // 1.1.0 bumps to 2.0.0
250881
- if (this.minor !== 0 ||
250882
- this.patch !== 0 ||
250883
- this.prerelease.length === 0) {
250884
- this.major++
250885
- }
250886
- this.minor = 0
250887
- this.patch = 0
250888
- this.prerelease = []
250889
- break
250890
- case 'minor':
250891
- // If this is a pre-minor version, bump up to the same minor version.
250892
- // Otherwise increment minor.
250893
- // 1.2.0-5 bumps to 1.2.0
250894
- // 1.2.1 bumps to 1.3.0
250895
- if (this.patch !== 0 || this.prerelease.length === 0) {
250896
- this.minor++
250897
- }
250898
- this.patch = 0
250899
- this.prerelease = []
250900
- break
250901
- case 'patch':
250902
- // If this is not a pre-release version, it will increment the patch.
250903
- // If it is a pre-release it will bump up to the same patch version.
250904
- // 1.2.0-5 patches to 1.2.0
250905
- // 1.2.0 patches to 1.2.1
250906
- if (this.prerelease.length === 0) {
250907
- this.patch++
250908
- }
250909
- this.prerelease = []
250910
- break
250911
- // This probably shouldn't be used publicly.
250912
- // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
250913
- case 'pre':
250914
- if (this.prerelease.length === 0) {
250915
- this.prerelease = [0]
250916
- } else {
250917
- var i = this.prerelease.length
250918
- while (--i >= 0) {
250919
- if (typeof this.prerelease[i] === 'number') {
250920
- this.prerelease[i]++
250921
- i = -2
250922
- }
250923
- }
250924
- if (i === -1) {
250925
- // didn't increment anything
250926
- this.prerelease.push(0)
250927
- }
250928
- }
250929
- if (identifier) {
250930
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
250931
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
250932
- if (this.prerelease[0] === identifier) {
250933
- if (isNaN(this.prerelease[1])) {
250934
- this.prerelease = [identifier, 0]
250935
- }
250936
- } else {
250937
- this.prerelease = [identifier, 0]
249481
+ debug("val=%j", val)
249482
+ debug("types=", type)
249483
+ val = val.map(function (val) {
249484
+ // if it's an unknown value, then parse false/true/null/numbers/dates
249485
+ if (typeof val === "string") {
249486
+ debug("string %j", val)
249487
+ val = val.trim()
249488
+ if ((val === "null" && ~type.indexOf(null))
249489
+ || (val === "true" &&
249490
+ (~type.indexOf(true) || ~type.indexOf(Boolean)))
249491
+ || (val === "false" &&
249492
+ (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
249493
+ val = JSON.parse(val)
249494
+ debug("jsonable %j", val)
249495
+ } else if (~type.indexOf(Number) && !isNaN(val)) {
249496
+ debug("convert to number", val)
249497
+ val = +val
249498
+ } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
249499
+ debug("convert to date", val)
249500
+ val = new Date(val)
250938
249501
  }
250939
249502
  }
250940
- break
250941
249503
 
250942
- default:
250943
- throw new Error('invalid increment argument: ' + release)
250944
- }
250945
- this.format()
250946
- this.raw = this.version
250947
- return this
250948
- }
250949
-
250950
- exports.inc = inc
250951
- function inc (version, release, loose, identifier) {
250952
- if (typeof (loose) === 'string') {
250953
- identifier = loose
250954
- loose = undefined
250955
- }
249504
+ if (!types.hasOwnProperty(k)) {
249505
+ return val
249506
+ }
250956
249507
 
250957
- try {
250958
- return new SemVer(version, loose).inc(release, identifier).version
250959
- } catch (er) {
250960
- return null
250961
- }
250962
- }
249508
+ // allow `--no-blah` to set 'blah' to null if null is allowed
249509
+ if (val === false && ~type.indexOf(null) &&
249510
+ !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
249511
+ val = null
249512
+ }
250963
249513
 
250964
- exports.diff = diff
250965
- function diff (version1, version2) {
250966
- if (eq(version1, version2)) {
250967
- return null
250968
- } else {
250969
- var v1 = parse(version1)
250970
- var v2 = parse(version2)
250971
- var prefix = ''
250972
- if (v1.prerelease.length || v2.prerelease.length) {
250973
- prefix = 'pre'
250974
- var defaultResult = 'prerelease'
250975
- }
250976
- for (var key in v1) {
250977
- if (key === 'major' || key === 'minor' || key === 'patch') {
250978
- if (v1[key] !== v2[key]) {
250979
- return prefix + key
249514
+ var d = {}
249515
+ d[k] = val
249516
+ debug("prevalidated val", d, val, types[k])
249517
+ if (!validate(d, k, val, types[k], typeDefs)) {
249518
+ if (exports.invalidHandler) {
249519
+ exports.invalidHandler(k, val, types[k], data)
249520
+ } else if (exports.invalidHandler !== false) {
249521
+ debug("invalid: "+k+"="+val, types[k])
250980
249522
  }
249523
+ return remove
250981
249524
  }
250982
- }
250983
- return defaultResult // may be undefined
250984
- }
250985
- }
250986
-
250987
- exports.compareIdentifiers = compareIdentifiers
250988
-
250989
- var numeric = /^[0-9]+$/
250990
- function compareIdentifiers (a, b) {
250991
- var anum = numeric.test(a)
250992
- var bnum = numeric.test(b)
250993
-
250994
- if (anum && bnum) {
250995
- a = +a
250996
- b = +b
250997
- }
250998
-
250999
- return a === b ? 0
251000
- : (anum && !bnum) ? -1
251001
- : (bnum && !anum) ? 1
251002
- : a < b ? -1
251003
- : 1
251004
- }
251005
-
251006
- exports.rcompareIdentifiers = rcompareIdentifiers
251007
- function rcompareIdentifiers (a, b) {
251008
- return compareIdentifiers(b, a)
251009
- }
251010
-
251011
- exports.major = major
251012
- function major (a, loose) {
251013
- return new SemVer(a, loose).major
251014
- }
251015
-
251016
- exports.minor = minor
251017
- function minor (a, loose) {
251018
- return new SemVer(a, loose).minor
251019
- }
251020
-
251021
- exports.patch = patch
251022
- function patch (a, loose) {
251023
- return new SemVer(a, loose).patch
251024
- }
251025
-
251026
- exports.compare = compare
251027
- function compare (a, b, loose) {
251028
- return new SemVer(a, loose).compare(new SemVer(b, loose))
251029
- }
251030
-
251031
- exports.compareLoose = compareLoose
251032
- function compareLoose (a, b) {
251033
- return compare(a, b, true)
251034
- }
251035
-
251036
- exports.rcompare = rcompare
251037
- function rcompare (a, b, loose) {
251038
- return compare(b, a, loose)
251039
- }
249525
+ debug("validated val", d, val, types[k])
249526
+ return d[k]
249527
+ }).filter(function (val) { return val !== remove })
251040
249528
 
251041
- exports.sort = sort
251042
- function sort (list, loose) {
251043
- return list.sort(function (a, b) {
251044
- return exports.compare(a, b, loose)
251045
- })
251046
- }
249529
+ // if we allow Array specifically, then an empty array is how we
249530
+ // express 'no value here', not null. Allow it.
249531
+ if (!val.length && type.indexOf(Array) === -1) {
249532
+ debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array))
249533
+ delete data[k]
249534
+ }
249535
+ else if (isArray) {
249536
+ debug(isArray, data[k], val)
249537
+ data[k] = val
249538
+ } else data[k] = val[0]
251047
249539
 
251048
- exports.rsort = rsort
251049
- function rsort (list, loose) {
251050
- return list.sort(function (a, b) {
251051
- return exports.rcompare(a, b, loose)
249540
+ debug("k=%s val=%j", k, val, data[k])
251052
249541
  })
251053
249542
  }
251054
249543
 
251055
- exports.gt = gt
251056
- function gt (a, b, loose) {
251057
- return compare(a, b, loose) > 0
251058
- }
251059
-
251060
- exports.lt = lt
251061
- function lt (a, b, loose) {
251062
- return compare(a, b, loose) < 0
251063
- }
251064
-
251065
- exports.eq = eq
251066
- function eq (a, b, loose) {
251067
- return compare(a, b, loose) === 0
251068
- }
251069
-
251070
- exports.neq = neq
251071
- function neq (a, b, loose) {
251072
- return compare(a, b, loose) !== 0
251073
- }
251074
-
251075
- exports.gte = gte
251076
- function gte (a, b, loose) {
251077
- return compare(a, b, loose) >= 0
251078
- }
251079
-
251080
- exports.lte = lte
251081
- function lte (a, b, loose) {
251082
- return compare(a, b, loose) <= 0
251083
- }
251084
-
251085
- exports.cmp = cmp
251086
- function cmp (a, op, b, loose) {
251087
- switch (op) {
251088
- case '===':
251089
- if (typeof a === 'object')
251090
- a = a.version
251091
- if (typeof b === 'object')
251092
- b = b.version
251093
- return a === b
251094
-
251095
- case '!==':
251096
- if (typeof a === 'object')
251097
- a = a.version
251098
- if (typeof b === 'object')
251099
- b = b.version
251100
- return a !== b
251101
-
251102
- case '':
251103
- case '=':
251104
- case '==':
251105
- return eq(a, b, loose)
251106
-
251107
- case '!=':
251108
- return neq(a, b, loose)
251109
-
251110
- case '>':
251111
- return gt(a, b, loose)
251112
-
251113
- case '>=':
251114
- return gte(a, b, loose)
251115
-
251116
- case '<':
251117
- return lt(a, b, loose)
251118
-
251119
- case '<=':
251120
- return lte(a, b, loose)
251121
-
251122
- default:
251123
- throw new TypeError('Invalid operator: ' + op)
251124
- }
249544
+ function validateString (data, k, val) {
249545
+ data[k] = String(val)
251125
249546
  }
251126
249547
 
251127
- exports.Comparator = Comparator
251128
- function Comparator (comp, options) {
251129
- if (!options || typeof options !== 'object') {
251130
- options = {
251131
- loose: !!options,
251132
- includePrerelease: false
251133
- }
251134
- }
251135
-
251136
- if (comp instanceof Comparator) {
251137
- if (comp.loose === !!options.loose) {
251138
- return comp
251139
- } else {
251140
- comp = comp.value
251141
- }
251142
- }
249548
+ function validatePath (data, k, val) {
249549
+ if (val === true) return false
249550
+ if (val === null) return true
251143
249551
 
251144
- if (!(this instanceof Comparator)) {
251145
- return new Comparator(comp, options)
251146
- }
249552
+ val = String(val)
251147
249553
 
251148
- debug('comparator', comp, options)
251149
- this.options = options
251150
- this.loose = !!options.loose
251151
- this.parse(comp)
249554
+ var isWin = process.platform === 'win32'
249555
+ , homePattern = isWin ? /^~(\/|\\)/ : /^~\//
249556
+ , home = os.homedir()
251152
249557
 
251153
- if (this.semver === ANY) {
251154
- this.value = ''
249558
+ if (home && val.match(homePattern)) {
249559
+ data[k] = path.resolve(home, val.substr(2))
251155
249560
  } else {
251156
- this.value = this.operator + this.semver.version
249561
+ data[k] = path.resolve(val)
251157
249562
  }
251158
-
251159
- debug('comp', this)
249563
+ return true
251160
249564
  }
251161
249565
 
251162
- var ANY = {}
251163
- Comparator.prototype.parse = function (comp) {
251164
- var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
251165
- var m = comp.match(r)
251166
-
251167
- if (!m) {
251168
- throw new TypeError('Invalid comparator: ' + comp)
251169
- }
251170
-
251171
- this.operator = m[1]
251172
- if (this.operator === '=') {
251173
- this.operator = ''
251174
- }
251175
-
251176
- // if it literally is just '>' or '' then allow anything.
251177
- if (!m[2]) {
251178
- this.semver = ANY
251179
- } else {
251180
- this.semver = new SemVer(m[2], this.options.loose)
251181
- }
249566
+ function validateNumber (data, k, val) {
249567
+ debug("validate Number %j %j %j", k, val, isNaN(val))
249568
+ if (isNaN(val)) return false
249569
+ data[k] = +val
251182
249570
  }
251183
249571
 
251184
- Comparator.prototype.toString = function () {
251185
- return this.value
249572
+ function validateDate (data, k, val) {
249573
+ var s = Date.parse(val)
249574
+ debug("validate Date %j %j %j", k, val, s)
249575
+ if (isNaN(s)) return false
249576
+ data[k] = new Date(val)
251186
249577
  }
251187
249578
 
251188
- Comparator.prototype.test = function (version) {
251189
- debug('Comparator.test', version, this.options.loose)
251190
-
251191
- if (this.semver === ANY) {
251192
- return true
251193
- }
251194
-
251195
- if (typeof version === 'string') {
251196
- version = new SemVer(version, this.options)
251197
- }
251198
-
251199
- return cmp(version, this.operator, this.semver, this.options)
249579
+ function validateBoolean (data, k, val) {
249580
+ if (val instanceof Boolean) val = val.valueOf()
249581
+ else if (typeof val === "string") {
249582
+ if (!isNaN(val)) val = !!(+val)
249583
+ else if (val === "null" || val === "false") val = false
249584
+ else val = true
249585
+ } else val = !!val
249586
+ data[k] = val
251200
249587
  }
251201
249588
 
251202
- Comparator.prototype.intersects = function (comp, options) {
251203
- if (!(comp instanceof Comparator)) {
251204
- throw new TypeError('a Comparator is required')
251205
- }
251206
-
251207
- if (!options || typeof options !== 'object') {
251208
- options = {
251209
- loose: !!options,
251210
- includePrerelease: false
251211
- }
251212
- }
251213
-
251214
- var rangeTmp
251215
-
251216
- if (this.operator === '') {
251217
- rangeTmp = new Range(comp.value, options)
251218
- return satisfies(this.value, rangeTmp, options)
251219
- } else if (comp.operator === '') {
251220
- rangeTmp = new Range(this.value, options)
251221
- return satisfies(comp.semver, rangeTmp, options)
251222
- }
251223
-
251224
- var sameDirectionIncreasing =
251225
- (this.operator === '>=' || this.operator === '>') &&
251226
- (comp.operator === '>=' || comp.operator === '>')
251227
- var sameDirectionDecreasing =
251228
- (this.operator === '<=' || this.operator === '<') &&
251229
- (comp.operator === '<=' || comp.operator === '<')
251230
- var sameSemVer = this.semver.version === comp.semver.version
251231
- var differentDirectionsInclusive =
251232
- (this.operator === '>=' || this.operator === '<=') &&
251233
- (comp.operator === '>=' || comp.operator === '<=')
251234
- var oppositeDirectionsLessThan =
251235
- cmp(this.semver, '<', comp.semver, options) &&
251236
- ((this.operator === '>=' || this.operator === '>') &&
251237
- (comp.operator === '<=' || comp.operator === '<'))
251238
- var oppositeDirectionsGreaterThan =
251239
- cmp(this.semver, '>', comp.semver, options) &&
251240
- ((this.operator === '<=' || this.operator === '<') &&
251241
- (comp.operator === '>=' || comp.operator === '>'))
251242
-
251243
- return sameDirectionIncreasing || sameDirectionDecreasing ||
251244
- (sameSemVer && differentDirectionsInclusive) ||
251245
- oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
249589
+ function validateUrl (data, k, val) {
249590
+ val = url.parse(String(val))
249591
+ if (!val.host) return false
249592
+ data[k] = val.href
251246
249593
  }
251247
249594
 
251248
- exports.Range = Range
251249
- function Range (range, options) {
251250
- if (!options || typeof options !== 'object') {
251251
- options = {
251252
- loose: !!options,
251253
- includePrerelease: false
251254
- }
251255
- }
249595
+ function validateStream (data, k, val) {
249596
+ if (!(val instanceof Stream)) return false
249597
+ data[k] = val
249598
+ }
251256
249599
 
251257
- if (range instanceof Range) {
251258
- if (range.loose === !!options.loose &&
251259
- range.includePrerelease === !!options.includePrerelease) {
251260
- return range
251261
- } else {
251262
- return new Range(range.raw, options)
249600
+ function validate (data, k, val, type, typeDefs) {
249601
+ // arrays are lists of types.
249602
+ if (Array.isArray(type)) {
249603
+ for (var i = 0, l = type.length; i < l; i ++) {
249604
+ if (type[i] === Array) continue
249605
+ if (validate(data, k, val, type[i], typeDefs)) return true
251263
249606
  }
249607
+ delete data[k]
249608
+ return false
251264
249609
  }
251265
249610
 
251266
- if (range instanceof Comparator) {
251267
- return new Range(range.value, options)
251268
- }
251269
-
251270
- if (!(this instanceof Range)) {
251271
- return new Range(range, options)
251272
- }
251273
-
251274
- this.options = options
251275
- this.loose = !!options.loose
251276
- this.includePrerelease = !!options.includePrerelease
251277
-
251278
- // First, split based on boolean or ||
251279
- this.raw = range
251280
- this.set = range.split(/\s*\|\|\s*/).map(function (range) {
251281
- return this.parseRange(range.trim())
251282
- }, this).filter(function (c) {
251283
- // throw out any that are not relevant for whatever reason
251284
- return c.length
251285
- })
249611
+ // an array of anything?
249612
+ if (type === Array) return true
251286
249613
 
251287
- if (!this.set.length) {
251288
- throw new TypeError('Invalid SemVer Range: ' + range)
249614
+ // NaN is poisonous. Means that something is not allowed.
249615
+ if (type !== type) {
249616
+ debug("Poison NaN", k, val, type)
249617
+ delete data[k]
249618
+ return false
251289
249619
  }
251290
249620
 
251291
- this.format()
251292
- }
251293
-
251294
- Range.prototype.format = function () {
251295
- this.range = this.set.map(function (comps) {
251296
- return comps.join(' ').trim()
251297
- }).join('||').trim()
251298
- return this.range
251299
- }
251300
-
251301
- Range.prototype.toString = function () {
251302
- return this.range
251303
- }
251304
-
251305
- Range.prototype.parseRange = function (range) {
251306
- var loose = this.options.loose
251307
- range = range.trim()
251308
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
251309
- var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
251310
- range = range.replace(hr, hyphenReplace)
251311
- debug('hyphen replace', range)
251312
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
251313
- range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
251314
- debug('comparator trim', range, re[COMPARATORTRIM])
251315
-
251316
- // `~ 1.2.3` => `~1.2.3`
251317
- range = range.replace(re[TILDETRIM], tildeTrimReplace)
251318
-
251319
- // `^ 1.2.3` => `^1.2.3`
251320
- range = range.replace(re[CARETTRIM], caretTrimReplace)
251321
-
251322
- // normalize spaces
251323
- range = range.split(/\s+/).join(' ')
251324
-
251325
- // At this point, the range is completely trimmed and
251326
- // ready to be split into comparators.
251327
-
251328
- var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
251329
- var set = range.split(' ').map(function (comp) {
251330
- return parseComparator(comp, this.options)
251331
- }, this).join(' ').split(/\s+/)
251332
- if (this.options.loose) {
251333
- // in loose mode, throw out any that are not valid comparators
251334
- set = set.filter(function (comp) {
251335
- return !!comp.match(compRe)
251336
- })
249621
+ // explicit list of values
249622
+ if (val === type) {
249623
+ debug("Explicitly allowed %j", val)
249624
+ // if (isArray) (data[k] = data[k] || []).push(val)
249625
+ // else data[k] = val
249626
+ data[k] = val
249627
+ return true
251337
249628
  }
251338
- set = set.map(function (comp) {
251339
- return new Comparator(comp, this.options)
251340
- }, this)
251341
-
251342
- return set
251343
- }
251344
249629
 
251345
- Range.prototype.intersects = function (range, options) {
251346
- if (!(range instanceof Range)) {
251347
- throw new TypeError('a Range is required')
249630
+ // now go through the list of typeDefs, validate against each one.
249631
+ var ok = false
249632
+ , types = Object.keys(typeDefs)
249633
+ for (var i = 0, l = types.length; i < l; i ++) {
249634
+ debug("test type %j %j %j", k, val, types[i])
249635
+ var t = typeDefs[types[i]]
249636
+ if (t &&
249637
+ ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) {
249638
+ var d = {}
249639
+ ok = false !== t.validate(d, k, val)
249640
+ val = d[k]
249641
+ if (ok) {
249642
+ // if (isArray) (data[k] = data[k] || []).push(val)
249643
+ // else data[k] = val
249644
+ data[k] = val
249645
+ break
249646
+ }
249647
+ }
251348
249648
  }
249649
+ debug("OK? %j (%j %j %j)", ok, k, val, types[i])
251349
249650
 
251350
- return this.set.some(function (thisComparators) {
251351
- return thisComparators.every(function (thisComparator) {
251352
- return range.set.some(function (rangeComparators) {
251353
- return rangeComparators.every(function (rangeComparator) {
251354
- return thisComparator.intersects(rangeComparator, options)
251355
- })
251356
- })
251357
- })
251358
- })
251359
- }
251360
-
251361
- // Mostly just for testing and legacy API reasons
251362
- exports.toComparators = toComparators
251363
- function toComparators (range, options) {
251364
- return new Range(range, options).set.map(function (comp) {
251365
- return comp.map(function (c) {
251366
- return c.value
251367
- }).join(' ').trim().split(' ')
251368
- })
251369
- }
251370
-
251371
- // comprised of xranges, tildes, stars, and gtlt's at this point.
251372
- // already replaced the hyphen ranges
251373
- // turn into a set of JUST comparators.
251374
- function parseComparator (comp, options) {
251375
- debug('comp', comp, options)
251376
- comp = replaceCarets(comp, options)
251377
- debug('caret', comp)
251378
- comp = replaceTildes(comp, options)
251379
- debug('tildes', comp)
251380
- comp = replaceXRanges(comp, options)
251381
- debug('xrange', comp)
251382
- comp = replaceStars(comp, options)
251383
- debug('stars', comp)
251384
- return comp
249651
+ if (!ok) delete data[k]
249652
+ return ok
251385
249653
  }
251386
249654
 
251387
- function isX (id) {
251388
- return !id || id.toLowerCase() === 'x' || id === '*'
251389
- }
249655
+ function parse (args, data, remain, types, shorthands) {
249656
+ debug("parse", args, data, remain)
251390
249657
 
251391
- // ~, ~> --> * (any, kinda silly)
251392
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
251393
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
251394
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
251395
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
251396
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
251397
- function replaceTildes (comp, options) {
251398
- return comp.trim().split(/\s+/).map(function (comp) {
251399
- return replaceTilde(comp, options)
251400
- }).join(' ')
251401
- }
249658
+ var key = null
249659
+ , abbrevs = abbrev(Object.keys(types))
249660
+ , shortAbbr = abbrev(Object.keys(shorthands))
251402
249661
 
251403
- function replaceTilde (comp, options) {
251404
- var r = options.loose ? re[TILDELOOSE] : re[TILDE]
251405
- return comp.replace(r, function (_, M, m, p, pr) {
251406
- debug('tilde', comp, _, M, m, p, pr)
251407
- var ret
249662
+ for (var i = 0; i < args.length; i ++) {
249663
+ var arg = args[i]
249664
+ debug("arg", arg)
251408
249665
 
251409
- if (isX(M)) {
251410
- ret = ''
251411
- } else if (isX(m)) {
251412
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
251413
- } else if (isX(p)) {
251414
- // ~1.2 == >=1.2.0 <1.3.0
251415
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
251416
- } else if (pr) {
251417
- debug('replaceTilde pr', pr)
251418
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
251419
- ' <' + M + '.' + (+m + 1) + '.0'
251420
- } else {
251421
- // ~1.2.3 == >=1.2.3 <1.3.0
251422
- ret = '>=' + M + '.' + m + '.' + p +
251423
- ' <' + M + '.' + (+m + 1) + '.0'
249666
+ if (arg.match(/^-{2,}$/)) {
249667
+ // done with keys.
249668
+ // the rest are args.
249669
+ remain.push.apply(remain, args.slice(i + 1))
249670
+ args[i] = "--"
249671
+ break
251424
249672
  }
251425
-
251426
- debug('tilde return', ret)
251427
- return ret
251428
- })
251429
- }
251430
-
251431
- // ^ --> * (any, kinda silly)
251432
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
251433
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
251434
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
251435
- // ^1.2.3 --> >=1.2.3 <2.0.0
251436
- // ^1.2.0 --> >=1.2.0 <2.0.0
251437
- function replaceCarets (comp, options) {
251438
- return comp.trim().split(/\s+/).map(function (comp) {
251439
- return replaceCaret(comp, options)
251440
- }).join(' ')
251441
- }
251442
-
251443
- function replaceCaret (comp, options) {
251444
- debug('caret', comp, options)
251445
- var r = options.loose ? re[CARETLOOSE] : re[CARET]
251446
- return comp.replace(r, function (_, M, m, p, pr) {
251447
- debug('caret', comp, _, M, m, p, pr)
251448
- var ret
251449
-
251450
- if (isX(M)) {
251451
- ret = ''
251452
- } else if (isX(m)) {
251453
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
251454
- } else if (isX(p)) {
251455
- if (M === '0') {
251456
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
251457
- } else {
251458
- ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
249673
+ var hadEq = false
249674
+ if (arg.charAt(0) === "-" && arg.length > 1) {
249675
+ var at = arg.indexOf('=')
249676
+ if (at > -1) {
249677
+ hadEq = true
249678
+ var v = arg.substr(at + 1)
249679
+ arg = arg.substr(0, at)
249680
+ args.splice(i, 1, arg, v)
251459
249681
  }
251460
- } else if (pr) {
251461
- debug('replaceCaret pr', pr)
251462
- if (M === '0') {
251463
- if (m === '0') {
251464
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
251465
- ' <' + M + '.' + m + '.' + (+p + 1)
251466
- } else {
251467
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
251468
- ' <' + M + '.' + (+m + 1) + '.0'
249682
+
249683
+ // see if it's a shorthand
249684
+ // if so, splice and back up to re-parse it.
249685
+ var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
249686
+ debug("arg=%j shRes=%j", arg, shRes)
249687
+ if (shRes) {
249688
+ debug(arg, shRes)
249689
+ args.splice.apply(args, [i, 1].concat(shRes))
249690
+ if (arg !== shRes[0]) {
249691
+ i --
249692
+ continue
251469
249693
  }
251470
- } else {
251471
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
251472
- ' <' + (+M + 1) + '.0.0'
251473
249694
  }
251474
- } else {
251475
- debug('no pr')
251476
- if (M === '0') {
251477
- if (m === '0') {
251478
- ret = '>=' + M + '.' + m + '.' + p +
251479
- ' <' + M + '.' + m + '.' + (+p + 1)
251480
- } else {
251481
- ret = '>=' + M + '.' + m + '.' + p +
251482
- ' <' + M + '.' + (+m + 1) + '.0'
251483
- }
251484
- } else {
251485
- ret = '>=' + M + '.' + m + '.' + p +
251486
- ' <' + (+M + 1) + '.0.0'
249695
+ arg = arg.replace(/^-+/, "")
249696
+ var no = null
249697
+ while (arg.toLowerCase().indexOf("no-") === 0) {
249698
+ no = !no
249699
+ arg = arg.substr(3)
251487
249700
  }
251488
- }
251489
-
251490
- debug('caret return', ret)
251491
- return ret
251492
- })
251493
- }
251494
-
251495
- function replaceXRanges (comp, options) {
251496
- debug('replaceXRanges', comp, options)
251497
- return comp.split(/\s+/).map(function (comp) {
251498
- return replaceXRange(comp, options)
251499
- }).join(' ')
251500
- }
251501
-
251502
- function replaceXRange (comp, options) {
251503
- comp = comp.trim()
251504
- var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
251505
- return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
251506
- debug('xRange', comp, ret, gtlt, M, m, p, pr)
251507
- var xM = isX(M)
251508
- var xm = xM || isX(m)
251509
- var xp = xm || isX(p)
251510
- var anyX = xp
251511
-
251512
- if (gtlt === '=' && anyX) {
251513
- gtlt = ''
251514
- }
251515
249701
 
251516
- if (xM) {
251517
- if (gtlt === '>' || gtlt === '<') {
251518
- // nothing is allowed
251519
- ret = '<0.0.0'
251520
- } else {
251521
- // nothing is forbidden
251522
- ret = '*'
251523
- }
251524
- } else if (gtlt && anyX) {
251525
- // we know patch is an x, because we have any x at all.
251526
- // replace X with 0
251527
- if (xm) {
251528
- m = 0
251529
- }
251530
- p = 0
249702
+ if (abbrevs[arg]) arg = abbrevs[arg]
251531
249703
 
251532
- if (gtlt === '>') {
251533
- // >1 => >=2.0.0
251534
- // >1.2 => >=1.3.0
251535
- // >1.2.3 => >= 1.2.4
251536
- gtlt = '>='
251537
- if (xm) {
251538
- M = +M + 1
251539
- m = 0
251540
- p = 0
251541
- } else {
251542
- m = +m + 1
251543
- p = 0
251544
- }
251545
- } else if (gtlt === '<=') {
251546
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
251547
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
251548
- gtlt = '<'
251549
- if (xm) {
251550
- M = +M + 1
251551
- } else {
251552
- m = +m + 1
251553
- }
249704
+ var argType = types[arg]
249705
+ var isTypeArray = Array.isArray(argType)
249706
+ if (isTypeArray && argType.length === 1) {
249707
+ isTypeArray = false
249708
+ argType = argType[0]
251554
249709
  }
251555
249710
 
251556
- ret = gtlt + M + '.' + m + '.' + p
251557
- } else if (xm) {
251558
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
251559
- } else if (xp) {
251560
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
251561
- }
251562
-
251563
- debug('xRange return', ret)
251564
-
251565
- return ret
251566
- })
251567
- }
251568
-
251569
- // Because * is AND-ed with everything else in the comparator,
251570
- // and '' means "any version", just remove the *s entirely.
251571
- function replaceStars (comp, options) {
251572
- debug('replaceStars', comp, options)
251573
- // Looseness is ignored here. star is always as loose as it gets!
251574
- return comp.trim().replace(re[STAR], '')
251575
- }
251576
-
251577
- // This function is passed to string.replace(re[HYPHENRANGE])
251578
- // M, m, patch, prerelease, build
251579
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
251580
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
251581
- // 1.2 - 3.4 => >=1.2.0 <3.5.0
251582
- function hyphenReplace ($0,
251583
- from, fM, fm, fp, fpr, fb,
251584
- to, tM, tm, tp, tpr, tb) {
251585
- if (isX(fM)) {
251586
- from = ''
251587
- } else if (isX(fm)) {
251588
- from = '>=' + fM + '.0.0'
251589
- } else if (isX(fp)) {
251590
- from = '>=' + fM + '.' + fm + '.0'
251591
- } else {
251592
- from = '>=' + from
251593
- }
249711
+ var isArray = argType === Array ||
249712
+ isTypeArray && argType.indexOf(Array) !== -1
251594
249713
 
251595
- if (isX(tM)) {
251596
- to = ''
251597
- } else if (isX(tm)) {
251598
- to = '<' + (+tM + 1) + '.0.0'
251599
- } else if (isX(tp)) {
251600
- to = '<' + tM + '.' + (+tm + 1) + '.0'
251601
- } else if (tpr) {
251602
- to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
251603
- } else {
251604
- to = '<=' + to
251605
- }
249714
+ // allow unknown things to be arrays if specified multiple times.
249715
+ if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
249716
+ if (!Array.isArray(data[arg]))
249717
+ data[arg] = [data[arg]]
249718
+ isArray = true
249719
+ }
251606
249720
 
251607
- return (from + ' ' + to).trim()
251608
- }
249721
+ var val
249722
+ , la = args[i + 1]
251609
249723
 
251610
- // if ANY of the sets match ALL of its comparators, then pass
251611
- Range.prototype.test = function (version) {
251612
- if (!version) {
251613
- return false
251614
- }
249724
+ var isBool = typeof no === 'boolean' ||
249725
+ argType === Boolean ||
249726
+ isTypeArray && argType.indexOf(Boolean) !== -1 ||
249727
+ (typeof argType === 'undefined' && !hadEq) ||
249728
+ (la === "false" &&
249729
+ (argType === null ||
249730
+ isTypeArray && ~argType.indexOf(null)))
251615
249731
 
251616
- if (typeof version === 'string') {
251617
- version = new SemVer(version, this.options)
251618
- }
249732
+ if (isBool) {
249733
+ // just set and move along
249734
+ val = !no
249735
+ // however, also support --bool true or --bool false
249736
+ if (la === "true" || la === "false") {
249737
+ val = JSON.parse(la)
249738
+ la = null
249739
+ if (no) val = !val
249740
+ i ++
249741
+ }
251619
249742
 
251620
- for (var i = 0; i < this.set.length; i++) {
251621
- if (testSet(this.set[i], version, this.options)) {
251622
- return true
251623
- }
251624
- }
251625
- return false
251626
- }
249743
+ // also support "foo":[Boolean, "bar"] and "--foo bar"
249744
+ if (isTypeArray && la) {
249745
+ if (~argType.indexOf(la)) {
249746
+ // an explicit type
249747
+ val = la
249748
+ i ++
249749
+ } else if ( la === "null" && ~argType.indexOf(null) ) {
249750
+ // null allowed
249751
+ val = null
249752
+ i ++
249753
+ } else if ( !la.match(/^-{2,}[^-]/) &&
249754
+ !isNaN(la) &&
249755
+ ~argType.indexOf(Number) ) {
249756
+ // number
249757
+ val = +la
249758
+ i ++
249759
+ } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) {
249760
+ // string
249761
+ val = la
249762
+ i ++
249763
+ }
249764
+ }
251627
249765
 
251628
- function testSet (set, version, options) {
251629
- for (var i = 0; i < set.length; i++) {
251630
- if (!set[i].test(version)) {
251631
- return false
251632
- }
251633
- }
249766
+ if (isArray) (data[arg] = data[arg] || []).push(val)
249767
+ else data[arg] = val
251634
249768
 
251635
- if (version.prerelease.length && !options.includePrerelease) {
251636
- // Find the set of versions that are allowed to have prereleases
251637
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
251638
- // That should allow `1.2.3-pr.2` to pass.
251639
- // However, `1.2.4-alpha.notready` should NOT be allowed,
251640
- // even though it's within the range set by the comparators.
251641
- for (i = 0; i < set.length; i++) {
251642
- debug(set[i].semver)
251643
- if (set[i].semver === ANY) {
251644
249769
  continue
251645
249770
  }
251646
249771
 
251647
- if (set[i].semver.prerelease.length > 0) {
251648
- var allowed = set[i].semver
251649
- if (allowed.major === version.major &&
251650
- allowed.minor === version.minor &&
251651
- allowed.patch === version.patch) {
251652
- return true
249772
+ if (argType === String) {
249773
+ if (la === undefined) {
249774
+ la = ""
249775
+ } else if (la.match(/^-{1,2}[^-]+/)) {
249776
+ la = ""
249777
+ i --
251653
249778
  }
251654
249779
  }
251655
- }
251656
-
251657
- // Version has a -pre, but it's not one of the ones we like.
251658
- return false
251659
- }
251660
249780
 
251661
- return true
251662
- }
249781
+ if (la && la.match(/^-{2,}$/)) {
249782
+ la = undefined
249783
+ i --
249784
+ }
251663
249785
 
251664
- exports.satisfies = satisfies
251665
- function satisfies (version, range, options) {
251666
- try {
251667
- range = new Range(range, options)
251668
- } catch (er) {
251669
- return false
251670
- }
251671
- return range.test(version)
251672
- }
249786
+ val = la === undefined ? true : la
249787
+ if (isArray) (data[arg] = data[arg] || []).push(val)
249788
+ else data[arg] = val
251673
249789
 
251674
- exports.maxSatisfying = maxSatisfying
251675
- function maxSatisfying (versions, range, options) {
251676
- var max = null
251677
- var maxSV = null
251678
- try {
251679
- var rangeObj = new Range(range, options)
251680
- } catch (er) {
251681
- return null
251682
- }
251683
- versions.forEach(function (v) {
251684
- if (rangeObj.test(v)) {
251685
- // satisfies(v, range, options)
251686
- if (!max || maxSV.compare(v) === -1) {
251687
- // compare(max, v, true)
251688
- max = v
251689
- maxSV = new SemVer(max, options)
251690
- }
249790
+ i ++
249791
+ continue
251691
249792
  }
251692
- })
251693
- return max
251694
- }
251695
-
251696
- exports.minSatisfying = minSatisfying
251697
- function minSatisfying (versions, range, options) {
251698
- var min = null
251699
- var minSV = null
251700
- try {
251701
- var rangeObj = new Range(range, options)
251702
- } catch (er) {
251703
- return null
249793
+ remain.push(arg)
251704
249794
  }
251705
- versions.forEach(function (v) {
251706
- if (rangeObj.test(v)) {
251707
- // satisfies(v, range, options)
251708
- if (!min || minSV.compare(v) === 1) {
251709
- // compare(min, v, true)
251710
- min = v
251711
- minSV = new SemVer(min, options)
251712
- }
251713
- }
251714
- })
251715
- return min
251716
249795
  }
251717
249796
 
251718
- exports.minVersion = minVersion
251719
- function minVersion (range, loose) {
251720
- range = new Range(range, loose)
251721
-
251722
- var minver = new SemVer('0.0.0')
251723
- if (range.test(minver)) {
251724
- return minver
251725
- }
251726
-
251727
- minver = new SemVer('0.0.0-0')
251728
- if (range.test(minver)) {
251729
- return minver
251730
- }
251731
-
251732
- minver = null
251733
- for (var i = 0; i < range.set.length; ++i) {
251734
- var comparators = range.set[i]
251735
-
251736
- comparators.forEach(function (comparator) {
251737
- // Clone to avoid manipulating the comparator's semver object.
251738
- var compver = new SemVer(comparator.semver.version)
251739
- switch (comparator.operator) {
251740
- case '>':
251741
- if (compver.prerelease.length === 0) {
251742
- compver.patch++
251743
- } else {
251744
- compver.prerelease.push(0)
251745
- }
251746
- compver.raw = compver.format()
251747
- /* fallthrough */
251748
- case '':
251749
- case '>=':
251750
- if (!minver || gt(minver, compver)) {
251751
- minver = compver
251752
- }
251753
- break
251754
- case '<':
251755
- case '<=':
251756
- /* Ignore maximum versions */
251757
- break
251758
- /* istanbul ignore next */
251759
- default:
251760
- throw new Error('Unexpected operation: ' + comparator.operator)
251761
- }
251762
- })
251763
- }
251764
-
251765
- if (minver && range.test(minver)) {
251766
- return minver
251767
- }
251768
-
251769
- return null
251770
- }
249797
+ function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
249798
+ // handle single-char shorthands glommed together, like
249799
+ // npm ls -glp, but only if there is one dash, and only if
249800
+ // all of the chars are single-char shorthands, and it's
249801
+ // not a match to some other abbrev.
249802
+ arg = arg.replace(/^-+/, '')
251771
249803
 
251772
- exports.validRange = validRange
251773
- function validRange (range, options) {
251774
- try {
251775
- // Return '*' instead of '' so that truthiness works.
251776
- // This will throw if it's invalid anyway
251777
- return new Range(range, options).range || '*'
251778
- } catch (er) {
249804
+ // if it's an exact known option, then don't go any further
249805
+ if (abbrevs[arg] === arg)
251779
249806
  return null
251780
- }
251781
- }
251782
-
251783
- // Determine if version is less than all the versions possible in the range
251784
- exports.ltr = ltr
251785
- function ltr (version, range, options) {
251786
- return outside(version, range, '<', options)
251787
- }
251788
249807
 
251789
- // Determine if version is greater than all the versions possible in the range.
251790
- exports.gtr = gtr
251791
- function gtr (version, range, options) {
251792
- return outside(version, range, '>', options)
251793
- }
251794
-
251795
- exports.outside = outside
251796
- function outside (version, range, hilo, options) {
251797
- version = new SemVer(version, options)
251798
- range = new Range(range, options)
251799
-
251800
- var gtfn, ltefn, ltfn, comp, ecomp
251801
- switch (hilo) {
251802
- case '>':
251803
- gtfn = gt
251804
- ltefn = lte
251805
- ltfn = lt
251806
- comp = '>'
251807
- ecomp = '>='
251808
- break
251809
- case '<':
251810
- gtfn = lt
251811
- ltefn = gte
251812
- ltfn = gt
251813
- comp = '<'
251814
- ecomp = '<='
251815
- break
251816
- default:
251817
- throw new TypeError('Must provide a hilo val of "<" or ">"')
251818
- }
249808
+ // if it's an exact known shortopt, same deal
249809
+ if (shorthands[arg]) {
249810
+ // make it an array, if it's a list of words
249811
+ if (shorthands[arg] && !Array.isArray(shorthands[arg]))
249812
+ shorthands[arg] = shorthands[arg].split(/\s+/)
251819
249813
 
251820
- // If it satisifes the range it is not outside
251821
- if (satisfies(version, range, options)) {
251822
- return false
249814
+ return shorthands[arg]
251823
249815
  }
251824
249816
 
251825
- // From now on, variable terms are as if we're in "gtr" mode.
251826
- // but note that everything is flipped for the "ltr" function.
251827
-
251828
- for (var i = 0; i < range.set.length; ++i) {
251829
- var comparators = range.set[i]
251830
-
251831
- var high = null
251832
- var low = null
251833
-
251834
- comparators.forEach(function (comparator) {
251835
- if (comparator.semver === ANY) {
251836
- comparator = new Comparator('>=0.0.0')
251837
- }
251838
- high = high || comparator
251839
- low = low || comparator
251840
- if (gtfn(comparator.semver, high.semver, options)) {
251841
- high = comparator
251842
- } else if (ltfn(comparator.semver, low.semver, options)) {
251843
- low = comparator
251844
- }
251845
- })
251846
-
251847
- // If the edge version comparator has a operator then our version
251848
- // isn't outside it
251849
- if (high.operator === comp || high.operator === ecomp) {
251850
- return false
251851
- }
251852
-
251853
- // If the lowest version comparator has an operator and our version
251854
- // is less than it then it isn't higher than the range
251855
- if ((!low.operator || low.operator === comp) &&
251856
- ltefn(version, low.semver)) {
251857
- return false
251858
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
251859
- return false
251860
- }
249817
+ // first check to see if this arg is a set of single-char shorthands
249818
+ var singles = shorthands.___singles
249819
+ if (!singles) {
249820
+ singles = Object.keys(shorthands).filter(function (s) {
249821
+ return s.length === 1
249822
+ }).reduce(function (l,r) {
249823
+ l[r] = true
249824
+ return l
249825
+ }, {})
249826
+ shorthands.___singles = singles
249827
+ debug('shorthand singles', singles)
251861
249828
  }
251862
- return true
251863
- }
251864
249829
 
251865
- exports.prerelease = prerelease
251866
- function prerelease (version, options) {
251867
- var parsed = parse(version, options)
251868
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
251869
- }
249830
+ var chrs = arg.split("").filter(function (c) {
249831
+ return singles[c]
249832
+ })
251870
249833
 
251871
- exports.intersects = intersects
251872
- function intersects (r1, r2, options) {
251873
- r1 = new Range(r1, options)
251874
- r2 = new Range(r2, options)
251875
- return r1.intersects(r2)
251876
- }
249834
+ if (chrs.join("") === arg) return chrs.map(function (c) {
249835
+ return shorthands[c]
249836
+ }).reduce(function (l, r) {
249837
+ return l.concat(r)
249838
+ }, [])
251877
249839
 
251878
- exports.coerce = coerce
251879
- function coerce (version) {
251880
- if (version instanceof SemVer) {
251881
- return version
251882
- }
251883
249840
 
251884
- if (typeof version !== 'string') {
249841
+ // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
249842
+ if (abbrevs[arg] && !shorthands[arg])
251885
249843
  return null
251886
- }
251887
249844
 
251888
- var match = version.match(re[COERCE])
249845
+ // if it's an abbr for a shorthand, then use that
249846
+ if (shortAbbr[arg])
249847
+ arg = shortAbbr[arg]
251889
249848
 
251890
- if (match == null) {
251891
- return null
251892
- }
249849
+ // make it an array, if it's a list of words
249850
+ if (shorthands[arg] && !Array.isArray(shorthands[arg]))
249851
+ shorthands[arg] = shorthands[arg].split(/\s+/)
251893
249852
 
251894
- return parse(match[1] +
251895
- '.' + (match[2] || '0') +
251896
- '.' + (match[3] || '0'))
249853
+ return shorthands[arg]
251897
249854
  }
251898
249855
 
251899
249856
 
@@ -258354,385 +256311,6 @@ function reusify (Constructor) {
258354
256311
  module.exports = reusify
258355
256312
 
258356
256313
 
258357
- /***/ }),
258358
-
258359
- /***/ 2780:
258360
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
258361
-
258362
- module.exports = rimraf
258363
- rimraf.sync = rimrafSync
258364
-
258365
- var assert = __webpack_require__(42357)
258366
- var path = __webpack_require__(85622)
258367
- var fs = __webpack_require__(35747)
258368
- var glob = undefined
258369
- try {
258370
- glob = __webpack_require__(63700)
258371
- } catch (_err) {
258372
- // treat glob as optional.
258373
- }
258374
- var _0666 = parseInt('666', 8)
258375
-
258376
- var defaultGlobOpts = {
258377
- nosort: true,
258378
- silent: true
258379
- }
258380
-
258381
- // for EMFILE handling
258382
- var timeout = 0
258383
-
258384
- var isWindows = (process.platform === "win32")
258385
-
258386
- function defaults (options) {
258387
- var methods = [
258388
- 'unlink',
258389
- 'chmod',
258390
- 'stat',
258391
- 'lstat',
258392
- 'rmdir',
258393
- 'readdir'
258394
- ]
258395
- methods.forEach(function(m) {
258396
- options[m] = options[m] || fs[m]
258397
- m = m + 'Sync'
258398
- options[m] = options[m] || fs[m]
258399
- })
258400
-
258401
- options.maxBusyTries = options.maxBusyTries || 3
258402
- options.emfileWait = options.emfileWait || 1000
258403
- if (options.glob === false) {
258404
- options.disableGlob = true
258405
- }
258406
- if (options.disableGlob !== true && glob === undefined) {
258407
- throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
258408
- }
258409
- options.disableGlob = options.disableGlob || false
258410
- options.glob = options.glob || defaultGlobOpts
258411
- }
258412
-
258413
- function rimraf (p, options, cb) {
258414
- if (typeof options === 'function') {
258415
- cb = options
258416
- options = {}
258417
- }
258418
-
258419
- assert(p, 'rimraf: missing path')
258420
- assert.equal(typeof p, 'string', 'rimraf: path should be a string')
258421
- assert.equal(typeof cb, 'function', 'rimraf: callback function required')
258422
- assert(options, 'rimraf: invalid options argument provided')
258423
- assert.equal(typeof options, 'object', 'rimraf: options should be object')
258424
-
258425
- defaults(options)
258426
-
258427
- var busyTries = 0
258428
- var errState = null
258429
- var n = 0
258430
-
258431
- if (options.disableGlob || !glob.hasMagic(p))
258432
- return afterGlob(null, [p])
258433
-
258434
- options.lstat(p, function (er, stat) {
258435
- if (!er)
258436
- return afterGlob(null, [p])
258437
-
258438
- glob(p, options.glob, afterGlob)
258439
- })
258440
-
258441
- function next (er) {
258442
- errState = errState || er
258443
- if (--n === 0)
258444
- cb(errState)
258445
- }
258446
-
258447
- function afterGlob (er, results) {
258448
- if (er)
258449
- return cb(er)
258450
-
258451
- n = results.length
258452
- if (n === 0)
258453
- return cb()
258454
-
258455
- results.forEach(function (p) {
258456
- rimraf_(p, options, function CB (er) {
258457
- if (er) {
258458
- if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
258459
- busyTries < options.maxBusyTries) {
258460
- busyTries ++
258461
- var time = busyTries * 100
258462
- // try again, with the same exact callback as this one.
258463
- return setTimeout(function () {
258464
- rimraf_(p, options, CB)
258465
- }, time)
258466
- }
258467
-
258468
- // this one won't happen if graceful-fs is used.
258469
- if (er.code === "EMFILE" && timeout < options.emfileWait) {
258470
- return setTimeout(function () {
258471
- rimraf_(p, options, CB)
258472
- }, timeout ++)
258473
- }
258474
-
258475
- // already gone
258476
- if (er.code === "ENOENT") er = null
258477
- }
258478
-
258479
- timeout = 0
258480
- next(er)
258481
- })
258482
- })
258483
- }
258484
- }
258485
-
258486
- // Two possible strategies.
258487
- // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
258488
- // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
258489
- //
258490
- // Both result in an extra syscall when you guess wrong. However, there
258491
- // are likely far more normal files in the world than directories. This
258492
- // is based on the assumption that a the average number of files per
258493
- // directory is >= 1.
258494
- //
258495
- // If anyone ever complains about this, then I guess the strategy could
258496
- // be made configurable somehow. But until then, YAGNI.
258497
- function rimraf_ (p, options, cb) {
258498
- assert(p)
258499
- assert(options)
258500
- assert(typeof cb === 'function')
258501
-
258502
- // sunos lets the root user unlink directories, which is... weird.
258503
- // so we have to lstat here and make sure it's not a dir.
258504
- options.lstat(p, function (er, st) {
258505
- if (er && er.code === "ENOENT")
258506
- return cb(null)
258507
-
258508
- // Windows can EPERM on stat. Life is suffering.
258509
- if (er && er.code === "EPERM" && isWindows)
258510
- fixWinEPERM(p, options, er, cb)
258511
-
258512
- if (st && st.isDirectory())
258513
- return rmdir(p, options, er, cb)
258514
-
258515
- options.unlink(p, function (er) {
258516
- if (er) {
258517
- if (er.code === "ENOENT")
258518
- return cb(null)
258519
- if (er.code === "EPERM")
258520
- return (isWindows)
258521
- ? fixWinEPERM(p, options, er, cb)
258522
- : rmdir(p, options, er, cb)
258523
- if (er.code === "EISDIR")
258524
- return rmdir(p, options, er, cb)
258525
- }
258526
- return cb(er)
258527
- })
258528
- })
258529
- }
258530
-
258531
- function fixWinEPERM (p, options, er, cb) {
258532
- assert(p)
258533
- assert(options)
258534
- assert(typeof cb === 'function')
258535
- if (er)
258536
- assert(er instanceof Error)
258537
-
258538
- options.chmod(p, _0666, function (er2) {
258539
- if (er2)
258540
- cb(er2.code === "ENOENT" ? null : er)
258541
- else
258542
- options.stat(p, function(er3, stats) {
258543
- if (er3)
258544
- cb(er3.code === "ENOENT" ? null : er)
258545
- else if (stats.isDirectory())
258546
- rmdir(p, options, er, cb)
258547
- else
258548
- options.unlink(p, cb)
258549
- })
258550
- })
258551
- }
258552
-
258553
- function fixWinEPERMSync (p, options, er) {
258554
- assert(p)
258555
- assert(options)
258556
- if (er)
258557
- assert(er instanceof Error)
258558
-
258559
- try {
258560
- options.chmodSync(p, _0666)
258561
- } catch (er2) {
258562
- if (er2.code === "ENOENT")
258563
- return
258564
- else
258565
- throw er
258566
- }
258567
-
258568
- try {
258569
- var stats = options.statSync(p)
258570
- } catch (er3) {
258571
- if (er3.code === "ENOENT")
258572
- return
258573
- else
258574
- throw er
258575
- }
258576
-
258577
- if (stats.isDirectory())
258578
- rmdirSync(p, options, er)
258579
- else
258580
- options.unlinkSync(p)
258581
- }
258582
-
258583
- function rmdir (p, options, originalEr, cb) {
258584
- assert(p)
258585
- assert(options)
258586
- if (originalEr)
258587
- assert(originalEr instanceof Error)
258588
- assert(typeof cb === 'function')
258589
-
258590
- // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
258591
- // if we guessed wrong, and it's not a directory, then
258592
- // raise the original error.
258593
- options.rmdir(p, function (er) {
258594
- if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
258595
- rmkids(p, options, cb)
258596
- else if (er && er.code === "ENOTDIR")
258597
- cb(originalEr)
258598
- else
258599
- cb(er)
258600
- })
258601
- }
258602
-
258603
- function rmkids(p, options, cb) {
258604
- assert(p)
258605
- assert(options)
258606
- assert(typeof cb === 'function')
258607
-
258608
- options.readdir(p, function (er, files) {
258609
- if (er)
258610
- return cb(er)
258611
- var n = files.length
258612
- if (n === 0)
258613
- return options.rmdir(p, cb)
258614
- var errState
258615
- files.forEach(function (f) {
258616
- rimraf(path.join(p, f), options, function (er) {
258617
- if (errState)
258618
- return
258619
- if (er)
258620
- return cb(errState = er)
258621
- if (--n === 0)
258622
- options.rmdir(p, cb)
258623
- })
258624
- })
258625
- })
258626
- }
258627
-
258628
- // this looks simpler, and is strictly *faster*, but will
258629
- // tie up the JavaScript thread and fail on excessively
258630
- // deep directory trees.
258631
- function rimrafSync (p, options) {
258632
- options = options || {}
258633
- defaults(options)
258634
-
258635
- assert(p, 'rimraf: missing path')
258636
- assert.equal(typeof p, 'string', 'rimraf: path should be a string')
258637
- assert(options, 'rimraf: missing options')
258638
- assert.equal(typeof options, 'object', 'rimraf: options should be object')
258639
-
258640
- var results
258641
-
258642
- if (options.disableGlob || !glob.hasMagic(p)) {
258643
- results = [p]
258644
- } else {
258645
- try {
258646
- options.lstatSync(p)
258647
- results = [p]
258648
- } catch (er) {
258649
- results = glob.sync(p, options.glob)
258650
- }
258651
- }
258652
-
258653
- if (!results.length)
258654
- return
258655
-
258656
- for (var i = 0; i < results.length; i++) {
258657
- var p = results[i]
258658
-
258659
- try {
258660
- var st = options.lstatSync(p)
258661
- } catch (er) {
258662
- if (er.code === "ENOENT")
258663
- return
258664
-
258665
- // Windows can EPERM on stat. Life is suffering.
258666
- if (er.code === "EPERM" && isWindows)
258667
- fixWinEPERMSync(p, options, er)
258668
- }
258669
-
258670
- try {
258671
- // sunos lets the root user unlink directories, which is... weird.
258672
- if (st && st.isDirectory())
258673
- rmdirSync(p, options, null)
258674
- else
258675
- options.unlinkSync(p)
258676
- } catch (er) {
258677
- if (er.code === "ENOENT")
258678
- return
258679
- if (er.code === "EPERM")
258680
- return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
258681
- if (er.code !== "EISDIR")
258682
- throw er
258683
-
258684
- rmdirSync(p, options, er)
258685
- }
258686
- }
258687
- }
258688
-
258689
- function rmdirSync (p, options, originalEr) {
258690
- assert(p)
258691
- assert(options)
258692
- if (originalEr)
258693
- assert(originalEr instanceof Error)
258694
-
258695
- try {
258696
- options.rmdirSync(p)
258697
- } catch (er) {
258698
- if (er.code === "ENOENT")
258699
- return
258700
- if (er.code === "ENOTDIR")
258701
- throw originalEr
258702
- if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
258703
- rmkidsSync(p, options)
258704
- }
258705
- }
258706
-
258707
- function rmkidsSync (p, options) {
258708
- assert(p)
258709
- assert(options)
258710
- options.readdirSync(p).forEach(function (f) {
258711
- rimrafSync(path.join(p, f), options)
258712
- })
258713
-
258714
- // We only end up here once we got ENOTEMPTY at least once, and
258715
- // at this point, we are guaranteed to have removed all the kids.
258716
- // So, we know that it won't be ENOENT or ENOTDIR or anything else.
258717
- // try really hard to delete stuff on windows, because it has a
258718
- // PROFOUNDLY annoying habit of not closing handles promptly when
258719
- // files are deleted, resulting in spurious ENOTEMPTY errors.
258720
- var retries = isWindows ? 100 : 1
258721
- var i = 0
258722
- do {
258723
- var threw = true
258724
- try {
258725
- var ret = options.rmdirSync(p, options)
258726
- threw = false
258727
- return ret
258728
- } finally {
258729
- if (++i < retries && threw)
258730
- continue
258731
- }
258732
- } while (true)
258733
- }
258734
-
258735
-
258736
256314
  /***/ }),
258737
256315
 
258738
256316
  /***/ 47586:
@@ -307234,7 +304812,21 @@ const prepareCache = ({ repoRootPath, workPath }) => {
307234
304812
  exports.prepareCache = prepareCache;
307235
304813
  const startDevServer = async (opts) => {
307236
304814
  const { entrypoint, workPath, config, meta = {} } = opts;
307237
- const entryDir = path_1.join(workPath, path_1.dirname(entrypoint));
304815
+ const entrypointPath = path_1.join(workPath, entrypoint);
304816
+ if (config.middleware === true && typeof meta.requestUrl === 'string') {
304817
+ // TODO: static config is also parsed in `dev-server.ts`.
304818
+ // we should pass in this version as an env var instead.
304819
+ const project = new ts_morph_1.Project();
304820
+ const staticConfig = static_config_1.getConfig(project, entrypointPath);
304821
+ // Middleware is a catch-all for all paths unless a `matcher` property is defined
304822
+ const matchers = new RegExp(utils_1.getRegExpFromMatchers(staticConfig?.matcher));
304823
+ if (!matchers.test(meta.requestUrl)) {
304824
+ // If the "matchers" doesn't say to handle this
304825
+ // path then skip middleware invocation
304826
+ return null;
304827
+ }
304828
+ }
304829
+ const entryDir = path_1.dirname(entrypointPath);
307238
304830
  const projectTsConfig = await build_utils_1.walkParentDirs({
307239
304831
  base: workPath,
307240
304832
  start: entryDir,
@@ -307263,6 +304855,9 @@ const startDevServer = async (opts) => {
307263
304855
  },
307264
304856
  });
307265
304857
  const { pid } = child;
304858
+ if (!pid) {
304859
+ throw new Error(`Child Process has no "pid" when forking: "${devServerPath}"`);
304860
+ }
307266
304861
  const onMessage = once_1.default(child, 'message');
307267
304862
  const onExit = once_1.default.spread(child, 'exit');
307268
304863
  const result = await Promise.race([onMessage, onExit]);
@@ -307284,12 +304879,12 @@ const startDevServer = async (opts) => {
307284
304879
  // Got "exit" event from child process
307285
304880
  const [exitCode, signal] = result;
307286
304881
  const reason = signal ? `"${signal}" signal` : `exit code ${exitCode}`;
307287
- throw new Error(`\`node ${entrypoint}\` failed with ${reason}`);
304882
+ throw new Error(`Function \`${entrypoint}\` failed with ${reason}`);
307288
304883
  }
307289
304884
  };
307290
304885
  exports.startDevServer = startDevServer;
307291
304886
  async function doTypeCheck({ entrypoint, workPath, meta = {} }, projectTsConfig) {
307292
- const { devCacheDir = path_1.join(workPath, '.now', 'cache') } = meta;
304887
+ const { devCacheDir = path_1.join(workPath, '.vercel', 'cache') } = meta;
307293
304888
  const entrypointCacheDir = path_1.join(devCacheDir, 'node', entrypoint);
307294
304889
  // In order to type-check a single file, a standalone tsconfig
307295
304890
  // file needs to be created that inherits from the base one :(
@@ -307771,14 +305366,6 @@ module.exports = JSON.parse("{\"builtin\":{\"Array\":false,\"ArrayBuffer\":false
307771
305366
 
307772
305367
  /***/ }),
307773
305368
 
307774
- /***/ 90772:
307775
- /***/ ((module) => {
307776
-
307777
- "use strict";
307778
- module.exports = JSON.parse("{\"0.1.14\":{\"node_abi\":null,\"v8\":\"1.3\"},\"0.1.15\":{\"node_abi\":null,\"v8\":\"1.3\"},\"0.1.16\":{\"node_abi\":null,\"v8\":\"1.3\"},\"0.1.17\":{\"node_abi\":null,\"v8\":\"1.3\"},\"0.1.18\":{\"node_abi\":null,\"v8\":\"1.3\"},\"0.1.19\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.20\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.21\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.22\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.23\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.24\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.25\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.26\":{\"node_abi\":null,\"v8\":\"2.0\"},\"0.1.27\":{\"node_abi\":null,\"v8\":\"2.1\"},\"0.1.28\":{\"node_abi\":null,\"v8\":\"2.1\"},\"0.1.29\":{\"node_abi\":null,\"v8\":\"2.1\"},\"0.1.30\":{\"node_abi\":null,\"v8\":\"2.1\"},\"0.1.31\":{\"node_abi\":null,\"v8\":\"2.1\"},\"0.1.32\":{\"node_abi\":null,\"v8\":\"2.1\"},\"0.1.33\":{\"node_abi\":null,\"v8\":\"2.1\"},\"0.1.90\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.91\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.92\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.93\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.94\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.95\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.96\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.97\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.98\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.99\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.100\":{\"node_abi\":null,\"v8\":\"2.2\"},\"0.1.101\":{\"node_abi\":null,\"v8\":\"2.3\"},\"0.1.102\":{\"node_abi\":null,\"v8\":\"2.3\"},\"0.1.103\":{\"node_abi\":null,\"v8\":\"2.3\"},\"0.1.104\":{\"node_abi\":null,\"v8\":\"2.3\"},\"0.2.0\":{\"node_abi\":1,\"v8\":\"2.3\"},\"0.2.1\":{\"node_abi\":1,\"v8\":\"2.3\"},\"0.2.2\":{\"node_abi\":1,\"v8\":\"2.3\"},\"0.2.3\":{\"node_abi\":1,\"v8\":\"2.3\"},\"0.2.4\":{\"node_abi\":1,\"v8\":\"2.3\"},\"0.2.5\":{\"node_abi\":1,\"v8\":\"2.3\"},\"0.2.6\":{\"node_abi\":1,\"v8\":\"2.3\"},\"0.3.0\":{\"node_abi\":1,\"v8\":\"2.5\"},\"0.3.1\":{\"node_abi\":1,\"v8\":\"2.5\"},\"0.3.2\":{\"node_abi\":1,\"v8\":\"3.0\"},\"0.3.3\":{\"node_abi\":1,\"v8\":\"3.0\"},\"0.3.4\":{\"node_abi\":1,\"v8\":\"3.0\"},\"0.3.5\":{\"node_abi\":1,\"v8\":\"3.0\"},\"0.3.6\":{\"node_abi\":1,\"v8\":\"3.0\"},\"0.3.7\":{\"node_abi\":1,\"v8\":\"3.0\"},\"0.3.8\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.0\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.1\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.2\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.3\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.4\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.5\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.6\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.7\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.8\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.9\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.10\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.11\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.4.12\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.5.0\":{\"node_abi\":1,\"v8\":\"3.1\"},\"0.5.1\":{\"node_abi\":1,\"v8\":\"3.4\"},\"0.5.2\":{\"node_abi\":1,\"v8\":\"3.4\"},\"0.5.3\":{\"node_abi\":1,\"v8\":\"3.4\"},\"0.5.4\":{\"node_abi\":1,\"v8\":\"3.5\"},\"0.5.5\":{\"node_abi\":1,\"v8\":\"3.5\"},\"0.5.6\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.5.7\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.5.8\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.5.9\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.5.10\":{\"node_abi\":1,\"v8\":\"3.7\"},\"0.6.0\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.1\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.2\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.3\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.4\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.5\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.6\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.7\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.8\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.9\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.10\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.11\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.12\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.13\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.14\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.15\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.16\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.17\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.18\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.19\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.20\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.6.21\":{\"node_abi\":1,\"v8\":\"3.6\"},\"0.7.0\":{\"node_abi\":1,\"v8\":\"3.8\"},\"0.7.1\":{\"node_abi\":1,\"v8\":\"3.8\"},\"0.7.2\":{\"node_abi\":1,\"v8\":\"3.8\"},\"0.7.3\":{\"node_abi\":1,\"v8\":\"3.9\"},\"0.7.4\":{\"node_abi\":1,\"v8\":\"3.9\"},\"0.7.5\":{\"node_abi\":1,\"v8\":\"3.9\"},\"0.7.6\":{\"node_abi\":1,\"v8\":\"3.9\"},\"0.7.7\":{\"node_abi\":1,\"v8\":\"3.9\"},\"0.7.8\":{\"node_abi\":1,\"v8\":\"3.9\"},\"0.7.9\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.7.10\":{\"node_abi\":1,\"v8\":\"3.9\"},\"0.7.11\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.7.12\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.0\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.1\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.2\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.3\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.4\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.5\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.6\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.7\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.8\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.9\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.10\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.11\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.12\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.13\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.14\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.15\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.16\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.17\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.18\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.19\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.20\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.21\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.22\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.23\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.24\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.25\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.26\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.27\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.8.28\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.9.0\":{\"node_abi\":1,\"v8\":\"3.11\"},\"0.9.1\":{\"node_abi\":10,\"v8\":\"3.11\"},\"0.9.2\":{\"node_abi\":10,\"v8\":\"3.11\"},\"0.9.3\":{\"node_abi\":10,\"v8\":\"3.13\"},\"0.9.4\":{\"node_abi\":10,\"v8\":\"3.13\"},\"0.9.5\":{\"node_abi\":10,\"v8\":\"3.13\"},\"0.9.6\":{\"node_abi\":10,\"v8\":\"3.15\"},\"0.9.7\":{\"node_abi\":10,\"v8\":\"3.15\"},\"0.9.8\":{\"node_abi\":10,\"v8\":\"3.15\"},\"0.9.9\":{\"node_abi\":11,\"v8\":\"3.15\"},\"0.9.10\":{\"node_abi\":11,\"v8\":\"3.15\"},\"0.9.11\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.9.12\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.0\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.1\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.2\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.3\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.4\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.5\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.6\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.7\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.8\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.9\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.10\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.11\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.12\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.13\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.14\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.15\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.16\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.17\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.18\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.19\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.20\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.21\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.22\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.23\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.24\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.25\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.26\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.27\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.28\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.29\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.30\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.31\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.32\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.33\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.34\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.35\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.36\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.37\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.38\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.39\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.40\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.41\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.42\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.43\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.44\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.45\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.46\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.47\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.10.48\":{\"node_abi\":11,\"v8\":\"3.14\"},\"0.11.0\":{\"node_abi\":12,\"v8\":\"3.17\"},\"0.11.1\":{\"node_abi\":12,\"v8\":\"3.18\"},\"0.11.2\":{\"node_abi\":12,\"v8\":\"3.19\"},\"0.11.3\":{\"node_abi\":12,\"v8\":\"3.19\"},\"0.11.4\":{\"node_abi\":12,\"v8\":\"3.20\"},\"0.11.5\":{\"node_abi\":12,\"v8\":\"3.20\"},\"0.11.6\":{\"node_abi\":12,\"v8\":\"3.20\"},\"0.11.7\":{\"node_abi\":12,\"v8\":\"3.20\"},\"0.11.8\":{\"node_abi\":13,\"v8\":\"3.21\"},\"0.11.9\":{\"node_abi\":13,\"v8\":\"3.22\"},\"0.11.10\":{\"node_abi\":13,\"v8\":\"3.22\"},\"0.11.11\":{\"node_abi\":14,\"v8\":\"3.22\"},\"0.11.12\":{\"node_abi\":14,\"v8\":\"3.22\"},\"0.11.13\":{\"node_abi\":14,\"v8\":\"3.25\"},\"0.11.14\":{\"node_abi\":14,\"v8\":\"3.26\"},\"0.11.15\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.11.16\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.0\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.1\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.2\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.3\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.4\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.5\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.6\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.7\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.8\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.9\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.10\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.11\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.12\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.13\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.14\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.15\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.16\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.17\":{\"node_abi\":14,\"v8\":\"3.28\"},\"0.12.18\":{\"node_abi\":14,\"v8\":\"3.28\"},\"1.0.0\":{\"node_abi\":42,\"v8\":\"3.31\"},\"1.0.1\":{\"node_abi\":42,\"v8\":\"3.31\"},\"1.0.2\":{\"node_abi\":42,\"v8\":\"3.31\"},\"1.0.3\":{\"node_abi\":42,\"v8\":\"4.1\"},\"1.0.4\":{\"node_abi\":42,\"v8\":\"4.1\"},\"1.1.0\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.2.0\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.3.0\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.4.1\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.4.2\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.4.3\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.5.0\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.5.1\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.6.0\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.6.1\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.6.2\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.6.3\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.6.4\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.7.1\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.8.1\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.8.2\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.8.3\":{\"node_abi\":43,\"v8\":\"4.1\"},\"1.8.4\":{\"node_abi\":43,\"v8\":\"4.1\"},\"2.0.0\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.0.1\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.0.2\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.1.0\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.2.0\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.2.1\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.3.0\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.3.1\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.3.2\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.3.3\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.3.4\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.4.0\":{\"node_abi\":44,\"v8\":\"4.2\"},\"2.5.0\":{\"node_abi\":44,\"v8\":\"4.2\"},\"3.0.0\":{\"node_abi\":45,\"v8\":\"4.4\"},\"3.1.0\":{\"node_abi\":45,\"v8\":\"4.4\"},\"3.2.0\":{\"node_abi\":45,\"v8\":\"4.4\"},\"3.3.0\":{\"node_abi\":45,\"v8\":\"4.4\"},\"3.3.1\":{\"node_abi\":45,\"v8\":\"4.4\"},\"4.0.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.1.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.1.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.1.2\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.2.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.2.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.2.2\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.2.3\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.2.4\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.2.5\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.2.6\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.3.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.3.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.3.2\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.2\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.3\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.4\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.5\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.6\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.4.7\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.5.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.6.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.6.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.6.2\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.7.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.7.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.7.2\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.7.3\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.2\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.3\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.4\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.5\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.6\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.8.7\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.9.0\":{\"node_abi\":46,\"v8\":\"4.5\"},\"4.9.1\":{\"node_abi\":46,\"v8\":\"4.5\"},\"5.0.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.1.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.1.1\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.2.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.3.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.4.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.4.1\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.5.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.6.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.7.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.7.1\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.8.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.9.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.9.1\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.10.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.10.1\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.11.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.11.1\":{\"node_abi\":47,\"v8\":\"4.6\"},\"5.12.0\":{\"node_abi\":47,\"v8\":\"4.6\"},\"6.0.0\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.1.0\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.2.0\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.2.1\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.2.2\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.3.0\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.3.1\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.4.0\":{\"node_abi\":48,\"v8\":\"5.0\"},\"6.5.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.6.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.7.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.8.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.8.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.9.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.9.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.9.2\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.9.3\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.9.4\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.9.5\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.10.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.10.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.10.2\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.10.3\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.11.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.11.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.11.2\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.11.3\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.11.4\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.11.5\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.12.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.12.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.12.2\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.12.3\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.13.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.13.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.14.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.14.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.14.2\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.14.3\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.14.4\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.15.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.15.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.16.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.17.0\":{\"node_abi\":48,\"v8\":\"5.1\"},\"6.17.1\":{\"node_abi\":48,\"v8\":\"5.1\"},\"7.0.0\":{\"node_abi\":51,\"v8\":\"5.4\"},\"7.1.0\":{\"node_abi\":51,\"v8\":\"5.4\"},\"7.2.0\":{\"node_abi\":51,\"v8\":\"5.4\"},\"7.2.1\":{\"node_abi\":51,\"v8\":\"5.4\"},\"7.3.0\":{\"node_abi\":51,\"v8\":\"5.4\"},\"7.4.0\":{\"node_abi\":51,\"v8\":\"5.4\"},\"7.5.0\":{\"node_abi\":51,\"v8\":\"5.4\"},\"7.6.0\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.7.0\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.7.1\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.7.2\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.7.3\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.7.4\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.8.0\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.9.0\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.10.0\":{\"node_abi\":51,\"v8\":\"5.5\"},\"7.10.1\":{\"node_abi\":51,\"v8\":\"5.5\"},\"8.0.0\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.1.0\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.1.1\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.1.2\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.1.3\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.1.4\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.2.0\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.2.1\":{\"node_abi\":57,\"v8\":\"5.8\"},\"8.3.0\":{\"node_abi\":57,\"v8\":\"6.0\"},\"8.4.0\":{\"node_abi\":57,\"v8\":\"6.0\"},\"8.5.0\":{\"node_abi\":57,\"v8\":\"6.0\"},\"8.6.0\":{\"node_abi\":57,\"v8\":\"6.0\"},\"8.7.0\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.8.0\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.8.1\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.9.0\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.9.1\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.9.2\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.9.3\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.9.4\":{\"node_abi\":57,\"v8\":\"6.1\"},\"8.10.0\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.11.0\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.11.1\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.11.2\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.11.3\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.11.4\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.12.0\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.13.0\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.14.0\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.14.1\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.15.0\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.15.1\":{\"node_abi\":57,\"v8\":\"6.2\"},\"8.16.0\":{\"node_abi\":57,\"v8\":\"6.2\"},\"9.0.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.1.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.2.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.2.1\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.3.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.4.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.5.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.6.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.6.1\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.7.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.7.1\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.8.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.9.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.10.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.10.1\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.11.0\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.11.1\":{\"node_abi\":59,\"v8\":\"6.2\"},\"9.11.2\":{\"node_abi\":59,\"v8\":\"6.2\"},\"10.0.0\":{\"node_abi\":64,\"v8\":\"6.6\"},\"10.1.0\":{\"node_abi\":64,\"v8\":\"6.6\"},\"10.2.0\":{\"node_abi\":64,\"v8\":\"6.6\"},\"10.2.1\":{\"node_abi\":64,\"v8\":\"6.6\"},\"10.3.0\":{\"node_abi\":64,\"v8\":\"6.6\"},\"10.4.0\":{\"node_abi\":64,\"v8\":\"6.7\"},\"10.4.1\":{\"node_abi\":64,\"v8\":\"6.7\"},\"10.5.0\":{\"node_abi\":64,\"v8\":\"6.7\"},\"10.6.0\":{\"node_abi\":64,\"v8\":\"6.7\"},\"10.7.0\":{\"node_abi\":64,\"v8\":\"6.7\"},\"10.8.0\":{\"node_abi\":64,\"v8\":\"6.7\"},\"10.9.0\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.10.0\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.11.0\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.12.0\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.13.0\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.14.0\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.14.1\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.14.2\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.15.0\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.15.1\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.15.2\":{\"node_abi\":64,\"v8\":\"6.8\"},\"10.15.3\":{\"node_abi\":64,\"v8\":\"6.8\"},\"11.0.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.1.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.2.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.3.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.4.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.5.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.6.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.7.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.8.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.9.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.10.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.10.1\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.11.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.12.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.13.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"11.14.0\":{\"node_abi\":67,\"v8\":\"7.0\"},\"12.0.0\":{\"node_abi\":72,\"v8\":\"7.4\"}}");
307779
-
307780
- /***/ }),
307781
-
307782
305369
  /***/ 52538:
307783
305370
  /***/ ((module) => {
307784
305371