zotero-plugin 3.3.0 → 3.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 (2) hide show
  1. package/bin/release.js +4 -2145
  2. package/package.json +6 -7
package/bin/release.js CHANGED
@@ -408,8 +408,8 @@
408
408
  // node_modules/moment/moment.js
409
409
  var require_moment = __commonJS({
410
410
  "node_modules/moment/moment.js"(exports, module) {
411
- (function(global2, factory) {
412
- typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.moment = factory();
411
+ (function(global, factory) {
412
+ typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global.moment = factory();
413
413
  })(exports, function() {
414
414
  "use strict";
415
415
  var hookCallback;
@@ -4405,2148 +4405,6 @@
4405
4405
  }
4406
4406
  });
4407
4407
 
4408
- // node_modules/isexe/windows.js
4409
- var require_windows = __commonJS({
4410
- "node_modules/isexe/windows.js"(exports, module) {
4411
- module.exports = isexe;
4412
- isexe.sync = sync;
4413
- var fs3 = __require("fs");
4414
- function checkPathExt(path3, options) {
4415
- var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
4416
- if (!pathext) {
4417
- return true;
4418
- }
4419
- pathext = pathext.split(";");
4420
- if (pathext.indexOf("") !== -1) {
4421
- return true;
4422
- }
4423
- for (var i = 0; i < pathext.length; i++) {
4424
- var p = pathext[i].toLowerCase();
4425
- if (p && path3.substr(-p.length).toLowerCase() === p) {
4426
- return true;
4427
- }
4428
- }
4429
- return false;
4430
- }
4431
- function checkStat(stat, path3, options) {
4432
- if (!stat.isSymbolicLink() && !stat.isFile()) {
4433
- return false;
4434
- }
4435
- return checkPathExt(path3, options);
4436
- }
4437
- function isexe(path3, options, cb) {
4438
- fs3.stat(path3, function(er, stat) {
4439
- cb(er, er ? false : checkStat(stat, path3, options));
4440
- });
4441
- }
4442
- function sync(path3, options) {
4443
- return checkStat(fs3.statSync(path3), path3, options);
4444
- }
4445
- }
4446
- });
4447
-
4448
- // node_modules/isexe/mode.js
4449
- var require_mode = __commonJS({
4450
- "node_modules/isexe/mode.js"(exports, module) {
4451
- module.exports = isexe;
4452
- isexe.sync = sync;
4453
- var fs3 = __require("fs");
4454
- function isexe(path3, options, cb) {
4455
- fs3.stat(path3, function(er, stat) {
4456
- cb(er, er ? false : checkStat(stat, options));
4457
- });
4458
- }
4459
- function sync(path3, options) {
4460
- return checkStat(fs3.statSync(path3), options);
4461
- }
4462
- function checkStat(stat, options) {
4463
- return stat.isFile() && checkMode(stat, options);
4464
- }
4465
- function checkMode(stat, options) {
4466
- var mod = stat.mode;
4467
- var uid = stat.uid;
4468
- var gid = stat.gid;
4469
- var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
4470
- var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
4471
- var u = parseInt("100", 8);
4472
- var g = parseInt("010", 8);
4473
- var o = parseInt("001", 8);
4474
- var ug = u | g;
4475
- var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
4476
- return ret;
4477
- }
4478
- }
4479
- });
4480
-
4481
- // node_modules/isexe/index.js
4482
- var require_isexe = __commonJS({
4483
- "node_modules/isexe/index.js"(exports, module) {
4484
- var fs3 = __require("fs");
4485
- var core;
4486
- if (process.platform === "win32" || global.TESTING_WINDOWS) {
4487
- core = require_windows();
4488
- } else {
4489
- core = require_mode();
4490
- }
4491
- module.exports = isexe;
4492
- isexe.sync = sync;
4493
- function isexe(path3, options, cb) {
4494
- if (typeof options === "function") {
4495
- cb = options;
4496
- options = {};
4497
- }
4498
- if (!cb) {
4499
- if (typeof Promise !== "function") {
4500
- throw new TypeError("callback not provided");
4501
- }
4502
- return new Promise(function(resolve, reject) {
4503
- isexe(path3, options || {}, function(er, is) {
4504
- if (er) {
4505
- reject(er);
4506
- } else {
4507
- resolve(is);
4508
- }
4509
- });
4510
- });
4511
- }
4512
- core(path3, options || {}, function(er, is) {
4513
- if (er) {
4514
- if (er.code === "EACCES" || options && options.ignoreErrors) {
4515
- er = null;
4516
- is = false;
4517
- }
4518
- }
4519
- cb(er, is);
4520
- });
4521
- }
4522
- function sync(path3, options) {
4523
- try {
4524
- return core.sync(path3, options || {});
4525
- } catch (er) {
4526
- if (options && options.ignoreErrors || er.code === "EACCES") {
4527
- return false;
4528
- } else {
4529
- throw er;
4530
- }
4531
- }
4532
- }
4533
- }
4534
- });
4535
-
4536
- // node_modules/execa/node_modules/which/which.js
4537
- var require_which = __commonJS({
4538
- "node_modules/execa/node_modules/which/which.js"(exports, module) {
4539
- module.exports = which;
4540
- which.sync = whichSync;
4541
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
4542
- var path3 = __require("path");
4543
- var COLON = isWindows ? ";" : ":";
4544
- var isexe = require_isexe();
4545
- function getNotFoundError(cmd) {
4546
- var er = new Error("not found: " + cmd);
4547
- er.code = "ENOENT";
4548
- return er;
4549
- }
4550
- function getPathInfo(cmd, opt) {
4551
- var colon = opt.colon || COLON;
4552
- var pathEnv = opt.path || process.env.PATH || "";
4553
- var pathExt = [""];
4554
- pathEnv = pathEnv.split(colon);
4555
- var pathExtExe = "";
4556
- if (isWindows) {
4557
- pathEnv.unshift(process.cwd());
4558
- pathExtExe = opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM";
4559
- pathExt = pathExtExe.split(colon);
4560
- if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
4561
- pathExt.unshift("");
4562
- }
4563
- if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
4564
- pathEnv = [""];
4565
- return {
4566
- env: pathEnv,
4567
- ext: pathExt,
4568
- extExe: pathExtExe
4569
- };
4570
- }
4571
- function which(cmd, opt, cb) {
4572
- if (typeof opt === "function") {
4573
- cb = opt;
4574
- opt = {};
4575
- }
4576
- var info = getPathInfo(cmd, opt);
4577
- var pathEnv = info.env;
4578
- var pathExt = info.ext;
4579
- var pathExtExe = info.extExe;
4580
- var found = [];
4581
- (function F(i, l) {
4582
- if (i === l) {
4583
- if (opt.all && found.length)
4584
- return cb(null, found);
4585
- else
4586
- return cb(getNotFoundError(cmd));
4587
- }
4588
- var pathPart = pathEnv[i];
4589
- if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
4590
- pathPart = pathPart.slice(1, -1);
4591
- var p = path3.join(pathPart, cmd);
4592
- if (!pathPart && /^\.[\\\/]/.test(cmd)) {
4593
- p = cmd.slice(0, 2) + p;
4594
- }
4595
- ;
4596
- (function E(ii, ll) {
4597
- if (ii === ll) return F(i + 1, l);
4598
- var ext = pathExt[ii];
4599
- isexe(p + ext, { pathExt: pathExtExe }, function(er, is) {
4600
- if (!er && is) {
4601
- if (opt.all)
4602
- found.push(p + ext);
4603
- else
4604
- return cb(null, p + ext);
4605
- }
4606
- return E(ii + 1, ll);
4607
- });
4608
- })(0, pathExt.length);
4609
- })(0, pathEnv.length);
4610
- }
4611
- function whichSync(cmd, opt) {
4612
- opt = opt || {};
4613
- var info = getPathInfo(cmd, opt);
4614
- var pathEnv = info.env;
4615
- var pathExt = info.ext;
4616
- var pathExtExe = info.extExe;
4617
- var found = [];
4618
- for (var i = 0, l = pathEnv.length; i < l; i++) {
4619
- var pathPart = pathEnv[i];
4620
- if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
4621
- pathPart = pathPart.slice(1, -1);
4622
- var p = path3.join(pathPart, cmd);
4623
- if (!pathPart && /^\.[\\\/]/.test(cmd)) {
4624
- p = cmd.slice(0, 2) + p;
4625
- }
4626
- for (var j = 0, ll = pathExt.length; j < ll; j++) {
4627
- var cur = p + pathExt[j];
4628
- var is;
4629
- try {
4630
- is = isexe.sync(cur, { pathExt: pathExtExe });
4631
- if (is) {
4632
- if (opt.all)
4633
- found.push(cur);
4634
- else
4635
- return cur;
4636
- }
4637
- } catch (ex) {
4638
- }
4639
- }
4640
- }
4641
- if (opt.all && found.length)
4642
- return found;
4643
- if (opt.nothrow)
4644
- return null;
4645
- throw getNotFoundError(cmd);
4646
- }
4647
- }
4648
- });
4649
-
4650
- // node_modules/pseudomap/pseudomap.js
4651
- var require_pseudomap = __commonJS({
4652
- "node_modules/pseudomap/pseudomap.js"(exports, module) {
4653
- var hasOwnProperty = Object.prototype.hasOwnProperty;
4654
- module.exports = PseudoMap;
4655
- function PseudoMap(set2) {
4656
- if (!(this instanceof PseudoMap))
4657
- throw new TypeError("Constructor PseudoMap requires 'new'");
4658
- this.clear();
4659
- if (set2) {
4660
- if (set2 instanceof PseudoMap || typeof Map === "function" && set2 instanceof Map)
4661
- set2.forEach(function(value, key) {
4662
- this.set(key, value);
4663
- }, this);
4664
- else if (Array.isArray(set2))
4665
- set2.forEach(function(kv) {
4666
- this.set(kv[0], kv[1]);
4667
- }, this);
4668
- else
4669
- throw new TypeError("invalid argument");
4670
- }
4671
- }
4672
- PseudoMap.prototype.forEach = function(fn, thisp) {
4673
- thisp = thisp || this;
4674
- Object.keys(this._data).forEach(function(k) {
4675
- if (k !== "size")
4676
- fn.call(thisp, this._data[k].value, this._data[k].key);
4677
- }, this);
4678
- };
4679
- PseudoMap.prototype.has = function(k) {
4680
- return !!find(this._data, k);
4681
- };
4682
- PseudoMap.prototype.get = function(k) {
4683
- var res = find(this._data, k);
4684
- return res && res.value;
4685
- };
4686
- PseudoMap.prototype.set = function(k, v) {
4687
- set(this._data, k, v);
4688
- };
4689
- PseudoMap.prototype.delete = function(k) {
4690
- var res = find(this._data, k);
4691
- if (res) {
4692
- delete this._data[res._index];
4693
- this._data.size--;
4694
- }
4695
- };
4696
- PseudoMap.prototype.clear = function() {
4697
- var data = /* @__PURE__ */ Object.create(null);
4698
- data.size = 0;
4699
- Object.defineProperty(this, "_data", {
4700
- value: data,
4701
- enumerable: false,
4702
- configurable: true,
4703
- writable: false
4704
- });
4705
- };
4706
- Object.defineProperty(PseudoMap.prototype, "size", {
4707
- get: function() {
4708
- return this._data.size;
4709
- },
4710
- set: function(n) {
4711
- },
4712
- enumerable: true,
4713
- configurable: true
4714
- });
4715
- PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() {
4716
- throw new Error("iterators are not implemented in this version");
4717
- };
4718
- function same(a, b) {
4719
- return a === b || a !== a && b !== b;
4720
- }
4721
- function Entry(k, v, i) {
4722
- this.key = k;
4723
- this.value = v;
4724
- this._index = i;
4725
- }
4726
- function find(data, k) {
4727
- for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
4728
- if (same(data[key].key, k))
4729
- return data[key];
4730
- }
4731
- }
4732
- function set(data, k, v) {
4733
- for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
4734
- if (same(data[key].key, k)) {
4735
- data[key].value = v;
4736
- return;
4737
- }
4738
- }
4739
- data.size++;
4740
- data[key] = new Entry(k, v, key);
4741
- }
4742
- }
4743
- });
4744
-
4745
- // node_modules/pseudomap/map.js
4746
- var require_map = __commonJS({
4747
- "node_modules/pseudomap/map.js"(exports, module) {
4748
- if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test")
4749
- process.env.TEST_PSEUDOMAP = "true";
4750
- if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) {
4751
- module.exports = Map;
4752
- } else {
4753
- module.exports = require_pseudomap();
4754
- }
4755
- }
4756
- });
4757
-
4758
- // node_modules/execa/node_modules/yallist/yallist.js
4759
- var require_yallist = __commonJS({
4760
- "node_modules/execa/node_modules/yallist/yallist.js"(exports, module) {
4761
- module.exports = Yallist;
4762
- Yallist.Node = Node;
4763
- Yallist.create = Yallist;
4764
- function Yallist(list) {
4765
- var self = this;
4766
- if (!(self instanceof Yallist)) {
4767
- self = new Yallist();
4768
- }
4769
- self.tail = null;
4770
- self.head = null;
4771
- self.length = 0;
4772
- if (list && typeof list.forEach === "function") {
4773
- list.forEach(function(item) {
4774
- self.push(item);
4775
- });
4776
- } else if (arguments.length > 0) {
4777
- for (var i = 0, l = arguments.length; i < l; i++) {
4778
- self.push(arguments[i]);
4779
- }
4780
- }
4781
- return self;
4782
- }
4783
- Yallist.prototype.removeNode = function(node) {
4784
- if (node.list !== this) {
4785
- throw new Error("removing node which does not belong to this list");
4786
- }
4787
- var next = node.next;
4788
- var prev = node.prev;
4789
- if (next) {
4790
- next.prev = prev;
4791
- }
4792
- if (prev) {
4793
- prev.next = next;
4794
- }
4795
- if (node === this.head) {
4796
- this.head = next;
4797
- }
4798
- if (node === this.tail) {
4799
- this.tail = prev;
4800
- }
4801
- node.list.length--;
4802
- node.next = null;
4803
- node.prev = null;
4804
- node.list = null;
4805
- };
4806
- Yallist.prototype.unshiftNode = function(node) {
4807
- if (node === this.head) {
4808
- return;
4809
- }
4810
- if (node.list) {
4811
- node.list.removeNode(node);
4812
- }
4813
- var head = this.head;
4814
- node.list = this;
4815
- node.next = head;
4816
- if (head) {
4817
- head.prev = node;
4818
- }
4819
- this.head = node;
4820
- if (!this.tail) {
4821
- this.tail = node;
4822
- }
4823
- this.length++;
4824
- };
4825
- Yallist.prototype.pushNode = function(node) {
4826
- if (node === this.tail) {
4827
- return;
4828
- }
4829
- if (node.list) {
4830
- node.list.removeNode(node);
4831
- }
4832
- var tail = this.tail;
4833
- node.list = this;
4834
- node.prev = tail;
4835
- if (tail) {
4836
- tail.next = node;
4837
- }
4838
- this.tail = node;
4839
- if (!this.head) {
4840
- this.head = node;
4841
- }
4842
- this.length++;
4843
- };
4844
- Yallist.prototype.push = function() {
4845
- for (var i = 0, l = arguments.length; i < l; i++) {
4846
- push(this, arguments[i]);
4847
- }
4848
- return this.length;
4849
- };
4850
- Yallist.prototype.unshift = function() {
4851
- for (var i = 0, l = arguments.length; i < l; i++) {
4852
- unshift(this, arguments[i]);
4853
- }
4854
- return this.length;
4855
- };
4856
- Yallist.prototype.pop = function() {
4857
- if (!this.tail) {
4858
- return void 0;
4859
- }
4860
- var res = this.tail.value;
4861
- this.tail = this.tail.prev;
4862
- if (this.tail) {
4863
- this.tail.next = null;
4864
- } else {
4865
- this.head = null;
4866
- }
4867
- this.length--;
4868
- return res;
4869
- };
4870
- Yallist.prototype.shift = function() {
4871
- if (!this.head) {
4872
- return void 0;
4873
- }
4874
- var res = this.head.value;
4875
- this.head = this.head.next;
4876
- if (this.head) {
4877
- this.head.prev = null;
4878
- } else {
4879
- this.tail = null;
4880
- }
4881
- this.length--;
4882
- return res;
4883
- };
4884
- Yallist.prototype.forEach = function(fn, thisp) {
4885
- thisp = thisp || this;
4886
- for (var walker = this.head, i = 0; walker !== null; i++) {
4887
- fn.call(thisp, walker.value, i, this);
4888
- walker = walker.next;
4889
- }
4890
- };
4891
- Yallist.prototype.forEachReverse = function(fn, thisp) {
4892
- thisp = thisp || this;
4893
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
4894
- fn.call(thisp, walker.value, i, this);
4895
- walker = walker.prev;
4896
- }
4897
- };
4898
- Yallist.prototype.get = function(n) {
4899
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
4900
- walker = walker.next;
4901
- }
4902
- if (i === n && walker !== null) {
4903
- return walker.value;
4904
- }
4905
- };
4906
- Yallist.prototype.getReverse = function(n) {
4907
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
4908
- walker = walker.prev;
4909
- }
4910
- if (i === n && walker !== null) {
4911
- return walker.value;
4912
- }
4913
- };
4914
- Yallist.prototype.map = function(fn, thisp) {
4915
- thisp = thisp || this;
4916
- var res = new Yallist();
4917
- for (var walker = this.head; walker !== null; ) {
4918
- res.push(fn.call(thisp, walker.value, this));
4919
- walker = walker.next;
4920
- }
4921
- return res;
4922
- };
4923
- Yallist.prototype.mapReverse = function(fn, thisp) {
4924
- thisp = thisp || this;
4925
- var res = new Yallist();
4926
- for (var walker = this.tail; walker !== null; ) {
4927
- res.push(fn.call(thisp, walker.value, this));
4928
- walker = walker.prev;
4929
- }
4930
- return res;
4931
- };
4932
- Yallist.prototype.reduce = function(fn, initial) {
4933
- var acc;
4934
- var walker = this.head;
4935
- if (arguments.length > 1) {
4936
- acc = initial;
4937
- } else if (this.head) {
4938
- walker = this.head.next;
4939
- acc = this.head.value;
4940
- } else {
4941
- throw new TypeError("Reduce of empty list with no initial value");
4942
- }
4943
- for (var i = 0; walker !== null; i++) {
4944
- acc = fn(acc, walker.value, i);
4945
- walker = walker.next;
4946
- }
4947
- return acc;
4948
- };
4949
- Yallist.prototype.reduceReverse = function(fn, initial) {
4950
- var acc;
4951
- var walker = this.tail;
4952
- if (arguments.length > 1) {
4953
- acc = initial;
4954
- } else if (this.tail) {
4955
- walker = this.tail.prev;
4956
- acc = this.tail.value;
4957
- } else {
4958
- throw new TypeError("Reduce of empty list with no initial value");
4959
- }
4960
- for (var i = this.length - 1; walker !== null; i--) {
4961
- acc = fn(acc, walker.value, i);
4962
- walker = walker.prev;
4963
- }
4964
- return acc;
4965
- };
4966
- Yallist.prototype.toArray = function() {
4967
- var arr = new Array(this.length);
4968
- for (var i = 0, walker = this.head; walker !== null; i++) {
4969
- arr[i] = walker.value;
4970
- walker = walker.next;
4971
- }
4972
- return arr;
4973
- };
4974
- Yallist.prototype.toArrayReverse = function() {
4975
- var arr = new Array(this.length);
4976
- for (var i = 0, walker = this.tail; walker !== null; i++) {
4977
- arr[i] = walker.value;
4978
- walker = walker.prev;
4979
- }
4980
- return arr;
4981
- };
4982
- Yallist.prototype.slice = function(from, to) {
4983
- to = to || this.length;
4984
- if (to < 0) {
4985
- to += this.length;
4986
- }
4987
- from = from || 0;
4988
- if (from < 0) {
4989
- from += this.length;
4990
- }
4991
- var ret = new Yallist();
4992
- if (to < from || to < 0) {
4993
- return ret;
4994
- }
4995
- if (from < 0) {
4996
- from = 0;
4997
- }
4998
- if (to > this.length) {
4999
- to = this.length;
5000
- }
5001
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
5002
- walker = walker.next;
5003
- }
5004
- for (; walker !== null && i < to; i++, walker = walker.next) {
5005
- ret.push(walker.value);
5006
- }
5007
- return ret;
5008
- };
5009
- Yallist.prototype.sliceReverse = function(from, to) {
5010
- to = to || this.length;
5011
- if (to < 0) {
5012
- to += this.length;
5013
- }
5014
- from = from || 0;
5015
- if (from < 0) {
5016
- from += this.length;
5017
- }
5018
- var ret = new Yallist();
5019
- if (to < from || to < 0) {
5020
- return ret;
5021
- }
5022
- if (from < 0) {
5023
- from = 0;
5024
- }
5025
- if (to > this.length) {
5026
- to = this.length;
5027
- }
5028
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
5029
- walker = walker.prev;
5030
- }
5031
- for (; walker !== null && i > from; i--, walker = walker.prev) {
5032
- ret.push(walker.value);
5033
- }
5034
- return ret;
5035
- };
5036
- Yallist.prototype.reverse = function() {
5037
- var head = this.head;
5038
- var tail = this.tail;
5039
- for (var walker = head; walker !== null; walker = walker.prev) {
5040
- var p = walker.prev;
5041
- walker.prev = walker.next;
5042
- walker.next = p;
5043
- }
5044
- this.head = tail;
5045
- this.tail = head;
5046
- return this;
5047
- };
5048
- function push(self, item) {
5049
- self.tail = new Node(item, self.tail, null, self);
5050
- if (!self.head) {
5051
- self.head = self.tail;
5052
- }
5053
- self.length++;
5054
- }
5055
- function unshift(self, item) {
5056
- self.head = new Node(item, null, self.head, self);
5057
- if (!self.tail) {
5058
- self.tail = self.head;
5059
- }
5060
- self.length++;
5061
- }
5062
- function Node(value, prev, next, list) {
5063
- if (!(this instanceof Node)) {
5064
- return new Node(value, prev, next, list);
5065
- }
5066
- this.list = list;
5067
- this.value = value;
5068
- if (prev) {
5069
- prev.next = this;
5070
- this.prev = prev;
5071
- } else {
5072
- this.prev = null;
5073
- }
5074
- if (next) {
5075
- next.prev = this;
5076
- this.next = next;
5077
- } else {
5078
- this.next = null;
5079
- }
5080
- }
5081
- }
5082
- });
5083
-
5084
- // node_modules/execa/node_modules/lru-cache/index.js
5085
- var require_lru_cache = __commonJS({
5086
- "node_modules/execa/node_modules/lru-cache/index.js"(exports, module) {
5087
- "use strict";
5088
- module.exports = LRUCache;
5089
- var Map2 = require_map();
5090
- var util = __require("util");
5091
- var Yallist = require_yallist();
5092
- var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1";
5093
- var makeSymbol;
5094
- if (hasSymbol) {
5095
- makeSymbol = function(key) {
5096
- return Symbol(key);
5097
- };
5098
- } else {
5099
- makeSymbol = function(key) {
5100
- return "_" + key;
5101
- };
5102
- }
5103
- var MAX = makeSymbol("max");
5104
- var LENGTH = makeSymbol("length");
5105
- var LENGTH_CALCULATOR = makeSymbol("lengthCalculator");
5106
- var ALLOW_STALE = makeSymbol("allowStale");
5107
- var MAX_AGE = makeSymbol("maxAge");
5108
- var DISPOSE = makeSymbol("dispose");
5109
- var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet");
5110
- var LRU_LIST = makeSymbol("lruList");
5111
- var CACHE = makeSymbol("cache");
5112
- function naiveLength() {
5113
- return 1;
5114
- }
5115
- function LRUCache(options) {
5116
- if (!(this instanceof LRUCache)) {
5117
- return new LRUCache(options);
5118
- }
5119
- if (typeof options === "number") {
5120
- options = { max: options };
5121
- }
5122
- if (!options) {
5123
- options = {};
5124
- }
5125
- var max = this[MAX] = options.max;
5126
- if (!max || !(typeof max === "number") || max <= 0) {
5127
- this[MAX] = Infinity;
5128
- }
5129
- var lc = options.length || naiveLength;
5130
- if (typeof lc !== "function") {
5131
- lc = naiveLength;
5132
- }
5133
- this[LENGTH_CALCULATOR] = lc;
5134
- this[ALLOW_STALE] = options.stale || false;
5135
- this[MAX_AGE] = options.maxAge || 0;
5136
- this[DISPOSE] = options.dispose;
5137
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
5138
- this.reset();
5139
- }
5140
- Object.defineProperty(LRUCache.prototype, "max", {
5141
- set: function(mL) {
5142
- if (!mL || !(typeof mL === "number") || mL <= 0) {
5143
- mL = Infinity;
5144
- }
5145
- this[MAX] = mL;
5146
- trim(this);
5147
- },
5148
- get: function() {
5149
- return this[MAX];
5150
- },
5151
- enumerable: true
5152
- });
5153
- Object.defineProperty(LRUCache.prototype, "allowStale", {
5154
- set: function(allowStale) {
5155
- this[ALLOW_STALE] = !!allowStale;
5156
- },
5157
- get: function() {
5158
- return this[ALLOW_STALE];
5159
- },
5160
- enumerable: true
5161
- });
5162
- Object.defineProperty(LRUCache.prototype, "maxAge", {
5163
- set: function(mA) {
5164
- if (!mA || !(typeof mA === "number") || mA < 0) {
5165
- mA = 0;
5166
- }
5167
- this[MAX_AGE] = mA;
5168
- trim(this);
5169
- },
5170
- get: function() {
5171
- return this[MAX_AGE];
5172
- },
5173
- enumerable: true
5174
- });
5175
- Object.defineProperty(LRUCache.prototype, "lengthCalculator", {
5176
- set: function(lC) {
5177
- if (typeof lC !== "function") {
5178
- lC = naiveLength;
5179
- }
5180
- if (lC !== this[LENGTH_CALCULATOR]) {
5181
- this[LENGTH_CALCULATOR] = lC;
5182
- this[LENGTH] = 0;
5183
- this[LRU_LIST].forEach(function(hit) {
5184
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
5185
- this[LENGTH] += hit.length;
5186
- }, this);
5187
- }
5188
- trim(this);
5189
- },
5190
- get: function() {
5191
- return this[LENGTH_CALCULATOR];
5192
- },
5193
- enumerable: true
5194
- });
5195
- Object.defineProperty(LRUCache.prototype, "length", {
5196
- get: function() {
5197
- return this[LENGTH];
5198
- },
5199
- enumerable: true
5200
- });
5201
- Object.defineProperty(LRUCache.prototype, "itemCount", {
5202
- get: function() {
5203
- return this[LRU_LIST].length;
5204
- },
5205
- enumerable: true
5206
- });
5207
- LRUCache.prototype.rforEach = function(fn, thisp) {
5208
- thisp = thisp || this;
5209
- for (var walker = this[LRU_LIST].tail; walker !== null; ) {
5210
- var prev = walker.prev;
5211
- forEachStep(this, fn, walker, thisp);
5212
- walker = prev;
5213
- }
5214
- };
5215
- function forEachStep(self, fn, node, thisp) {
5216
- var hit = node.value;
5217
- if (isStale(self, hit)) {
5218
- del(self, node);
5219
- if (!self[ALLOW_STALE]) {
5220
- hit = void 0;
5221
- }
5222
- }
5223
- if (hit) {
5224
- fn.call(thisp, hit.value, hit.key, self);
5225
- }
5226
- }
5227
- LRUCache.prototype.forEach = function(fn, thisp) {
5228
- thisp = thisp || this;
5229
- for (var walker = this[LRU_LIST].head; walker !== null; ) {
5230
- var next = walker.next;
5231
- forEachStep(this, fn, walker, thisp);
5232
- walker = next;
5233
- }
5234
- };
5235
- LRUCache.prototype.keys = function() {
5236
- return this[LRU_LIST].toArray().map(function(k) {
5237
- return k.key;
5238
- }, this);
5239
- };
5240
- LRUCache.prototype.values = function() {
5241
- return this[LRU_LIST].toArray().map(function(k) {
5242
- return k.value;
5243
- }, this);
5244
- };
5245
- LRUCache.prototype.reset = function() {
5246
- if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
5247
- this[LRU_LIST].forEach(function(hit) {
5248
- this[DISPOSE](hit.key, hit.value);
5249
- }, this);
5250
- }
5251
- this[CACHE] = new Map2();
5252
- this[LRU_LIST] = new Yallist();
5253
- this[LENGTH] = 0;
5254
- };
5255
- LRUCache.prototype.dump = function() {
5256
- return this[LRU_LIST].map(function(hit) {
5257
- if (!isStale(this, hit)) {
5258
- return {
5259
- k: hit.key,
5260
- v: hit.value,
5261
- e: hit.now + (hit.maxAge || 0)
5262
- };
5263
- }
5264
- }, this).toArray().filter(function(h) {
5265
- return h;
5266
- });
5267
- };
5268
- LRUCache.prototype.dumpLru = function() {
5269
- return this[LRU_LIST];
5270
- };
5271
- LRUCache.prototype.inspect = function(n, opts) {
5272
- var str = "LRUCache {";
5273
- var extras = false;
5274
- var as = this[ALLOW_STALE];
5275
- if (as) {
5276
- str += "\n allowStale: true";
5277
- extras = true;
5278
- }
5279
- var max = this[MAX];
5280
- if (max && max !== Infinity) {
5281
- if (extras) {
5282
- str += ",";
5283
- }
5284
- str += "\n max: " + util.inspect(max, opts);
5285
- extras = true;
5286
- }
5287
- var maxAge = this[MAX_AGE];
5288
- if (maxAge) {
5289
- if (extras) {
5290
- str += ",";
5291
- }
5292
- str += "\n maxAge: " + util.inspect(maxAge, opts);
5293
- extras = true;
5294
- }
5295
- var lc = this[LENGTH_CALCULATOR];
5296
- if (lc && lc !== naiveLength) {
5297
- if (extras) {
5298
- str += ",";
5299
- }
5300
- str += "\n length: " + util.inspect(this[LENGTH], opts);
5301
- extras = true;
5302
- }
5303
- var didFirst = false;
5304
- this[LRU_LIST].forEach(function(item) {
5305
- if (didFirst) {
5306
- str += ",\n ";
5307
- } else {
5308
- if (extras) {
5309
- str += ",\n";
5310
- }
5311
- didFirst = true;
5312
- str += "\n ";
5313
- }
5314
- var key = util.inspect(item.key).split("\n").join("\n ");
5315
- var val = { value: item.value };
5316
- if (item.maxAge !== maxAge) {
5317
- val.maxAge = item.maxAge;
5318
- }
5319
- if (lc !== naiveLength) {
5320
- val.length = item.length;
5321
- }
5322
- if (isStale(this, item)) {
5323
- val.stale = true;
5324
- }
5325
- val = util.inspect(val, opts).split("\n").join("\n ");
5326
- str += key + " => " + val;
5327
- });
5328
- if (didFirst || extras) {
5329
- str += "\n";
5330
- }
5331
- str += "}";
5332
- return str;
5333
- };
5334
- LRUCache.prototype.set = function(key, value, maxAge) {
5335
- maxAge = maxAge || this[MAX_AGE];
5336
- var now = maxAge ? Date.now() : 0;
5337
- var len = this[LENGTH_CALCULATOR](value, key);
5338
- if (this[CACHE].has(key)) {
5339
- if (len > this[MAX]) {
5340
- del(this, this[CACHE].get(key));
5341
- return false;
5342
- }
5343
- var node = this[CACHE].get(key);
5344
- var item = node.value;
5345
- if (this[DISPOSE]) {
5346
- if (!this[NO_DISPOSE_ON_SET]) {
5347
- this[DISPOSE](key, item.value);
5348
- }
5349
- }
5350
- item.now = now;
5351
- item.maxAge = maxAge;
5352
- item.value = value;
5353
- this[LENGTH] += len - item.length;
5354
- item.length = len;
5355
- this.get(key);
5356
- trim(this);
5357
- return true;
5358
- }
5359
- var hit = new Entry(key, value, len, now, maxAge);
5360
- if (hit.length > this[MAX]) {
5361
- if (this[DISPOSE]) {
5362
- this[DISPOSE](key, value);
5363
- }
5364
- return false;
5365
- }
5366
- this[LENGTH] += hit.length;
5367
- this[LRU_LIST].unshift(hit);
5368
- this[CACHE].set(key, this[LRU_LIST].head);
5369
- trim(this);
5370
- return true;
5371
- };
5372
- LRUCache.prototype.has = function(key) {
5373
- if (!this[CACHE].has(key)) return false;
5374
- var hit = this[CACHE].get(key).value;
5375
- if (isStale(this, hit)) {
5376
- return false;
5377
- }
5378
- return true;
5379
- };
5380
- LRUCache.prototype.get = function(key) {
5381
- return get(this, key, true);
5382
- };
5383
- LRUCache.prototype.peek = function(key) {
5384
- return get(this, key, false);
5385
- };
5386
- LRUCache.prototype.pop = function() {
5387
- var node = this[LRU_LIST].tail;
5388
- if (!node) return null;
5389
- del(this, node);
5390
- return node.value;
5391
- };
5392
- LRUCache.prototype.del = function(key) {
5393
- del(this, this[CACHE].get(key));
5394
- };
5395
- LRUCache.prototype.load = function(arr) {
5396
- this.reset();
5397
- var now = Date.now();
5398
- for (var l = arr.length - 1; l >= 0; l--) {
5399
- var hit = arr[l];
5400
- var expiresAt = hit.e || 0;
5401
- if (expiresAt === 0) {
5402
- this.set(hit.k, hit.v);
5403
- } else {
5404
- var maxAge = expiresAt - now;
5405
- if (maxAge > 0) {
5406
- this.set(hit.k, hit.v, maxAge);
5407
- }
5408
- }
5409
- }
5410
- };
5411
- LRUCache.prototype.prune = function() {
5412
- var self = this;
5413
- this[CACHE].forEach(function(value, key) {
5414
- get(self, key, false);
5415
- });
5416
- };
5417
- function get(self, key, doUse) {
5418
- var node = self[CACHE].get(key);
5419
- if (node) {
5420
- var hit = node.value;
5421
- if (isStale(self, hit)) {
5422
- del(self, node);
5423
- if (!self[ALLOW_STALE]) hit = void 0;
5424
- } else {
5425
- if (doUse) {
5426
- self[LRU_LIST].unshiftNode(node);
5427
- }
5428
- }
5429
- if (hit) hit = hit.value;
5430
- }
5431
- return hit;
5432
- }
5433
- function isStale(self, hit) {
5434
- if (!hit || !hit.maxAge && !self[MAX_AGE]) {
5435
- return false;
5436
- }
5437
- var stale = false;
5438
- var diff = Date.now() - hit.now;
5439
- if (hit.maxAge) {
5440
- stale = diff > hit.maxAge;
5441
- } else {
5442
- stale = self[MAX_AGE] && diff > self[MAX_AGE];
5443
- }
5444
- return stale;
5445
- }
5446
- function trim(self) {
5447
- if (self[LENGTH] > self[MAX]) {
5448
- for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
5449
- var prev = walker.prev;
5450
- del(self, walker);
5451
- walker = prev;
5452
- }
5453
- }
5454
- }
5455
- function del(self, node) {
5456
- if (node) {
5457
- var hit = node.value;
5458
- if (self[DISPOSE]) {
5459
- self[DISPOSE](hit.key, hit.value);
5460
- }
5461
- self[LENGTH] -= hit.length;
5462
- self[CACHE].delete(hit.key);
5463
- self[LRU_LIST].removeNode(node);
5464
- }
5465
- }
5466
- function Entry(key, value, length, now, maxAge) {
5467
- this.key = key;
5468
- this.value = value;
5469
- this.length = length;
5470
- this.now = now;
5471
- this.maxAge = maxAge || 0;
5472
- }
5473
- }
5474
- });
5475
-
5476
- // node_modules/execa/node_modules/cross-spawn/lib/util/resolveCommand.js
5477
- var require_resolveCommand = __commonJS({
5478
- "node_modules/execa/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
5479
- "use strict";
5480
- var path3 = __require("path");
5481
- var which = require_which();
5482
- var LRU = require_lru_cache();
5483
- var commandCache = new LRU({ max: 50, maxAge: 30 * 1e3 });
5484
- function resolveCommand(command, noExtension) {
5485
- var resolved;
5486
- noExtension = !!noExtension;
5487
- resolved = commandCache.get(command + "!" + noExtension);
5488
- if (commandCache.has(command)) {
5489
- return commandCache.get(command);
5490
- }
5491
- try {
5492
- resolved = !noExtension ? which.sync(command) : which.sync(command, { pathExt: path3.delimiter + (process.env.PATHEXT || "") });
5493
- } catch (e) {
5494
- }
5495
- commandCache.set(command + "!" + noExtension, resolved);
5496
- return resolved;
5497
- }
5498
- module.exports = resolveCommand;
5499
- }
5500
- });
5501
-
5502
- // node_modules/execa/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js
5503
- var require_hasEmptyArgumentBug = __commonJS({
5504
- "node_modules/execa/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js"(exports, module) {
5505
- "use strict";
5506
- function hasEmptyArgumentBug() {
5507
- var nodeVer;
5508
- if (process.platform !== "win32") {
5509
- return false;
5510
- }
5511
- nodeVer = process.version.substr(1).split(".").map(function(num) {
5512
- return parseInt(num, 10);
5513
- });
5514
- return nodeVer[0] === 0 && nodeVer[1] < 12;
5515
- }
5516
- module.exports = hasEmptyArgumentBug();
5517
- }
5518
- });
5519
-
5520
- // node_modules/execa/node_modules/cross-spawn/lib/util/escapeArgument.js
5521
- var require_escapeArgument = __commonJS({
5522
- "node_modules/execa/node_modules/cross-spawn/lib/util/escapeArgument.js"(exports, module) {
5523
- "use strict";
5524
- function escapeArgument(arg, quote) {
5525
- arg = "" + arg;
5526
- if (!quote) {
5527
- arg = arg.replace(/([()%!^<>&|;,"'\s])/g, "^$1");
5528
- } else {
5529
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
5530
- arg = arg.replace(/(\\*)$/, "$1$1");
5531
- arg = '"' + arg + '"';
5532
- }
5533
- return arg;
5534
- }
5535
- module.exports = escapeArgument;
5536
- }
5537
- });
5538
-
5539
- // node_modules/execa/node_modules/cross-spawn/lib/util/escapeCommand.js
5540
- var require_escapeCommand = __commonJS({
5541
- "node_modules/execa/node_modules/cross-spawn/lib/util/escapeCommand.js"(exports, module) {
5542
- "use strict";
5543
- var escapeArgument = require_escapeArgument();
5544
- function escapeCommand(command) {
5545
- return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true);
5546
- }
5547
- module.exports = escapeCommand;
5548
- }
5549
- });
5550
-
5551
- // node_modules/execa/node_modules/shebang-regex/index.js
5552
- var require_shebang_regex = __commonJS({
5553
- "node_modules/execa/node_modules/shebang-regex/index.js"(exports, module) {
5554
- "use strict";
5555
- module.exports = /^#!.*/;
5556
- }
5557
- });
5558
-
5559
- // node_modules/execa/node_modules/shebang-command/index.js
5560
- var require_shebang_command = __commonJS({
5561
- "node_modules/execa/node_modules/shebang-command/index.js"(exports, module) {
5562
- "use strict";
5563
- var shebangRegex = require_shebang_regex();
5564
- module.exports = function(str) {
5565
- var match = str.match(shebangRegex);
5566
- if (!match) {
5567
- return null;
5568
- }
5569
- var arr = match[0].replace(/#! ?/, "").split(" ");
5570
- var bin = arr[0].split("/").pop();
5571
- var arg = arr[1];
5572
- return bin === "env" ? arg : bin + (arg ? " " + arg : "");
5573
- };
5574
- }
5575
- });
5576
-
5577
- // node_modules/execa/node_modules/cross-spawn/lib/util/readShebang.js
5578
- var require_readShebang = __commonJS({
5579
- "node_modules/execa/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
5580
- "use strict";
5581
- var fs3 = __require("fs");
5582
- var LRU = require_lru_cache();
5583
- var shebangCommand = require_shebang_command();
5584
- var shebangCache = new LRU({ max: 50, maxAge: 30 * 1e3 });
5585
- function readShebang(command) {
5586
- var buffer;
5587
- var fd;
5588
- var shebang;
5589
- if (shebangCache.has(command)) {
5590
- return shebangCache.get(command);
5591
- }
5592
- buffer = new Buffer(150);
5593
- try {
5594
- fd = fs3.openSync(command, "r");
5595
- fs3.readSync(fd, buffer, 0, 150, 0);
5596
- fs3.closeSync(fd);
5597
- } catch (e) {
5598
- }
5599
- shebang = shebangCommand(buffer.toString());
5600
- shebangCache.set(command, shebang);
5601
- return shebang;
5602
- }
5603
- module.exports = readShebang;
5604
- }
5605
- });
5606
-
5607
- // node_modules/execa/node_modules/cross-spawn/lib/parse.js
5608
- var require_parse = __commonJS({
5609
- "node_modules/execa/node_modules/cross-spawn/lib/parse.js"(exports, module) {
5610
- "use strict";
5611
- var resolveCommand = require_resolveCommand();
5612
- var hasEmptyArgumentBug = require_hasEmptyArgumentBug();
5613
- var escapeArgument = require_escapeArgument();
5614
- var escapeCommand = require_escapeCommand();
5615
- var readShebang = require_readShebang();
5616
- var isWin = process.platform === "win32";
5617
- var skipShellRegExp = /\.(?:com|exe)$/i;
5618
- var supportsShellOption = parseInt(process.version.substr(1).split(".")[0], 10) >= 6 || parseInt(process.version.substr(1).split(".")[0], 10) === 4 && parseInt(process.version.substr(1).split(".")[1], 10) >= 8;
5619
- function parseNonShell(parsed) {
5620
- var shebang;
5621
- var needsShell;
5622
- var applyQuotes;
5623
- if (!isWin) {
5624
- return parsed;
5625
- }
5626
- parsed.file = resolveCommand(parsed.command);
5627
- parsed.file = parsed.file || resolveCommand(parsed.command, true);
5628
- shebang = parsed.file && readShebang(parsed.file);
5629
- if (shebang) {
5630
- parsed.args.unshift(parsed.file);
5631
- parsed.command = shebang;
5632
- needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(resolveCommand(shebang) || resolveCommand(shebang, true));
5633
- } else {
5634
- needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(parsed.file);
5635
- }
5636
- if (needsShell) {
5637
- applyQuotes = parsed.command !== "echo";
5638
- parsed.command = escapeCommand(parsed.command);
5639
- parsed.args = parsed.args.map(function(arg) {
5640
- return escapeArgument(arg, applyQuotes);
5641
- });
5642
- parsed.args = ["/d", "/s", "/c", '"' + parsed.command + (parsed.args.length ? " " + parsed.args.join(" ") : "") + '"'];
5643
- parsed.command = process.env.comspec || "cmd.exe";
5644
- parsed.options.windowsVerbatimArguments = true;
5645
- }
5646
- return parsed;
5647
- }
5648
- function parseShell(parsed) {
5649
- var shellCommand;
5650
- if (supportsShellOption) {
5651
- return parsed;
5652
- }
5653
- shellCommand = [parsed.command].concat(parsed.args).join(" ");
5654
- if (isWin) {
5655
- parsed.command = typeof parsed.options.shell === "string" ? parsed.options.shell : process.env.comspec || "cmd.exe";
5656
- parsed.args = ["/d", "/s", "/c", '"' + shellCommand + '"'];
5657
- parsed.options.windowsVerbatimArguments = true;
5658
- } else {
5659
- if (typeof parsed.options.shell === "string") {
5660
- parsed.command = parsed.options.shell;
5661
- } else if (process.platform === "android") {
5662
- parsed.command = "/system/bin/sh";
5663
- } else {
5664
- parsed.command = "/bin/sh";
5665
- }
5666
- parsed.args = ["-c", shellCommand];
5667
- }
5668
- return parsed;
5669
- }
5670
- function parse2(command, args, options) {
5671
- var parsed;
5672
- if (args && !Array.isArray(args)) {
5673
- options = args;
5674
- args = null;
5675
- }
5676
- args = args ? args.slice(0) : [];
5677
- options = options || {};
5678
- parsed = {
5679
- command,
5680
- args,
5681
- options,
5682
- file: void 0,
5683
- original: command
5684
- };
5685
- return options.shell ? parseShell(parsed) : parseNonShell(parsed);
5686
- }
5687
- module.exports = parse2;
5688
- }
5689
- });
5690
-
5691
- // node_modules/execa/node_modules/cross-spawn/lib/enoent.js
5692
- var require_enoent = __commonJS({
5693
- "node_modules/execa/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
5694
- "use strict";
5695
- var isWin = process.platform === "win32";
5696
- var resolveCommand = require_resolveCommand();
5697
- var isNode10 = process.version.indexOf("v0.10.") === 0;
5698
- function notFoundError(command, syscall) {
5699
- var err;
5700
- err = new Error(syscall + " " + command + " ENOENT");
5701
- err.code = err.errno = "ENOENT";
5702
- err.syscall = syscall + " " + command;
5703
- return err;
5704
- }
5705
- function hookChildProcess(cp, parsed) {
5706
- var originalEmit;
5707
- if (!isWin) {
5708
- return;
5709
- }
5710
- originalEmit = cp.emit;
5711
- cp.emit = function(name, arg1) {
5712
- var err;
5713
- if (name === "exit") {
5714
- err = verifyENOENT(arg1, parsed, "spawn");
5715
- if (err) {
5716
- return originalEmit.call(cp, "error", err);
5717
- }
5718
- }
5719
- return originalEmit.apply(cp, arguments);
5720
- };
5721
- }
5722
- function verifyENOENT(status, parsed) {
5723
- if (isWin && status === 1 && !parsed.file) {
5724
- return notFoundError(parsed.original, "spawn");
5725
- }
5726
- return null;
5727
- }
5728
- function verifyENOENTSync(status, parsed) {
5729
- if (isWin && status === 1 && !parsed.file) {
5730
- return notFoundError(parsed.original, "spawnSync");
5731
- }
5732
- if (isNode10 && status === -1) {
5733
- parsed.file = isWin ? parsed.file : resolveCommand(parsed.original);
5734
- if (!parsed.file) {
5735
- return notFoundError(parsed.original, "spawnSync");
5736
- }
5737
- }
5738
- return null;
5739
- }
5740
- module.exports.hookChildProcess = hookChildProcess;
5741
- module.exports.verifyENOENT = verifyENOENT;
5742
- module.exports.verifyENOENTSync = verifyENOENTSync;
5743
- module.exports.notFoundError = notFoundError;
5744
- }
5745
- });
5746
-
5747
- // node_modules/execa/node_modules/cross-spawn/index.js
5748
- var require_cross_spawn = __commonJS({
5749
- "node_modules/execa/node_modules/cross-spawn/index.js"(exports, module) {
5750
- "use strict";
5751
- var cp = __require("child_process");
5752
- var parse2 = require_parse();
5753
- var enoent = require_enoent();
5754
- var cpSpawnSync = cp.spawnSync;
5755
- function spawn(command, args, options) {
5756
- var parsed;
5757
- var spawned;
5758
- parsed = parse2(command, args, options);
5759
- spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
5760
- enoent.hookChildProcess(spawned, parsed);
5761
- return spawned;
5762
- }
5763
- function spawnSync(command, args, options) {
5764
- var parsed;
5765
- var result;
5766
- if (!cpSpawnSync) {
5767
- try {
5768
- cpSpawnSync = __require("spawn-sync");
5769
- } catch (ex) {
5770
- throw new Error(
5771
- "In order to use spawnSync on node 0.10 or older, you must install spawn-sync:\n\n npm install spawn-sync --save"
5772
- );
5773
- }
5774
- }
5775
- parsed = parse2(command, args, options);
5776
- result = cpSpawnSync(parsed.command, parsed.args, parsed.options);
5777
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
5778
- return result;
5779
- }
5780
- module.exports = spawn;
5781
- module.exports.spawn = spawn;
5782
- module.exports.sync = spawnSync;
5783
- module.exports._parse = parse2;
5784
- module.exports._enoent = enoent;
5785
- }
5786
- });
5787
-
5788
- // node_modules/strip-eof/index.js
5789
- var require_strip_eof = __commonJS({
5790
- "node_modules/strip-eof/index.js"(exports, module) {
5791
- "use strict";
5792
- module.exports = function(x) {
5793
- var lf = typeof x === "string" ? "\n" : "\n".charCodeAt();
5794
- var cr = typeof x === "string" ? "\r" : "\r".charCodeAt();
5795
- if (x[x.length - 1] === lf) {
5796
- x = x.slice(0, x.length - 1);
5797
- }
5798
- if (x[x.length - 1] === cr) {
5799
- x = x.slice(0, x.length - 1);
5800
- }
5801
- return x;
5802
- };
5803
- }
5804
- });
5805
-
5806
- // node_modules/npm-run-path/node_modules/path-key/index.js
5807
- var require_path_key = __commonJS({
5808
- "node_modules/npm-run-path/node_modules/path-key/index.js"(exports, module) {
5809
- "use strict";
5810
- module.exports = (opts) => {
5811
- opts = opts || {};
5812
- const env = opts.env || process.env;
5813
- const platform = opts.platform || process.platform;
5814
- if (platform !== "win32") {
5815
- return "PATH";
5816
- }
5817
- return Object.keys(env).find((x) => x.toUpperCase() === "PATH") || "Path";
5818
- };
5819
- }
5820
- });
5821
-
5822
- // node_modules/npm-run-path/index.js
5823
- var require_npm_run_path = __commonJS({
5824
- "node_modules/npm-run-path/index.js"(exports, module) {
5825
- "use strict";
5826
- var path3 = __require("path");
5827
- var pathKey = require_path_key();
5828
- module.exports = (opts) => {
5829
- opts = Object.assign({
5830
- cwd: process.cwd(),
5831
- path: process.env[pathKey()]
5832
- }, opts);
5833
- let prev;
5834
- let pth = path3.resolve(opts.cwd);
5835
- const ret = [];
5836
- while (prev !== pth) {
5837
- ret.push(path3.join(pth, "node_modules/.bin"));
5838
- prev = pth;
5839
- pth = path3.resolve(pth, "..");
5840
- }
5841
- ret.push(path3.dirname(process.execPath));
5842
- return ret.concat(opts.path).join(path3.delimiter);
5843
- };
5844
- module.exports.env = (opts) => {
5845
- opts = Object.assign({
5846
- env: process.env
5847
- }, opts);
5848
- const env = Object.assign({}, opts.env);
5849
- const path4 = pathKey({ env });
5850
- opts.path = env[path4];
5851
- env[path4] = module.exports(opts);
5852
- return env;
5853
- };
5854
- }
5855
- });
5856
-
5857
- // node_modules/execa/node_modules/is-stream/index.js
5858
- var require_is_stream = __commonJS({
5859
- "node_modules/execa/node_modules/is-stream/index.js"(exports, module) {
5860
- "use strict";
5861
- var isStream = module.exports = function(stream) {
5862
- return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
5863
- };
5864
- isStream.writable = function(stream) {
5865
- return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
5866
- };
5867
- isStream.readable = function(stream) {
5868
- return isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
5869
- };
5870
- isStream.duplex = function(stream) {
5871
- return isStream.writable(stream) && isStream.readable(stream);
5872
- };
5873
- isStream.transform = function(stream) {
5874
- return isStream.duplex(stream) && typeof stream._transform === "function" && typeof stream._transformState === "object";
5875
- };
5876
- }
5877
- });
5878
-
5879
- // node_modules/get-stream/buffer-stream.js
5880
- var require_buffer_stream = __commonJS({
5881
- "node_modules/get-stream/buffer-stream.js"(exports, module) {
5882
- "use strict";
5883
- var PassThrough = __require("stream").PassThrough;
5884
- module.exports = (opts) => {
5885
- opts = Object.assign({}, opts);
5886
- const array = opts.array;
5887
- let encoding = opts.encoding;
5888
- const buffer = encoding === "buffer";
5889
- let objectMode = false;
5890
- if (array) {
5891
- objectMode = !(encoding || buffer);
5892
- } else {
5893
- encoding = encoding || "utf8";
5894
- }
5895
- if (buffer) {
5896
- encoding = null;
5897
- }
5898
- let len = 0;
5899
- const ret = [];
5900
- const stream = new PassThrough({ objectMode });
5901
- if (encoding) {
5902
- stream.setEncoding(encoding);
5903
- }
5904
- stream.on("data", (chunk) => {
5905
- ret.push(chunk);
5906
- if (objectMode) {
5907
- len = ret.length;
5908
- } else {
5909
- len += chunk.length;
5910
- }
5911
- });
5912
- stream.getBufferedValue = () => {
5913
- if (array) {
5914
- return ret;
5915
- }
5916
- return buffer ? Buffer.concat(ret, len) : ret.join("");
5917
- };
5918
- stream.getBufferedLength = () => len;
5919
- return stream;
5920
- };
5921
- }
5922
- });
5923
-
5924
- // node_modules/get-stream/index.js
5925
- var require_get_stream = __commonJS({
5926
- "node_modules/get-stream/index.js"(exports, module) {
5927
- "use strict";
5928
- var bufferStream = require_buffer_stream();
5929
- function getStream(inputStream, opts) {
5930
- if (!inputStream) {
5931
- return Promise.reject(new Error("Expected a stream"));
5932
- }
5933
- opts = Object.assign({ maxBuffer: Infinity }, opts);
5934
- const maxBuffer = opts.maxBuffer;
5935
- let stream;
5936
- let clean;
5937
- const p = new Promise((resolve, reject) => {
5938
- const error = (err) => {
5939
- if (err) {
5940
- err.bufferedData = stream.getBufferedValue();
5941
- }
5942
- reject(err);
5943
- };
5944
- stream = bufferStream(opts);
5945
- inputStream.once("error", error);
5946
- inputStream.pipe(stream);
5947
- stream.on("data", () => {
5948
- if (stream.getBufferedLength() > maxBuffer) {
5949
- reject(new Error("maxBuffer exceeded"));
5950
- }
5951
- });
5952
- stream.once("error", error);
5953
- stream.on("end", resolve);
5954
- clean = () => {
5955
- if (inputStream.unpipe) {
5956
- inputStream.unpipe(stream);
5957
- }
5958
- };
5959
- });
5960
- p.then(clean, clean);
5961
- return p.then(() => stream.getBufferedValue());
5962
- }
5963
- module.exports = getStream;
5964
- module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, { encoding: "buffer" }));
5965
- module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, { array: true }));
5966
- }
5967
- });
5968
-
5969
- // node_modules/p-finally/index.js
5970
- var require_p_finally = __commonJS({
5971
- "node_modules/p-finally/index.js"(exports, module) {
5972
- "use strict";
5973
- module.exports = (promise, onFinally) => {
5974
- onFinally = onFinally || (() => {
5975
- });
5976
- return promise.then(
5977
- (val) => new Promise((resolve) => {
5978
- resolve(onFinally());
5979
- }).then(() => val),
5980
- (err) => new Promise((resolve) => {
5981
- resolve(onFinally());
5982
- }).then(() => {
5983
- throw err;
5984
- })
5985
- );
5986
- };
5987
- }
5988
- });
5989
-
5990
- // node_modules/signal-exit/signals.js
5991
- var require_signals = __commonJS({
5992
- "node_modules/signal-exit/signals.js"(exports, module) {
5993
- module.exports = [
5994
- "SIGABRT",
5995
- "SIGALRM",
5996
- "SIGHUP",
5997
- "SIGINT",
5998
- "SIGTERM"
5999
- ];
6000
- if (process.platform !== "win32") {
6001
- module.exports.push(
6002
- "SIGVTALRM",
6003
- "SIGXCPU",
6004
- "SIGXFSZ",
6005
- "SIGUSR2",
6006
- "SIGTRAP",
6007
- "SIGSYS",
6008
- "SIGQUIT",
6009
- "SIGIOT"
6010
- // should detect profiler and enable/disable accordingly.
6011
- // see #21
6012
- // 'SIGPROF'
6013
- );
6014
- }
6015
- if (process.platform === "linux") {
6016
- module.exports.push(
6017
- "SIGIO",
6018
- "SIGPOLL",
6019
- "SIGPWR",
6020
- "SIGSTKFLT",
6021
- "SIGUNUSED"
6022
- );
6023
- }
6024
- }
6025
- });
6026
-
6027
- // node_modules/signal-exit/index.js
6028
- var require_signal_exit = __commonJS({
6029
- "node_modules/signal-exit/index.js"(exports, module) {
6030
- var process2 = global.process;
6031
- var processOk = function(process3) {
6032
- return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
6033
- };
6034
- if (!processOk(process2)) {
6035
- module.exports = function() {
6036
- return function() {
6037
- };
6038
- };
6039
- } else {
6040
- assert = __require("assert");
6041
- signals = require_signals();
6042
- isWin = /^win/i.test(process2.platform);
6043
- EE = __require("events");
6044
- if (typeof EE !== "function") {
6045
- EE = EE.EventEmitter;
6046
- }
6047
- if (process2.__signal_exit_emitter__) {
6048
- emitter = process2.__signal_exit_emitter__;
6049
- } else {
6050
- emitter = process2.__signal_exit_emitter__ = new EE();
6051
- emitter.count = 0;
6052
- emitter.emitted = {};
6053
- }
6054
- if (!emitter.infinite) {
6055
- emitter.setMaxListeners(Infinity);
6056
- emitter.infinite = true;
6057
- }
6058
- module.exports = function(cb, opts) {
6059
- if (!processOk(global.process)) {
6060
- return function() {
6061
- };
6062
- }
6063
- assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
6064
- if (loaded === false) {
6065
- load();
6066
- }
6067
- var ev = "exit";
6068
- if (opts && opts.alwaysLast) {
6069
- ev = "afterexit";
6070
- }
6071
- var remove = function() {
6072
- emitter.removeListener(ev, cb);
6073
- if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
6074
- unload();
6075
- }
6076
- };
6077
- emitter.on(ev, cb);
6078
- return remove;
6079
- };
6080
- unload = function unload2() {
6081
- if (!loaded || !processOk(global.process)) {
6082
- return;
6083
- }
6084
- loaded = false;
6085
- signals.forEach(function(sig) {
6086
- try {
6087
- process2.removeListener(sig, sigListeners[sig]);
6088
- } catch (er) {
6089
- }
6090
- });
6091
- process2.emit = originalProcessEmit;
6092
- process2.reallyExit = originalProcessReallyExit;
6093
- emitter.count -= 1;
6094
- };
6095
- module.exports.unload = unload;
6096
- emit = function emit2(event, code, signal) {
6097
- if (emitter.emitted[event]) {
6098
- return;
6099
- }
6100
- emitter.emitted[event] = true;
6101
- emitter.emit(event, code, signal);
6102
- };
6103
- sigListeners = {};
6104
- signals.forEach(function(sig) {
6105
- sigListeners[sig] = function listener() {
6106
- if (!processOk(global.process)) {
6107
- return;
6108
- }
6109
- var listeners = process2.listeners(sig);
6110
- if (listeners.length === emitter.count) {
6111
- unload();
6112
- emit("exit", null, sig);
6113
- emit("afterexit", null, sig);
6114
- if (isWin && sig === "SIGHUP") {
6115
- sig = "SIGINT";
6116
- }
6117
- process2.kill(process2.pid, sig);
6118
- }
6119
- };
6120
- });
6121
- module.exports.signals = function() {
6122
- return signals;
6123
- };
6124
- loaded = false;
6125
- load = function load2() {
6126
- if (loaded || !processOk(global.process)) {
6127
- return;
6128
- }
6129
- loaded = true;
6130
- emitter.count += 1;
6131
- signals = signals.filter(function(sig) {
6132
- try {
6133
- process2.on(sig, sigListeners[sig]);
6134
- return true;
6135
- } catch (er) {
6136
- return false;
6137
- }
6138
- });
6139
- process2.emit = processEmit;
6140
- process2.reallyExit = processReallyExit;
6141
- };
6142
- module.exports.load = load;
6143
- originalProcessReallyExit = process2.reallyExit;
6144
- processReallyExit = function processReallyExit2(code) {
6145
- if (!processOk(global.process)) {
6146
- return;
6147
- }
6148
- process2.exitCode = code || /* istanbul ignore next */
6149
- 0;
6150
- emit("exit", process2.exitCode, null);
6151
- emit("afterexit", process2.exitCode, null);
6152
- originalProcessReallyExit.call(process2, process2.exitCode);
6153
- };
6154
- originalProcessEmit = process2.emit;
6155
- processEmit = function processEmit2(ev, arg) {
6156
- if (ev === "exit" && processOk(global.process)) {
6157
- if (arg !== void 0) {
6158
- process2.exitCode = arg;
6159
- }
6160
- var ret = originalProcessEmit.apply(this, arguments);
6161
- emit("exit", process2.exitCode, null);
6162
- emit("afterexit", process2.exitCode, null);
6163
- return ret;
6164
- } else {
6165
- return originalProcessEmit.apply(this, arguments);
6166
- }
6167
- };
6168
- }
6169
- var assert;
6170
- var signals;
6171
- var isWin;
6172
- var EE;
6173
- var emitter;
6174
- var unload;
6175
- var emit;
6176
- var sigListeners;
6177
- var loaded;
6178
- var load;
6179
- var originalProcessReallyExit;
6180
- var processReallyExit;
6181
- var originalProcessEmit;
6182
- var processEmit;
6183
- }
6184
- });
6185
-
6186
- // node_modules/execa/lib/errname.js
6187
- var require_errname = __commonJS({
6188
- "node_modules/execa/lib/errname.js"(exports, module) {
6189
- "use strict";
6190
- var uv;
6191
- try {
6192
- uv = process.binding("uv");
6193
- if (typeof uv.errname !== "function") {
6194
- throw new TypeError("uv.errname is not a function");
6195
- }
6196
- } catch (err) {
6197
- console.error("execa/lib/errname: unable to establish process.binding('uv')", err);
6198
- uv = null;
6199
- }
6200
- function errname(uv2, code) {
6201
- if (uv2) {
6202
- return uv2.errname(code);
6203
- }
6204
- if (!(code < 0)) {
6205
- throw new Error("err >= 0");
6206
- }
6207
- return `Unknown system error ${code}`;
6208
- }
6209
- module.exports = (code) => errname(uv, code);
6210
- module.exports.__test__ = errname;
6211
- }
6212
- });
6213
-
6214
- // node_modules/execa/index.js
6215
- var require_execa = __commonJS({
6216
- "node_modules/execa/index.js"(exports, module) {
6217
- "use strict";
6218
- var childProcess = __require("child_process");
6219
- var util = __require("util");
6220
- var crossSpawn = require_cross_spawn();
6221
- var stripEof = require_strip_eof();
6222
- var npmRunPath = require_npm_run_path();
6223
- var isStream = require_is_stream();
6224
- var _getStream = require_get_stream();
6225
- var pFinally = require_p_finally();
6226
- var onExit = require_signal_exit();
6227
- var errname = require_errname();
6228
- var TEN_MEGABYTES = 1e3 * 1e3 * 10;
6229
- function handleArgs(cmd, args, opts) {
6230
- let parsed;
6231
- if (opts && opts.__winShell === true) {
6232
- delete opts.__winShell;
6233
- parsed = {
6234
- command: cmd,
6235
- args,
6236
- options: opts,
6237
- file: cmd,
6238
- original: cmd
6239
- };
6240
- } else {
6241
- parsed = crossSpawn._parse(cmd, args, opts);
6242
- }
6243
- opts = Object.assign({
6244
- maxBuffer: TEN_MEGABYTES,
6245
- stripEof: true,
6246
- preferLocal: true,
6247
- encoding: "utf8",
6248
- reject: true,
6249
- cleanup: true
6250
- }, parsed.options);
6251
- if (opts.preferLocal) {
6252
- opts.env = npmRunPath.env(opts);
6253
- }
6254
- return {
6255
- cmd: parsed.command,
6256
- args: parsed.args,
6257
- opts,
6258
- parsed
6259
- };
6260
- }
6261
- function handleInput(spawned, opts) {
6262
- const input = opts.input;
6263
- if (input === null || input === void 0) {
6264
- return;
6265
- }
6266
- if (isStream(input)) {
6267
- input.pipe(spawned.stdin);
6268
- } else {
6269
- spawned.stdin.end(input);
6270
- }
6271
- }
6272
- function handleOutput(opts, val) {
6273
- if (val && opts.stripEof) {
6274
- val = stripEof(val);
6275
- }
6276
- return val;
6277
- }
6278
- function handleShell(fn, cmd, opts) {
6279
- let file = "/bin/sh";
6280
- let args = ["-c", cmd];
6281
- opts = Object.assign({}, opts);
6282
- if (process.platform === "win32") {
6283
- opts.__winShell = true;
6284
- file = process.env.comspec || "cmd.exe";
6285
- args = ["/s", "/c", `"${cmd}"`];
6286
- opts.windowsVerbatimArguments = true;
6287
- }
6288
- if (opts.shell) {
6289
- file = opts.shell;
6290
- delete opts.shell;
6291
- }
6292
- return fn(file, args, opts);
6293
- }
6294
- function getStream(process2, stream, encoding, maxBuffer) {
6295
- if (!process2[stream]) {
6296
- return null;
6297
- }
6298
- let ret;
6299
- if (encoding) {
6300
- ret = _getStream(process2[stream], {
6301
- encoding,
6302
- maxBuffer
6303
- });
6304
- } else {
6305
- ret = _getStream.buffer(process2[stream], { maxBuffer });
6306
- }
6307
- return ret.catch((err) => {
6308
- err.stream = stream;
6309
- err.message = `${stream} ${err.message}`;
6310
- throw err;
6311
- });
6312
- }
6313
- module.exports = (cmd, args, opts) => {
6314
- let joinedCmd = cmd;
6315
- if (Array.isArray(args) && args.length > 0) {
6316
- joinedCmd += " " + args.join(" ");
6317
- }
6318
- const parsed = handleArgs(cmd, args, opts);
6319
- const encoding = parsed.opts.encoding;
6320
- const maxBuffer = parsed.opts.maxBuffer;
6321
- let spawned;
6322
- try {
6323
- spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
6324
- } catch (err) {
6325
- return Promise.reject(err);
6326
- }
6327
- let removeExitHandler;
6328
- if (parsed.opts.cleanup) {
6329
- removeExitHandler = onExit(() => {
6330
- spawned.kill();
6331
- });
6332
- }
6333
- let timeoutId = null;
6334
- let timedOut = false;
6335
- const cleanupTimeout = () => {
6336
- if (timeoutId) {
6337
- clearTimeout(timeoutId);
6338
- timeoutId = null;
6339
- }
6340
- };
6341
- if (parsed.opts.timeout > 0) {
6342
- timeoutId = setTimeout(() => {
6343
- timeoutId = null;
6344
- timedOut = true;
6345
- spawned.kill(parsed.killSignal);
6346
- }, parsed.opts.timeout);
6347
- }
6348
- const processDone = new Promise((resolve) => {
6349
- spawned.on("exit", (code, signal) => {
6350
- cleanupTimeout();
6351
- resolve({ code, signal });
6352
- });
6353
- spawned.on("error", (err) => {
6354
- cleanupTimeout();
6355
- resolve({ err });
6356
- });
6357
- if (spawned.stdin) {
6358
- spawned.stdin.on("error", (err) => {
6359
- cleanupTimeout();
6360
- resolve({ err });
6361
- });
6362
- }
6363
- });
6364
- function destroy() {
6365
- if (spawned.stdout) {
6366
- spawned.stdout.destroy();
6367
- }
6368
- if (spawned.stderr) {
6369
- spawned.stderr.destroy();
6370
- }
6371
- }
6372
- const promise = pFinally(Promise.all([
6373
- processDone,
6374
- getStream(spawned, "stdout", encoding, maxBuffer),
6375
- getStream(spawned, "stderr", encoding, maxBuffer)
6376
- ]).then((arr) => {
6377
- const result = arr[0];
6378
- const stdout = arr[1];
6379
- const stderr = arr[2];
6380
- let err = result.err;
6381
- const code = result.code;
6382
- const signal = result.signal;
6383
- if (removeExitHandler) {
6384
- removeExitHandler();
6385
- }
6386
- if (err || code !== 0 || signal !== null) {
6387
- if (!err) {
6388
- const output = parsed.opts.stdio === "inherit" ? "" : `
6389
- ${stderr}${stdout}`;
6390
- err = new Error(`Command failed: ${joinedCmd}${output}`);
6391
- err.code = code < 0 ? errname(code) : code;
6392
- }
6393
- err.killed = err.killed || spawned.killed;
6394
- err.stdout = stdout;
6395
- err.stderr = stderr;
6396
- err.failed = true;
6397
- err.signal = signal || null;
6398
- err.cmd = joinedCmd;
6399
- err.timedOut = timedOut;
6400
- if (!parsed.opts.reject) {
6401
- return err;
6402
- }
6403
- throw err;
6404
- }
6405
- return {
6406
- stdout: handleOutput(parsed.opts, stdout),
6407
- stderr: handleOutput(parsed.opts, stderr),
6408
- code: 0,
6409
- failed: false,
6410
- killed: false,
6411
- signal: null,
6412
- cmd: joinedCmd,
6413
- timedOut: false
6414
- };
6415
- }), destroy);
6416
- crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
6417
- handleInput(spawned, parsed.opts);
6418
- spawned.then = promise.then.bind(promise);
6419
- spawned.catch = promise.catch.bind(promise);
6420
- return spawned;
6421
- };
6422
- module.exports.stdout = function() {
6423
- return module.exports.apply(null, arguments).then((x) => x.stdout);
6424
- };
6425
- module.exports.stderr = function() {
6426
- return module.exports.apply(null, arguments).then((x) => x.stderr);
6427
- };
6428
- module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
6429
- module.exports.sync = (cmd, args, opts) => {
6430
- const parsed = handleArgs(cmd, args, opts);
6431
- if (isStream(parsed.opts.input)) {
6432
- throw new TypeError("The `input` option cannot be a stream in sync mode");
6433
- }
6434
- const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
6435
- if (result.error || result.status !== 0) {
6436
- throw result.error || new Error(result.stderr === "" ? result.stdout : result.stderr);
6437
- }
6438
- result.stdout = handleOutput(parsed.opts, result.stdout);
6439
- result.stderr = handleOutput(parsed.opts, result.stderr);
6440
- return result;
6441
- };
6442
- module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
6443
- module.exports.spawn = util.deprecate(module.exports, "execa.spawn() is deprecated. Use execa() instead.");
6444
- }
6445
- });
6446
-
6447
- // node_modules/path-is-absolute/index.js
6448
- var require_path_is_absolute = __commonJS({
6449
- "node_modules/path-is-absolute/index.js"(exports, module) {
6450
- "use strict";
6451
- function posix(path3) {
6452
- return path3.charAt(0) === "/";
6453
- }
6454
- function win32(path3) {
6455
- var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
6456
- var result = splitDeviceRe.exec(path3);
6457
- var device = result[1] || "";
6458
- var isUnc = Boolean(device && device.charAt(1) !== ":");
6459
- return Boolean(result[2] || isUnc);
6460
- }
6461
- module.exports = process.platform === "win32" ? win32 : posix;
6462
- module.exports.posix = posix;
6463
- module.exports.win32 = win32;
6464
- }
6465
- });
6466
-
6467
- // node_modules/is-git-repository/build.js
6468
- var require_build = __commonJS({
6469
- "node_modules/is-git-repository/build.js"(exports, module) {
6470
- "use strict";
6471
- Object.defineProperty(exports, "__esModule", {
6472
- value: true
6473
- });
6474
- var _execa = require_execa();
6475
- var _execa2 = _interopRequireDefault(_execa);
6476
- var _os = __require("os");
6477
- var _path = __require("path");
6478
- var _path2 = _interopRequireDefault(_path);
6479
- var _pathIsAbsolute = require_path_is_absolute();
6480
- var _pathIsAbsolute2 = _interopRequireDefault(_pathIsAbsolute);
6481
- function _interopRequireDefault(obj) {
6482
- return obj && obj.__esModule ? obj : { default: obj };
6483
- }
6484
- var cwd = process.cwd();
6485
- var isGit = function isGit2() {
6486
- var altPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : cwd;
6487
- var thisPath = (0, _pathIsAbsolute2.default)(altPath) ? altPath : _path2.default.join(cwd, altPath);
6488
- try {
6489
- if ((0, _os.platform)() === "win32") {
6490
- _execa2.default.shellSync("pushd " + thisPath + " & git status");
6491
- } else {
6492
- _execa2.default.shellSync("(cd " + thisPath + " ; ([ -d .git ] && echo .git) || git rev-parse --git-dir 2> /dev/null)");
6493
- }
6494
- return true;
6495
- } catch (e) {
6496
- return false;
6497
- }
6498
- };
6499
- exports.default = isGit;
6500
- module.exports = exports["default"];
6501
- }
6502
- });
6503
-
6504
- // node_modules/current-git-branch/build.js
6505
- var require_build2 = __commonJS({
6506
- "node_modules/current-git-branch/build.js"(exports, module) {
6507
- "use strict";
6508
- Object.defineProperty(exports, "__esModule", {
6509
- value: true
6510
- });
6511
- var _os = __require("os");
6512
- var _execa = require_execa();
6513
- var _execa2 = _interopRequireDefault(_execa);
6514
- var _isGitRepository = require_build();
6515
- var _isGitRepository2 = _interopRequireDefault(_isGitRepository);
6516
- function _interopRequireDefault(obj) {
6517
- return obj && obj.__esModule ? obj : { default: obj };
6518
- }
6519
- var cwd = process.cwd();
6520
- var defaultOptions = {
6521
- altPath: cwd,
6522
- branchOptions: null
6523
- };
6524
- var isGitAdded = function isGitAdded2() {
6525
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultOptions;
6526
- var stdout = void 0;
6527
- if (!(0, _isGitRepository2.default)(options.altPath)) {
6528
- return false;
6529
- }
6530
- var branchOptions = options.branchOptions && Array.isArray(options.branchOptions) ? options.branchOptions.join(" ") : options.branchOptions || "";
6531
- try {
6532
- var cmd = "";
6533
- if ((0, _os.platform)() === "win32") {
6534
- cmd = "pushd " + (options.altPath || cwd) + " & git branch " + branchOptions + " | findstr \\*";
6535
- } else {
6536
- cmd = "(cd " + (options.altPath || cwd) + " ; git branch " + branchOptions + " | grep \\*)";
6537
- }
6538
- stdout = _execa2.default.shellSync(cmd).stdout;
6539
- } catch (e) {
6540
- return false;
6541
- }
6542
- var branchName = stdout.slice(2, stdout.length);
6543
- return branchName;
6544
- };
6545
- exports.default = isGitAdded;
6546
- module.exports = exports["default"];
6547
- }
6548
- });
6549
-
6550
4408
  // node_modules/dotenv/config.js
6551
4409
  (function() {
6552
4410
  require_main().config(
@@ -6559,6 +4417,7 @@ ${stderr}${stdout}`;
6559
4417
  })();
6560
4418
 
6561
4419
  // bin/release.ts
4420
+ var import_child_process = __require("child_process");
6562
4421
  var fs2 = __toESM(__require("fs"));
6563
4422
  var import_moment = __toESM(require_moment());
6564
4423
  var path2 = __toESM(__require("path"));
@@ -9795,7 +7654,7 @@ ${stderr}${stdout}`;
9795
7654
  var dryRun = !ContinuousIntegration.service;
9796
7655
  if (dryRun) {
9797
7656
  console.log("Not running on CI service, switching to dry-run mode");
9798
- ContinuousIntegration.branch = require_build2()();
7657
+ ContinuousIntegration.branch = (0, import_child_process.execSync)("git rev-parse --abbrev-ref HEAD", { encoding: "utf8" }).trim();
9799
7658
  }
9800
7659
  function report(msg) {
9801
7660
  console.log(`${dryRun ? "dry-run: " : ""}${msg}`);