@stacksjs/buddy 0.58.71 → 0.58.73
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.
- package/dist/chunk-1a569f35f66ae151.js +10945 -0
- package/dist/{chunk-59a9de11428ba763.js → chunk-bf054cfbc9cf2201.js} +4 -4
- package/dist/cli.js +42 -3916
- package/dist/index.js +8 -2
- package/dist/stacks +0 -0
- package/package.json +3 -3
- package/src/cli.ts +35 -87
- package/src/commands/check.ts +45 -0
- package/src/commands/create.ts +6 -0
- package/src/commands/generate.ts +10 -0
- package/src/commands/index.ts +3 -0
- package/src/commands/ports.ts +73 -0
- package/src/commands/projects.ts +59 -0
- package/src/commands/setup.ts +9 -54
- package/src/commands/upgrade.ts +51 -4
- package/dist/chunk-89229d657386eb70.js +0 -1932
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
+
CAC,
|
|
3
4
|
build,
|
|
4
5
|
changelog,
|
|
6
|
+
check,
|
|
5
7
|
clean,
|
|
6
8
|
cloud,
|
|
7
9
|
configure,
|
|
@@ -16,3893 +18,22 @@ install,
|
|
|
16
18
|
key,
|
|
17
19
|
lint,
|
|
18
20
|
list,
|
|
21
|
+
ports,
|
|
22
|
+
projects,
|
|
19
23
|
release,
|
|
20
24
|
setup,
|
|
21
|
-
upgrade
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} from "./chunk-0455e53fab4244b1.js";
|
|
27
|
-
import"./chunk-59a9de11428ba763.js";
|
|
28
|
-
|
|
29
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/symbol.iterator.js
|
|
30
|
-
var require_symbol_iterator = __commonJS((exports, module) => {
|
|
31
|
-
module.exports = function SymbolIterator() {
|
|
32
|
-
var _this = this;
|
|
33
|
-
var index = -1;
|
|
34
|
-
return {
|
|
35
|
-
next: function next() {
|
|
36
|
-
index += 1;
|
|
37
|
-
return {
|
|
38
|
-
value: _this.items[index],
|
|
39
|
-
done: index >= _this.items.length
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/all.js
|
|
47
|
-
var require_all = __commonJS((exports, module) => {
|
|
48
|
-
module.exports = function all() {
|
|
49
|
-
return this.items;
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/helpers/is.js
|
|
54
|
-
var require_is = __commonJS((exports, module) => {
|
|
55
|
-
var _typeof = function(obj) {
|
|
56
|
-
"@babel/helpers - typeof";
|
|
57
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
58
|
-
return typeof obj2;
|
|
59
|
-
} : function(obj2) {
|
|
60
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
61
|
-
}, _typeof(obj);
|
|
62
|
-
};
|
|
63
|
-
module.exports = {
|
|
64
|
-
isArray: function isArray(item) {
|
|
65
|
-
return Array.isArray(item);
|
|
66
|
-
},
|
|
67
|
-
isObject: function isObject(item) {
|
|
68
|
-
return _typeof(item) === "object" && Array.isArray(item) === false && item !== null;
|
|
69
|
-
},
|
|
70
|
-
isFunction: function isFunction(item) {
|
|
71
|
-
return typeof item === "function";
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/average.js
|
|
77
|
-
var require_average = __commonJS((exports, module) => {
|
|
78
|
-
var _require = require_is();
|
|
79
|
-
var isFunction = _require.isFunction;
|
|
80
|
-
module.exports = function average(key2) {
|
|
81
|
-
if (key2 === undefined) {
|
|
82
|
-
return this.sum() / this.items.length;
|
|
83
|
-
}
|
|
84
|
-
if (isFunction(key2)) {
|
|
85
|
-
return new this.constructor(this.items).sum(key2) / this.items.length;
|
|
86
|
-
}
|
|
87
|
-
return new this.constructor(this.items).pluck(key2).sum() / this.items.length;
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/avg.js
|
|
92
|
-
var require_avg = __commonJS((exports, module) => {
|
|
93
|
-
var average = require_average();
|
|
94
|
-
module.exports = average;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/chunk.js
|
|
98
|
-
var require_chunk = __commonJS((exports, module) => {
|
|
99
|
-
var _typeof = function(obj) {
|
|
100
|
-
"@babel/helpers - typeof";
|
|
101
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
102
|
-
return typeof obj2;
|
|
103
|
-
} : function(obj2) {
|
|
104
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
105
|
-
}, _typeof(obj);
|
|
106
|
-
};
|
|
107
|
-
module.exports = function chunk(size) {
|
|
108
|
-
var _this = this;
|
|
109
|
-
var chunks = [];
|
|
110
|
-
var index = 0;
|
|
111
|
-
if (Array.isArray(this.items)) {
|
|
112
|
-
do {
|
|
113
|
-
var items = this.items.slice(index, index + size);
|
|
114
|
-
var collection = new this.constructor(items);
|
|
115
|
-
chunks.push(collection);
|
|
116
|
-
index += size;
|
|
117
|
-
} while (index < this.items.length);
|
|
118
|
-
} else if (_typeof(this.items) === "object") {
|
|
119
|
-
var keys = Object.keys(this.items);
|
|
120
|
-
var _loop = function _loop() {
|
|
121
|
-
var keysOfChunk = keys.slice(index, index + size);
|
|
122
|
-
var collection2 = new _this.constructor({});
|
|
123
|
-
keysOfChunk.forEach(function(key2) {
|
|
124
|
-
return collection2.put(key2, _this.items[key2]);
|
|
125
|
-
});
|
|
126
|
-
chunks.push(collection2);
|
|
127
|
-
index += size;
|
|
128
|
-
};
|
|
129
|
-
do {
|
|
130
|
-
_loop();
|
|
131
|
-
} while (index < keys.length);
|
|
132
|
-
} else {
|
|
133
|
-
chunks.push(new this.constructor([this.items]));
|
|
134
|
-
}
|
|
135
|
-
return new this.constructor(chunks);
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/collapse.js
|
|
140
|
-
var require_collapse = __commonJS((exports, module) => {
|
|
141
|
-
var _toConsumableArray = function(arr) {
|
|
142
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
143
|
-
};
|
|
144
|
-
var _nonIterableSpread = function() {
|
|
145
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
146
|
-
};
|
|
147
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
148
|
-
if (!o)
|
|
149
|
-
return;
|
|
150
|
-
if (typeof o === "string")
|
|
151
|
-
return _arrayLikeToArray(o, minLen);
|
|
152
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
153
|
-
if (n === "Object" && o.constructor)
|
|
154
|
-
n = o.constructor.name;
|
|
155
|
-
if (n === "Map" || n === "Set")
|
|
156
|
-
return Array.from(o);
|
|
157
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
158
|
-
return _arrayLikeToArray(o, minLen);
|
|
159
|
-
};
|
|
160
|
-
var _iterableToArray = function(iter) {
|
|
161
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
162
|
-
return Array.from(iter);
|
|
163
|
-
};
|
|
164
|
-
var _arrayWithoutHoles = function(arr) {
|
|
165
|
-
if (Array.isArray(arr))
|
|
166
|
-
return _arrayLikeToArray(arr);
|
|
167
|
-
};
|
|
168
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
169
|
-
if (len == null || len > arr.length)
|
|
170
|
-
len = arr.length;
|
|
171
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
172
|
-
arr2[i] = arr[i];
|
|
173
|
-
}
|
|
174
|
-
return arr2;
|
|
175
|
-
};
|
|
176
|
-
module.exports = function collapse() {
|
|
177
|
-
var _ref;
|
|
178
|
-
return new this.constructor((_ref = []).concat.apply(_ref, _toConsumableArray(this.items)));
|
|
179
|
-
};
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/combine.js
|
|
183
|
-
var require_combine = __commonJS((exports, module) => {
|
|
184
|
-
var _slicedToArray = function(arr, i) {
|
|
185
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
186
|
-
};
|
|
187
|
-
var _nonIterableRest = function() {
|
|
188
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
189
|
-
};
|
|
190
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
191
|
-
if (!o)
|
|
192
|
-
return;
|
|
193
|
-
if (typeof o === "string")
|
|
194
|
-
return _arrayLikeToArray(o, minLen);
|
|
195
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
196
|
-
if (n === "Object" && o.constructor)
|
|
197
|
-
n = o.constructor.name;
|
|
198
|
-
if (n === "Map" || n === "Set")
|
|
199
|
-
return Array.from(o);
|
|
200
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
201
|
-
return _arrayLikeToArray(o, minLen);
|
|
202
|
-
};
|
|
203
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
204
|
-
if (len == null || len > arr.length)
|
|
205
|
-
len = arr.length;
|
|
206
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
207
|
-
arr2[i] = arr[i];
|
|
208
|
-
}
|
|
209
|
-
return arr2;
|
|
210
|
-
};
|
|
211
|
-
var _iterableToArrayLimit = function(arr, i) {
|
|
212
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
213
|
-
if (_i == null)
|
|
214
|
-
return;
|
|
215
|
-
var _arr = [];
|
|
216
|
-
var _n = true;
|
|
217
|
-
var _d = false;
|
|
218
|
-
var _s, _e;
|
|
219
|
-
try {
|
|
220
|
-
for (_i = _i.call(arr);!(_n = (_s = _i.next()).done); _n = true) {
|
|
221
|
-
_arr.push(_s.value);
|
|
222
|
-
if (i && _arr.length === i)
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
} catch (err) {
|
|
226
|
-
_d = true;
|
|
227
|
-
_e = err;
|
|
228
|
-
} finally {
|
|
229
|
-
try {
|
|
230
|
-
if (!_n && _i["return"] != null)
|
|
231
|
-
_i["return"]();
|
|
232
|
-
} finally {
|
|
233
|
-
if (_d)
|
|
234
|
-
throw _e;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return _arr;
|
|
238
|
-
};
|
|
239
|
-
var _arrayWithHoles = function(arr) {
|
|
240
|
-
if (Array.isArray(arr))
|
|
241
|
-
return arr;
|
|
242
|
-
};
|
|
243
|
-
var _typeof = function(obj) {
|
|
244
|
-
"@babel/helpers - typeof";
|
|
245
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
246
|
-
return typeof obj2;
|
|
247
|
-
} : function(obj2) {
|
|
248
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
249
|
-
}, _typeof(obj);
|
|
250
|
-
};
|
|
251
|
-
module.exports = function combine(array) {
|
|
252
|
-
var _this = this;
|
|
253
|
-
var values = array;
|
|
254
|
-
if (values instanceof this.constructor) {
|
|
255
|
-
values = array.all();
|
|
256
|
-
}
|
|
257
|
-
var collection = {};
|
|
258
|
-
if (Array.isArray(this.items) && Array.isArray(values)) {
|
|
259
|
-
this.items.forEach(function(key2, iterator) {
|
|
260
|
-
collection[key2] = values[iterator];
|
|
261
|
-
});
|
|
262
|
-
} else if (_typeof(this.items) === "object" && _typeof(values) === "object") {
|
|
263
|
-
Object.keys(this.items).forEach(function(key2, index) {
|
|
264
|
-
collection[_this.items[key2]] = values[Object.keys(values)[index]];
|
|
265
|
-
});
|
|
266
|
-
} else if (Array.isArray(this.items)) {
|
|
267
|
-
collection[this.items[0]] = values;
|
|
268
|
-
} else if (typeof this.items === "string" && Array.isArray(values)) {
|
|
269
|
-
var _values = values;
|
|
270
|
-
var _values2 = _slicedToArray(_values, 1);
|
|
271
|
-
collection[this.items] = _values2[0];
|
|
272
|
-
} else if (typeof this.items === "string") {
|
|
273
|
-
collection[this.items] = values;
|
|
274
|
-
}
|
|
275
|
-
return new this.constructor(collection);
|
|
276
|
-
};
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/helpers/clone.js
|
|
280
|
-
var require_clone = __commonJS((exports, module) => {
|
|
281
|
-
var _toConsumableArray = function(arr) {
|
|
282
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
283
|
-
};
|
|
284
|
-
var _nonIterableSpread = function() {
|
|
285
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
286
|
-
};
|
|
287
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
288
|
-
if (!o)
|
|
289
|
-
return;
|
|
290
|
-
if (typeof o === "string")
|
|
291
|
-
return _arrayLikeToArray(o, minLen);
|
|
292
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
293
|
-
if (n === "Object" && o.constructor)
|
|
294
|
-
n = o.constructor.name;
|
|
295
|
-
if (n === "Map" || n === "Set")
|
|
296
|
-
return Array.from(o);
|
|
297
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
298
|
-
return _arrayLikeToArray(o, minLen);
|
|
299
|
-
};
|
|
300
|
-
var _iterableToArray = function(iter) {
|
|
301
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
302
|
-
return Array.from(iter);
|
|
303
|
-
};
|
|
304
|
-
var _arrayWithoutHoles = function(arr) {
|
|
305
|
-
if (Array.isArray(arr))
|
|
306
|
-
return _arrayLikeToArray(arr);
|
|
307
|
-
};
|
|
308
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
309
|
-
if (len == null || len > arr.length)
|
|
310
|
-
len = arr.length;
|
|
311
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
312
|
-
arr2[i] = arr[i];
|
|
313
|
-
}
|
|
314
|
-
return arr2;
|
|
315
|
-
};
|
|
316
|
-
module.exports = function clone(items) {
|
|
317
|
-
var cloned;
|
|
318
|
-
if (Array.isArray(items)) {
|
|
319
|
-
var _cloned;
|
|
320
|
-
cloned = [];
|
|
321
|
-
(_cloned = cloned).push.apply(_cloned, _toConsumableArray(items));
|
|
322
|
-
} else {
|
|
323
|
-
cloned = {};
|
|
324
|
-
Object.keys(items).forEach(function(prop) {
|
|
325
|
-
cloned[prop] = items[prop];
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
return cloned;
|
|
329
|
-
};
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/concat.js
|
|
333
|
-
var require_concat = __commonJS((exports, module) => {
|
|
334
|
-
var _typeof = function(obj) {
|
|
335
|
-
"@babel/helpers - typeof";
|
|
336
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
337
|
-
return typeof obj2;
|
|
338
|
-
} : function(obj2) {
|
|
339
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
340
|
-
}, _typeof(obj);
|
|
341
|
-
};
|
|
342
|
-
var clone = require_clone();
|
|
343
|
-
module.exports = function concat(collectionOrArrayOrObject) {
|
|
344
|
-
var list2 = collectionOrArrayOrObject;
|
|
345
|
-
if (collectionOrArrayOrObject instanceof this.constructor) {
|
|
346
|
-
list2 = collectionOrArrayOrObject.all();
|
|
347
|
-
} else if (_typeof(collectionOrArrayOrObject) === "object") {
|
|
348
|
-
list2 = [];
|
|
349
|
-
Object.keys(collectionOrArrayOrObject).forEach(function(property) {
|
|
350
|
-
list2.push(collectionOrArrayOrObject[property]);
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
var collection = clone(this.items);
|
|
354
|
-
list2.forEach(function(item) {
|
|
355
|
-
if (_typeof(item) === "object") {
|
|
356
|
-
Object.keys(item).forEach(function(key2) {
|
|
357
|
-
return collection.push(item[key2]);
|
|
358
|
-
});
|
|
359
|
-
} else {
|
|
360
|
-
collection.push(item);
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
return new this.constructor(collection);
|
|
364
|
-
};
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/helpers/values.js
|
|
368
|
-
var require_values = __commonJS((exports, module) => {
|
|
369
|
-
var _toConsumableArray = function(arr) {
|
|
370
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
371
|
-
};
|
|
372
|
-
var _nonIterableSpread = function() {
|
|
373
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
374
|
-
};
|
|
375
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
376
|
-
if (!o)
|
|
377
|
-
return;
|
|
378
|
-
if (typeof o === "string")
|
|
379
|
-
return _arrayLikeToArray(o, minLen);
|
|
380
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
381
|
-
if (n === "Object" && o.constructor)
|
|
382
|
-
n = o.constructor.name;
|
|
383
|
-
if (n === "Map" || n === "Set")
|
|
384
|
-
return Array.from(o);
|
|
385
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
386
|
-
return _arrayLikeToArray(o, minLen);
|
|
387
|
-
};
|
|
388
|
-
var _iterableToArray = function(iter) {
|
|
389
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
390
|
-
return Array.from(iter);
|
|
391
|
-
};
|
|
392
|
-
var _arrayWithoutHoles = function(arr) {
|
|
393
|
-
if (Array.isArray(arr))
|
|
394
|
-
return _arrayLikeToArray(arr);
|
|
395
|
-
};
|
|
396
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
397
|
-
if (len == null || len > arr.length)
|
|
398
|
-
len = arr.length;
|
|
399
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
400
|
-
arr2[i] = arr[i];
|
|
401
|
-
}
|
|
402
|
-
return arr2;
|
|
403
|
-
};
|
|
404
|
-
module.exports = function values(items) {
|
|
405
|
-
var valuesArray = [];
|
|
406
|
-
if (Array.isArray(items)) {
|
|
407
|
-
valuesArray.push.apply(valuesArray, _toConsumableArray(items));
|
|
408
|
-
} else if (items.constructor.name === "Collection") {
|
|
409
|
-
valuesArray.push.apply(valuesArray, _toConsumableArray(items.all()));
|
|
410
|
-
} else {
|
|
411
|
-
Object.keys(items).forEach(function(prop) {
|
|
412
|
-
return valuesArray.push(items[prop]);
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
return valuesArray;
|
|
416
|
-
};
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/contains.js
|
|
420
|
-
var require_contains = __commonJS((exports, module) => {
|
|
421
|
-
var _toConsumableArray = function(arr) {
|
|
422
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
423
|
-
};
|
|
424
|
-
var _nonIterableSpread = function() {
|
|
425
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
426
|
-
};
|
|
427
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
428
|
-
if (!o)
|
|
429
|
-
return;
|
|
430
|
-
if (typeof o === "string")
|
|
431
|
-
return _arrayLikeToArray(o, minLen);
|
|
432
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
433
|
-
if (n === "Object" && o.constructor)
|
|
434
|
-
n = o.constructor.name;
|
|
435
|
-
if (n === "Map" || n === "Set")
|
|
436
|
-
return Array.from(o);
|
|
437
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
438
|
-
return _arrayLikeToArray(o, minLen);
|
|
439
|
-
};
|
|
440
|
-
var _iterableToArray = function(iter) {
|
|
441
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
442
|
-
return Array.from(iter);
|
|
443
|
-
};
|
|
444
|
-
var _arrayWithoutHoles = function(arr) {
|
|
445
|
-
if (Array.isArray(arr))
|
|
446
|
-
return _arrayLikeToArray(arr);
|
|
447
|
-
};
|
|
448
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
449
|
-
if (len == null || len > arr.length)
|
|
450
|
-
len = arr.length;
|
|
451
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
452
|
-
arr2[i] = arr[i];
|
|
453
|
-
}
|
|
454
|
-
return arr2;
|
|
455
|
-
};
|
|
456
|
-
var values = require_values();
|
|
457
|
-
var _require = require_is();
|
|
458
|
-
var isFunction = _require.isFunction;
|
|
459
|
-
module.exports = function contains(key2, value) {
|
|
460
|
-
if (value !== undefined) {
|
|
461
|
-
if (Array.isArray(this.items)) {
|
|
462
|
-
return this.items.filter(function(items) {
|
|
463
|
-
return items[key2] !== undefined && items[key2] === value;
|
|
464
|
-
}).length > 0;
|
|
465
|
-
}
|
|
466
|
-
return this.items[key2] !== undefined && this.items[key2] === value;
|
|
467
|
-
}
|
|
468
|
-
if (isFunction(key2)) {
|
|
469
|
-
return this.items.filter(function(item, index) {
|
|
470
|
-
return key2(item, index);
|
|
471
|
-
}).length > 0;
|
|
472
|
-
}
|
|
473
|
-
if (Array.isArray(this.items)) {
|
|
474
|
-
return this.items.indexOf(key2) !== -1;
|
|
475
|
-
}
|
|
476
|
-
var keysAndValues = values(this.items);
|
|
477
|
-
keysAndValues.push.apply(keysAndValues, _toConsumableArray(Object.keys(this.items)));
|
|
478
|
-
return keysAndValues.indexOf(key2) !== -1;
|
|
479
|
-
};
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/containsOneItem.js
|
|
483
|
-
var require_containsOneItem = __commonJS((exports, module) => {
|
|
484
|
-
module.exports = function containsOneItem() {
|
|
485
|
-
return this.count() === 1;
|
|
486
|
-
};
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/count.js
|
|
490
|
-
var require_count = __commonJS((exports, module) => {
|
|
491
|
-
module.exports = function count() {
|
|
492
|
-
var arrayLength = 0;
|
|
493
|
-
if (Array.isArray(this.items)) {
|
|
494
|
-
arrayLength = this.items.length;
|
|
495
|
-
}
|
|
496
|
-
return Math.max(Object.keys(this.items).length, arrayLength);
|
|
497
|
-
};
|
|
498
|
-
});
|
|
499
|
-
|
|
500
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/countBy.js
|
|
501
|
-
var require_countBy = __commonJS((exports, module) => {
|
|
502
|
-
module.exports = function countBy() {
|
|
503
|
-
var fn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function(value) {
|
|
504
|
-
return value;
|
|
505
|
-
};
|
|
506
|
-
return new this.constructor(this.items).groupBy(fn).map(function(value) {
|
|
507
|
-
return value.count();
|
|
508
|
-
});
|
|
509
|
-
};
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/crossJoin.js
|
|
513
|
-
var require_crossJoin = __commonJS((exports, module) => {
|
|
514
|
-
module.exports = function crossJoin() {
|
|
515
|
-
function join(collection, constructor, args) {
|
|
516
|
-
var current = args[0];
|
|
517
|
-
if (current instanceof constructor) {
|
|
518
|
-
current = current.all();
|
|
519
|
-
}
|
|
520
|
-
var rest = args.slice(1);
|
|
521
|
-
var last = !rest.length;
|
|
522
|
-
var result = [];
|
|
523
|
-
for (var i = 0;i < current.length; i += 1) {
|
|
524
|
-
var collectionCopy = collection.slice();
|
|
525
|
-
collectionCopy.push(current[i]);
|
|
526
|
-
if (last) {
|
|
527
|
-
result.push(collectionCopy);
|
|
528
|
-
} else {
|
|
529
|
-
result = result.concat(join(collectionCopy, constructor, rest));
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
return result;
|
|
533
|
-
}
|
|
534
|
-
for (var _len = arguments.length, values = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
535
|
-
values[_key] = arguments[_key];
|
|
536
|
-
}
|
|
537
|
-
return new this.constructor(join([], this.constructor, [].concat([this.items], values)));
|
|
538
|
-
};
|
|
539
|
-
});
|
|
540
|
-
|
|
541
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/dd.js
|
|
542
|
-
var require_dd = __commonJS((exports, module) => {
|
|
543
|
-
module.exports = function dd() {
|
|
544
|
-
this.dump();
|
|
545
|
-
if (typeof process !== "undefined") {
|
|
546
|
-
process.exit(1);
|
|
547
|
-
}
|
|
548
|
-
};
|
|
549
|
-
});
|
|
550
|
-
|
|
551
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/diff.js
|
|
552
|
-
var require_diff = __commonJS((exports, module) => {
|
|
553
|
-
module.exports = function diff(values) {
|
|
554
|
-
var valuesToDiff;
|
|
555
|
-
if (values instanceof this.constructor) {
|
|
556
|
-
valuesToDiff = values.all();
|
|
557
|
-
} else {
|
|
558
|
-
valuesToDiff = values;
|
|
559
|
-
}
|
|
560
|
-
var collection = this.items.filter(function(item) {
|
|
561
|
-
return valuesToDiff.indexOf(item) === -1;
|
|
562
|
-
});
|
|
563
|
-
return new this.constructor(collection);
|
|
564
|
-
};
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/diffAssoc.js
|
|
568
|
-
var require_diffAssoc = __commonJS((exports, module) => {
|
|
569
|
-
module.exports = function diffAssoc(values) {
|
|
570
|
-
var _this = this;
|
|
571
|
-
var diffValues = values;
|
|
572
|
-
if (values instanceof this.constructor) {
|
|
573
|
-
diffValues = values.all();
|
|
574
|
-
}
|
|
575
|
-
var collection = {};
|
|
576
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
577
|
-
if (diffValues[key2] === undefined || diffValues[key2] !== _this.items[key2]) {
|
|
578
|
-
collection[key2] = _this.items[key2];
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
return new this.constructor(collection);
|
|
582
|
-
};
|
|
583
|
-
});
|
|
584
|
-
|
|
585
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/diffKeys.js
|
|
586
|
-
var require_diffKeys = __commonJS((exports, module) => {
|
|
587
|
-
module.exports = function diffKeys(object) {
|
|
588
|
-
var objectToDiff;
|
|
589
|
-
if (object instanceof this.constructor) {
|
|
590
|
-
objectToDiff = object.all();
|
|
591
|
-
} else {
|
|
592
|
-
objectToDiff = object;
|
|
593
|
-
}
|
|
594
|
-
var objectKeys = Object.keys(objectToDiff);
|
|
595
|
-
var remainingKeys = Object.keys(this.items).filter(function(item) {
|
|
596
|
-
return objectKeys.indexOf(item) === -1;
|
|
597
|
-
});
|
|
598
|
-
return new this.constructor(this.items).only(remainingKeys);
|
|
599
|
-
};
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/diffUsing.js
|
|
603
|
-
var require_diffUsing = __commonJS((exports, module) => {
|
|
604
|
-
module.exports = function diffUsing(values, callback) {
|
|
605
|
-
var collection = this.items.filter(function(item) {
|
|
606
|
-
return !(values && values.some(function(otherItem) {
|
|
607
|
-
return callback(item, otherItem) === 0;
|
|
608
|
-
}));
|
|
609
|
-
});
|
|
610
|
-
return new this.constructor(collection);
|
|
611
|
-
};
|
|
612
|
-
});
|
|
613
|
-
|
|
614
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/doesntContain.js
|
|
615
|
-
var require_doesntContain = __commonJS((exports, module) => {
|
|
616
|
-
module.exports = function contains(key2, value) {
|
|
617
|
-
return !this.contains(key2, value);
|
|
618
|
-
};
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/dump.js
|
|
622
|
-
var require_dump = __commonJS((exports, module) => {
|
|
623
|
-
module.exports = function dump() {
|
|
624
|
-
console.log(this);
|
|
625
|
-
return this;
|
|
626
|
-
};
|
|
627
|
-
});
|
|
628
|
-
|
|
629
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/duplicates.js
|
|
630
|
-
var require_duplicates = __commonJS((exports, module) => {
|
|
631
|
-
var _typeof = function(obj) {
|
|
632
|
-
"@babel/helpers - typeof";
|
|
633
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
634
|
-
return typeof obj2;
|
|
635
|
-
} : function(obj2) {
|
|
636
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
637
|
-
}, _typeof(obj);
|
|
638
|
-
};
|
|
639
|
-
module.exports = function duplicates() {
|
|
640
|
-
var _this = this;
|
|
641
|
-
var occuredValues = [];
|
|
642
|
-
var duplicateValues = {};
|
|
643
|
-
var stringifiedValue = function stringifiedValue(value) {
|
|
644
|
-
if (Array.isArray(value) || _typeof(value) === "object") {
|
|
645
|
-
return JSON.stringify(value);
|
|
646
|
-
}
|
|
647
|
-
return value;
|
|
648
|
-
};
|
|
649
|
-
if (Array.isArray(this.items)) {
|
|
650
|
-
this.items.forEach(function(value, index) {
|
|
651
|
-
var valueAsString = stringifiedValue(value);
|
|
652
|
-
if (occuredValues.indexOf(valueAsString) === -1) {
|
|
653
|
-
occuredValues.push(valueAsString);
|
|
654
|
-
} else {
|
|
655
|
-
duplicateValues[index] = value;
|
|
656
|
-
}
|
|
657
|
-
});
|
|
658
|
-
} else if (_typeof(this.items) === "object") {
|
|
659
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
660
|
-
var valueAsString = stringifiedValue(_this.items[key2]);
|
|
661
|
-
if (occuredValues.indexOf(valueAsString) === -1) {
|
|
662
|
-
occuredValues.push(valueAsString);
|
|
663
|
-
} else {
|
|
664
|
-
duplicateValues[key2] = _this.items[key2];
|
|
665
|
-
}
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
return new this.constructor(duplicateValues);
|
|
669
|
-
};
|
|
670
|
-
});
|
|
671
|
-
|
|
672
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/each.js
|
|
673
|
-
var require_each = __commonJS((exports, module) => {
|
|
674
|
-
module.exports = function each(fn) {
|
|
675
|
-
var stop = false;
|
|
676
|
-
if (Array.isArray(this.items)) {
|
|
677
|
-
var length = this.items.length;
|
|
678
|
-
for (var index = 0;index < length && !stop; index += 1) {
|
|
679
|
-
stop = fn(this.items[index], index, this.items) === false;
|
|
680
|
-
}
|
|
681
|
-
} else {
|
|
682
|
-
var keys = Object.keys(this.items);
|
|
683
|
-
var _length = keys.length;
|
|
684
|
-
for (var _index = 0;_index < _length && !stop; _index += 1) {
|
|
685
|
-
var key2 = keys[_index];
|
|
686
|
-
stop = fn(this.items[key2], key2, this.items) === false;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
return this;
|
|
690
|
-
};
|
|
691
|
-
});
|
|
692
|
-
|
|
693
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/eachSpread.js
|
|
694
|
-
var require_eachSpread = __commonJS((exports, module) => {
|
|
695
|
-
var _toConsumableArray = function(arr) {
|
|
696
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
697
|
-
};
|
|
698
|
-
var _nonIterableSpread = function() {
|
|
699
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
700
|
-
};
|
|
701
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
702
|
-
if (!o)
|
|
703
|
-
return;
|
|
704
|
-
if (typeof o === "string")
|
|
705
|
-
return _arrayLikeToArray(o, minLen);
|
|
706
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
707
|
-
if (n === "Object" && o.constructor)
|
|
708
|
-
n = o.constructor.name;
|
|
709
|
-
if (n === "Map" || n === "Set")
|
|
710
|
-
return Array.from(o);
|
|
711
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
712
|
-
return _arrayLikeToArray(o, minLen);
|
|
713
|
-
};
|
|
714
|
-
var _iterableToArray = function(iter) {
|
|
715
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
716
|
-
return Array.from(iter);
|
|
717
|
-
};
|
|
718
|
-
var _arrayWithoutHoles = function(arr) {
|
|
719
|
-
if (Array.isArray(arr))
|
|
720
|
-
return _arrayLikeToArray(arr);
|
|
721
|
-
};
|
|
722
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
723
|
-
if (len == null || len > arr.length)
|
|
724
|
-
len = arr.length;
|
|
725
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
726
|
-
arr2[i] = arr[i];
|
|
727
|
-
}
|
|
728
|
-
return arr2;
|
|
729
|
-
};
|
|
730
|
-
module.exports = function eachSpread(fn) {
|
|
731
|
-
this.each(function(values, key2) {
|
|
732
|
-
fn.apply(undefined, _toConsumableArray(values).concat([key2]));
|
|
733
|
-
});
|
|
734
|
-
return this;
|
|
735
|
-
};
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/every.js
|
|
739
|
-
var require_every = __commonJS((exports, module) => {
|
|
740
|
-
var values = require_values();
|
|
741
|
-
module.exports = function every(fn) {
|
|
742
|
-
var items = values(this.items);
|
|
743
|
-
return items.every(fn);
|
|
744
|
-
};
|
|
745
|
-
});
|
|
746
|
-
|
|
747
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/helpers/variadic.js
|
|
748
|
-
var require_variadic = __commonJS((exports, module) => {
|
|
749
|
-
module.exports = function variadic(args) {
|
|
750
|
-
if (Array.isArray(args[0])) {
|
|
751
|
-
return args[0];
|
|
752
|
-
}
|
|
753
|
-
return args;
|
|
754
|
-
};
|
|
755
|
-
});
|
|
756
|
-
|
|
757
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/except.js
|
|
758
|
-
var require_except = __commonJS((exports, module) => {
|
|
759
|
-
var variadic = require_variadic();
|
|
760
|
-
module.exports = function except() {
|
|
761
|
-
var _this = this;
|
|
762
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
763
|
-
args[_key] = arguments[_key];
|
|
764
|
-
}
|
|
765
|
-
var properties = variadic(args);
|
|
766
|
-
if (Array.isArray(this.items)) {
|
|
767
|
-
var _collection = this.items.filter(function(item) {
|
|
768
|
-
return properties.indexOf(item) === -1;
|
|
769
|
-
});
|
|
770
|
-
return new this.constructor(_collection);
|
|
771
|
-
}
|
|
772
|
-
var collection = {};
|
|
773
|
-
Object.keys(this.items).forEach(function(property) {
|
|
774
|
-
if (properties.indexOf(property) === -1) {
|
|
775
|
-
collection[property] = _this.items[property];
|
|
776
|
-
}
|
|
777
|
-
});
|
|
778
|
-
return new this.constructor(collection);
|
|
779
|
-
};
|
|
780
|
-
});
|
|
781
|
-
|
|
782
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/filter.js
|
|
783
|
-
var require_filter = __commonJS((exports, module) => {
|
|
784
|
-
var _typeof = function(obj) {
|
|
785
|
-
"@babel/helpers - typeof";
|
|
786
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
787
|
-
return typeof obj2;
|
|
788
|
-
} : function(obj2) {
|
|
789
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
790
|
-
}, _typeof(obj);
|
|
791
|
-
};
|
|
792
|
-
var falsyValue = function(item) {
|
|
793
|
-
if (Array.isArray(item)) {
|
|
794
|
-
if (item.length) {
|
|
795
|
-
return false;
|
|
796
|
-
}
|
|
797
|
-
} else if (item !== undefined && item !== null && _typeof(item) === "object") {
|
|
798
|
-
if (Object.keys(item).length) {
|
|
799
|
-
return false;
|
|
800
|
-
}
|
|
801
|
-
} else if (item) {
|
|
802
|
-
return false;
|
|
803
|
-
}
|
|
804
|
-
return true;
|
|
805
|
-
};
|
|
806
|
-
var filterObject = function(func, items) {
|
|
807
|
-
var result = {};
|
|
808
|
-
Object.keys(items).forEach(function(key2) {
|
|
809
|
-
if (func) {
|
|
810
|
-
if (func(items[key2], key2)) {
|
|
811
|
-
result[key2] = items[key2];
|
|
812
|
-
}
|
|
813
|
-
} else if (!falsyValue(items[key2])) {
|
|
814
|
-
result[key2] = items[key2];
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
return result;
|
|
818
|
-
};
|
|
819
|
-
var filterArray = function(func, items) {
|
|
820
|
-
if (func) {
|
|
821
|
-
return items.filter(func);
|
|
822
|
-
}
|
|
823
|
-
var result = [];
|
|
824
|
-
for (var i = 0;i < items.length; i += 1) {
|
|
825
|
-
var item = items[i];
|
|
826
|
-
if (!falsyValue(item)) {
|
|
827
|
-
result.push(item);
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
return result;
|
|
831
|
-
};
|
|
832
|
-
module.exports = function filter(fn) {
|
|
833
|
-
var func = fn || false;
|
|
834
|
-
var filteredItems = null;
|
|
835
|
-
if (Array.isArray(this.items)) {
|
|
836
|
-
filteredItems = filterArray(func, this.items);
|
|
837
|
-
} else {
|
|
838
|
-
filteredItems = filterObject(func, this.items);
|
|
839
|
-
}
|
|
840
|
-
return new this.constructor(filteredItems);
|
|
841
|
-
};
|
|
842
|
-
});
|
|
843
|
-
|
|
844
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/first.js
|
|
845
|
-
var require_first = __commonJS((exports, module) => {
|
|
846
|
-
var _require = require_is();
|
|
847
|
-
var isFunction = _require.isFunction;
|
|
848
|
-
module.exports = function first(fn, defaultValue) {
|
|
849
|
-
if (isFunction(fn)) {
|
|
850
|
-
var keys = Object.keys(this.items);
|
|
851
|
-
for (var i = 0;i < keys.length; i += 1) {
|
|
852
|
-
var key2 = keys[i];
|
|
853
|
-
var item = this.items[key2];
|
|
854
|
-
if (fn(item, key2)) {
|
|
855
|
-
return item;
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
if (isFunction(defaultValue)) {
|
|
859
|
-
return defaultValue();
|
|
860
|
-
}
|
|
861
|
-
return defaultValue;
|
|
862
|
-
}
|
|
863
|
-
if (Array.isArray(this.items) && this.items.length || Object.keys(this.items).length) {
|
|
864
|
-
if (Array.isArray(this.items)) {
|
|
865
|
-
return this.items[0];
|
|
866
|
-
}
|
|
867
|
-
var firstKey = Object.keys(this.items)[0];
|
|
868
|
-
return this.items[firstKey];
|
|
869
|
-
}
|
|
870
|
-
if (isFunction(defaultValue)) {
|
|
871
|
-
return defaultValue();
|
|
872
|
-
}
|
|
873
|
-
return defaultValue;
|
|
874
|
-
};
|
|
875
|
-
});
|
|
876
|
-
|
|
877
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/firstOrFail.js
|
|
878
|
-
var require_firstOrFail = __commonJS((exports, module) => {
|
|
879
|
-
var _require = require_is();
|
|
880
|
-
var isFunction = _require.isFunction;
|
|
881
|
-
module.exports = function firstOrFail(key2, operator, value) {
|
|
882
|
-
if (isFunction(key2)) {
|
|
883
|
-
return this.first(key2, function() {
|
|
884
|
-
throw new Error("Item not found.");
|
|
885
|
-
});
|
|
886
|
-
}
|
|
887
|
-
var collection = this.where(key2, operator, value);
|
|
888
|
-
if (collection.isEmpty()) {
|
|
889
|
-
throw new Error("Item not found.");
|
|
890
|
-
}
|
|
891
|
-
return collection.first();
|
|
892
|
-
};
|
|
893
|
-
});
|
|
894
|
-
|
|
895
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/firstWhere.js
|
|
896
|
-
var require_firstWhere = __commonJS((exports, module) => {
|
|
897
|
-
module.exports = function firstWhere(key2, operator, value) {
|
|
898
|
-
return this.where(key2, operator, value).first() || null;
|
|
899
|
-
};
|
|
900
|
-
});
|
|
901
|
-
|
|
902
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/flatMap.js
|
|
903
|
-
var require_flatMap = __commonJS((exports, module) => {
|
|
904
|
-
module.exports = function flatMap(fn) {
|
|
905
|
-
return this.map(fn).collapse();
|
|
906
|
-
};
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/flatten.js
|
|
910
|
-
var require_flatten = __commonJS((exports, module) => {
|
|
911
|
-
var _require = require_is();
|
|
912
|
-
var isArray = _require.isArray;
|
|
913
|
-
var isObject = _require.isObject;
|
|
914
|
-
module.exports = function flatten(depth) {
|
|
915
|
-
var flattenDepth = depth || Infinity;
|
|
916
|
-
var fullyFlattened = false;
|
|
917
|
-
var collection = [];
|
|
918
|
-
var flat = function flat(items) {
|
|
919
|
-
collection = [];
|
|
920
|
-
if (isArray(items)) {
|
|
921
|
-
items.forEach(function(item) {
|
|
922
|
-
if (isArray(item)) {
|
|
923
|
-
collection = collection.concat(item);
|
|
924
|
-
} else if (isObject(item)) {
|
|
925
|
-
Object.keys(item).forEach(function(property) {
|
|
926
|
-
collection = collection.concat(item[property]);
|
|
927
|
-
});
|
|
928
|
-
} else {
|
|
929
|
-
collection.push(item);
|
|
930
|
-
}
|
|
931
|
-
});
|
|
932
|
-
} else {
|
|
933
|
-
Object.keys(items).forEach(function(property) {
|
|
934
|
-
if (isArray(items[property])) {
|
|
935
|
-
collection = collection.concat(items[property]);
|
|
936
|
-
} else if (isObject(items[property])) {
|
|
937
|
-
Object.keys(items[property]).forEach(function(prop) {
|
|
938
|
-
collection = collection.concat(items[property][prop]);
|
|
939
|
-
});
|
|
940
|
-
} else {
|
|
941
|
-
collection.push(items[property]);
|
|
942
|
-
}
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
fullyFlattened = collection.filter(function(item) {
|
|
946
|
-
return isObject(item);
|
|
947
|
-
});
|
|
948
|
-
fullyFlattened = fullyFlattened.length === 0;
|
|
949
|
-
flattenDepth -= 1;
|
|
950
|
-
};
|
|
951
|
-
flat(this.items);
|
|
952
|
-
while (!fullyFlattened && flattenDepth > 0) {
|
|
953
|
-
flat(collection);
|
|
954
|
-
}
|
|
955
|
-
return new this.constructor(collection);
|
|
956
|
-
};
|
|
957
|
-
});
|
|
958
|
-
|
|
959
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/flip.js
|
|
960
|
-
var require_flip = __commonJS((exports, module) => {
|
|
961
|
-
module.exports = function flip() {
|
|
962
|
-
var _this = this;
|
|
963
|
-
var collection = {};
|
|
964
|
-
if (Array.isArray(this.items)) {
|
|
965
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
966
|
-
collection[_this.items[key2]] = Number(key2);
|
|
967
|
-
});
|
|
968
|
-
} else {
|
|
969
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
970
|
-
collection[_this.items[key2]] = key2;
|
|
971
|
-
});
|
|
972
|
-
}
|
|
973
|
-
return new this.constructor(collection);
|
|
974
|
-
};
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/forPage.js
|
|
978
|
-
var require_forPage = __commonJS((exports, module) => {
|
|
979
|
-
module.exports = function forPage(page, chunk) {
|
|
980
|
-
var _this = this;
|
|
981
|
-
var collection = {};
|
|
982
|
-
if (Array.isArray(this.items)) {
|
|
983
|
-
collection = this.items.slice(page * chunk - chunk, page * chunk);
|
|
984
|
-
} else {
|
|
985
|
-
Object.keys(this.items).slice(page * chunk - chunk, page * chunk).forEach(function(key2) {
|
|
986
|
-
collection[key2] = _this.items[key2];
|
|
987
|
-
});
|
|
988
|
-
}
|
|
989
|
-
return new this.constructor(collection);
|
|
990
|
-
};
|
|
991
|
-
});
|
|
992
|
-
|
|
993
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/forget.js
|
|
994
|
-
var require_forget = __commonJS((exports, module) => {
|
|
995
|
-
module.exports = function forget(key2) {
|
|
996
|
-
if (Array.isArray(this.items)) {
|
|
997
|
-
this.items.splice(key2, 1);
|
|
998
|
-
} else {
|
|
999
|
-
delete this.items[key2];
|
|
1000
|
-
}
|
|
1001
|
-
return this;
|
|
1002
|
-
};
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/get.js
|
|
1006
|
-
var require_get = __commonJS((exports, module) => {
|
|
1007
|
-
var _require = require_is();
|
|
1008
|
-
var isFunction = _require.isFunction;
|
|
1009
|
-
module.exports = function get(key2) {
|
|
1010
|
-
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1011
|
-
if (this.items[key2] !== undefined) {
|
|
1012
|
-
return this.items[key2];
|
|
1013
|
-
}
|
|
1014
|
-
if (isFunction(defaultValue)) {
|
|
1015
|
-
return defaultValue();
|
|
1016
|
-
}
|
|
1017
|
-
if (defaultValue !== null) {
|
|
1018
|
-
return defaultValue;
|
|
1019
|
-
}
|
|
1020
|
-
return null;
|
|
1021
|
-
};
|
|
1022
|
-
});
|
|
1023
|
-
|
|
1024
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/helpers/nestedValue.js
|
|
1025
|
-
var require_nestedValue = __commonJS((exports, module) => {
|
|
1026
|
-
module.exports = function nestedValue(mainObject, key2) {
|
|
1027
|
-
try {
|
|
1028
|
-
return key2.split(".").reduce(function(obj, property) {
|
|
1029
|
-
return obj[property];
|
|
1030
|
-
}, mainObject);
|
|
1031
|
-
} catch (err) {
|
|
1032
|
-
return mainObject;
|
|
1033
|
-
}
|
|
1034
|
-
};
|
|
1035
|
-
});
|
|
1036
|
-
|
|
1037
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/groupBy.js
|
|
1038
|
-
var require_groupBy = __commonJS((exports, module) => {
|
|
1039
|
-
var nestedValue = require_nestedValue();
|
|
1040
|
-
var _require = require_is();
|
|
1041
|
-
var isFunction = _require.isFunction;
|
|
1042
|
-
module.exports = function groupBy(key2) {
|
|
1043
|
-
var _this = this;
|
|
1044
|
-
var collection = {};
|
|
1045
|
-
this.items.forEach(function(item, index) {
|
|
1046
|
-
var resolvedKey;
|
|
1047
|
-
if (isFunction(key2)) {
|
|
1048
|
-
resolvedKey = key2(item, index);
|
|
1049
|
-
} else if (nestedValue(item, key2) || nestedValue(item, key2) === 0) {
|
|
1050
|
-
resolvedKey = nestedValue(item, key2);
|
|
1051
|
-
} else {
|
|
1052
|
-
resolvedKey = "";
|
|
1053
|
-
}
|
|
1054
|
-
if (collection[resolvedKey] === undefined) {
|
|
1055
|
-
collection[resolvedKey] = new _this.constructor([]);
|
|
1056
|
-
}
|
|
1057
|
-
collection[resolvedKey].push(item);
|
|
1058
|
-
});
|
|
1059
|
-
return new this.constructor(collection);
|
|
1060
|
-
};
|
|
1061
|
-
});
|
|
1062
|
-
|
|
1063
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/has.js
|
|
1064
|
-
var require_has = __commonJS((exports, module) => {
|
|
1065
|
-
var variadic = require_variadic();
|
|
1066
|
-
module.exports = function has() {
|
|
1067
|
-
var _this = this;
|
|
1068
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
1069
|
-
args[_key] = arguments[_key];
|
|
1070
|
-
}
|
|
1071
|
-
var properties = variadic(args);
|
|
1072
|
-
return properties.filter(function(key2) {
|
|
1073
|
-
return Object.hasOwnProperty.call(_this.items, key2);
|
|
1074
|
-
}).length === properties.length;
|
|
1075
|
-
};
|
|
1076
|
-
});
|
|
1077
|
-
|
|
1078
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/implode.js
|
|
1079
|
-
var require_implode = __commonJS((exports, module) => {
|
|
1080
|
-
module.exports = function implode(key2, glue) {
|
|
1081
|
-
if (glue === undefined) {
|
|
1082
|
-
return this.items.join(key2);
|
|
1083
|
-
}
|
|
1084
|
-
return new this.constructor(this.items).pluck(key2).all().join(glue);
|
|
1085
|
-
};
|
|
1086
|
-
});
|
|
1087
|
-
|
|
1088
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/intersect.js
|
|
1089
|
-
var require_intersect = __commonJS((exports, module) => {
|
|
1090
|
-
module.exports = function intersect(values) {
|
|
1091
|
-
var intersectValues = values;
|
|
1092
|
-
if (values instanceof this.constructor) {
|
|
1093
|
-
intersectValues = values.all();
|
|
1094
|
-
}
|
|
1095
|
-
var collection = this.items.filter(function(item) {
|
|
1096
|
-
return intersectValues.indexOf(item) !== -1;
|
|
1097
|
-
});
|
|
1098
|
-
return new this.constructor(collection);
|
|
1099
|
-
};
|
|
1100
|
-
});
|
|
1101
|
-
|
|
1102
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/intersectByKeys.js
|
|
1103
|
-
var require_intersectByKeys = __commonJS((exports, module) => {
|
|
1104
|
-
module.exports = function intersectByKeys(values) {
|
|
1105
|
-
var _this = this;
|
|
1106
|
-
var intersectKeys = Object.keys(values);
|
|
1107
|
-
if (values instanceof this.constructor) {
|
|
1108
|
-
intersectKeys = Object.keys(values.all());
|
|
1109
|
-
}
|
|
1110
|
-
var collection = {};
|
|
1111
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
1112
|
-
if (intersectKeys.indexOf(key2) !== -1) {
|
|
1113
|
-
collection[key2] = _this.items[key2];
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1116
|
-
return new this.constructor(collection);
|
|
1117
|
-
};
|
|
1118
|
-
});
|
|
1119
|
-
|
|
1120
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/isEmpty.js
|
|
1121
|
-
var require_isEmpty = __commonJS((exports, module) => {
|
|
1122
|
-
module.exports = function isEmpty() {
|
|
1123
|
-
if (Array.isArray(this.items)) {
|
|
1124
|
-
return !this.items.length;
|
|
1125
|
-
}
|
|
1126
|
-
return !Object.keys(this.items).length;
|
|
1127
|
-
};
|
|
1128
|
-
});
|
|
1129
|
-
|
|
1130
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/isNotEmpty.js
|
|
1131
|
-
var require_isNotEmpty = __commonJS((exports, module) => {
|
|
1132
|
-
module.exports = function isNotEmpty() {
|
|
1133
|
-
return !this.isEmpty();
|
|
1134
|
-
};
|
|
1135
|
-
});
|
|
1136
|
-
|
|
1137
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/join.js
|
|
1138
|
-
var require_join = __commonJS((exports, module) => {
|
|
1139
|
-
module.exports = function join(glue, finalGlue) {
|
|
1140
|
-
var collection = this.values();
|
|
1141
|
-
if (finalGlue === undefined) {
|
|
1142
|
-
return collection.implode(glue);
|
|
1143
|
-
}
|
|
1144
|
-
var count = collection.count();
|
|
1145
|
-
if (count === 0) {
|
|
1146
|
-
return "";
|
|
1147
|
-
}
|
|
1148
|
-
if (count === 1) {
|
|
1149
|
-
return collection.last();
|
|
1150
|
-
}
|
|
1151
|
-
var finalItem = collection.pop();
|
|
1152
|
-
return collection.implode(glue) + finalGlue + finalItem;
|
|
1153
|
-
};
|
|
1154
|
-
});
|
|
1155
|
-
|
|
1156
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/keyBy.js
|
|
1157
|
-
var require_keyBy = __commonJS((exports, module) => {
|
|
1158
|
-
var nestedValue = require_nestedValue();
|
|
1159
|
-
var _require = require_is();
|
|
1160
|
-
var isFunction = _require.isFunction;
|
|
1161
|
-
module.exports = function keyBy(key2) {
|
|
1162
|
-
var collection = {};
|
|
1163
|
-
if (isFunction(key2)) {
|
|
1164
|
-
this.items.forEach(function(item) {
|
|
1165
|
-
collection[key2(item)] = item;
|
|
1166
|
-
});
|
|
1167
|
-
} else {
|
|
1168
|
-
this.items.forEach(function(item) {
|
|
1169
|
-
var keyValue = nestedValue(item, key2);
|
|
1170
|
-
collection[keyValue || ""] = item;
|
|
1171
|
-
});
|
|
1172
|
-
}
|
|
1173
|
-
return new this.constructor(collection);
|
|
1174
|
-
};
|
|
1175
|
-
});
|
|
1176
|
-
|
|
1177
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/keys.js
|
|
1178
|
-
var require_keys = __commonJS((exports, module) => {
|
|
1179
|
-
module.exports = function keys() {
|
|
1180
|
-
var collection = Object.keys(this.items);
|
|
1181
|
-
if (Array.isArray(this.items)) {
|
|
1182
|
-
collection = collection.map(Number);
|
|
1183
|
-
}
|
|
1184
|
-
return new this.constructor(collection);
|
|
1185
|
-
};
|
|
1186
|
-
});
|
|
1187
|
-
|
|
1188
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/last.js
|
|
1189
|
-
var require_last = __commonJS((exports, module) => {
|
|
1190
|
-
var _require = require_is();
|
|
1191
|
-
var isFunction = _require.isFunction;
|
|
1192
|
-
module.exports = function last(fn, defaultValue) {
|
|
1193
|
-
var items = this.items;
|
|
1194
|
-
if (isFunction(fn)) {
|
|
1195
|
-
items = this.filter(fn).all();
|
|
1196
|
-
}
|
|
1197
|
-
if (Array.isArray(items) && !items.length || !Object.keys(items).length) {
|
|
1198
|
-
if (isFunction(defaultValue)) {
|
|
1199
|
-
return defaultValue();
|
|
1200
|
-
}
|
|
1201
|
-
return defaultValue;
|
|
1202
|
-
}
|
|
1203
|
-
if (Array.isArray(items)) {
|
|
1204
|
-
return items[items.length - 1];
|
|
1205
|
-
}
|
|
1206
|
-
var keys = Object.keys(items);
|
|
1207
|
-
return items[keys[keys.length - 1]];
|
|
1208
|
-
};
|
|
1209
|
-
});
|
|
1210
|
-
|
|
1211
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/macro.js
|
|
1212
|
-
var require_macro = __commonJS((exports, module) => {
|
|
1213
|
-
module.exports = function macro(name, fn) {
|
|
1214
|
-
this.constructor.prototype[name] = fn;
|
|
1215
|
-
};
|
|
1216
|
-
});
|
|
1217
|
-
|
|
1218
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/make.js
|
|
1219
|
-
var require_make = __commonJS((exports, module) => {
|
|
1220
|
-
module.exports = function make() {
|
|
1221
|
-
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1222
|
-
return new this.constructor(items);
|
|
1223
|
-
};
|
|
1224
|
-
});
|
|
1225
|
-
|
|
1226
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/map.js
|
|
1227
|
-
var require_map = __commonJS((exports, module) => {
|
|
1228
|
-
module.exports = function map(fn) {
|
|
1229
|
-
var _this = this;
|
|
1230
|
-
if (Array.isArray(this.items)) {
|
|
1231
|
-
return new this.constructor(this.items.map(fn));
|
|
1232
|
-
}
|
|
1233
|
-
var collection = {};
|
|
1234
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
1235
|
-
collection[key2] = fn(_this.items[key2], key2);
|
|
1236
|
-
});
|
|
1237
|
-
return new this.constructor(collection);
|
|
1238
|
-
};
|
|
1239
|
-
});
|
|
1240
|
-
|
|
1241
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/mapSpread.js
|
|
1242
|
-
var require_mapSpread = __commonJS((exports, module) => {
|
|
1243
|
-
var _toConsumableArray = function(arr) {
|
|
1244
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
1245
|
-
};
|
|
1246
|
-
var _nonIterableSpread = function() {
|
|
1247
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1248
|
-
};
|
|
1249
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
1250
|
-
if (!o)
|
|
1251
|
-
return;
|
|
1252
|
-
if (typeof o === "string")
|
|
1253
|
-
return _arrayLikeToArray(o, minLen);
|
|
1254
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1255
|
-
if (n === "Object" && o.constructor)
|
|
1256
|
-
n = o.constructor.name;
|
|
1257
|
-
if (n === "Map" || n === "Set")
|
|
1258
|
-
return Array.from(o);
|
|
1259
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1260
|
-
return _arrayLikeToArray(o, minLen);
|
|
1261
|
-
};
|
|
1262
|
-
var _iterableToArray = function(iter) {
|
|
1263
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
1264
|
-
return Array.from(iter);
|
|
1265
|
-
};
|
|
1266
|
-
var _arrayWithoutHoles = function(arr) {
|
|
1267
|
-
if (Array.isArray(arr))
|
|
1268
|
-
return _arrayLikeToArray(arr);
|
|
1269
|
-
};
|
|
1270
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
1271
|
-
if (len == null || len > arr.length)
|
|
1272
|
-
len = arr.length;
|
|
1273
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
1274
|
-
arr2[i] = arr[i];
|
|
1275
|
-
}
|
|
1276
|
-
return arr2;
|
|
1277
|
-
};
|
|
1278
|
-
module.exports = function mapSpread(fn) {
|
|
1279
|
-
return this.map(function(values, key2) {
|
|
1280
|
-
return fn.apply(undefined, _toConsumableArray(values).concat([key2]));
|
|
1281
|
-
});
|
|
1282
|
-
};
|
|
1283
|
-
});
|
|
1284
|
-
|
|
1285
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/mapToDictionary.js
|
|
1286
|
-
var require_mapToDictionary = __commonJS((exports, module) => {
|
|
1287
|
-
var _slicedToArray = function(arr, i) {
|
|
1288
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1289
|
-
};
|
|
1290
|
-
var _nonIterableRest = function() {
|
|
1291
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1292
|
-
};
|
|
1293
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
1294
|
-
if (!o)
|
|
1295
|
-
return;
|
|
1296
|
-
if (typeof o === "string")
|
|
1297
|
-
return _arrayLikeToArray(o, minLen);
|
|
1298
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1299
|
-
if (n === "Object" && o.constructor)
|
|
1300
|
-
n = o.constructor.name;
|
|
1301
|
-
if (n === "Map" || n === "Set")
|
|
1302
|
-
return Array.from(o);
|
|
1303
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1304
|
-
return _arrayLikeToArray(o, minLen);
|
|
1305
|
-
};
|
|
1306
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
1307
|
-
if (len == null || len > arr.length)
|
|
1308
|
-
len = arr.length;
|
|
1309
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
1310
|
-
arr2[i] = arr[i];
|
|
1311
|
-
}
|
|
1312
|
-
return arr2;
|
|
1313
|
-
};
|
|
1314
|
-
var _iterableToArrayLimit = function(arr, i) {
|
|
1315
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1316
|
-
if (_i == null)
|
|
1317
|
-
return;
|
|
1318
|
-
var _arr = [];
|
|
1319
|
-
var _n = true;
|
|
1320
|
-
var _d = false;
|
|
1321
|
-
var _s, _e;
|
|
1322
|
-
try {
|
|
1323
|
-
for (_i = _i.call(arr);!(_n = (_s = _i.next()).done); _n = true) {
|
|
1324
|
-
_arr.push(_s.value);
|
|
1325
|
-
if (i && _arr.length === i)
|
|
1326
|
-
break;
|
|
1327
|
-
}
|
|
1328
|
-
} catch (err) {
|
|
1329
|
-
_d = true;
|
|
1330
|
-
_e = err;
|
|
1331
|
-
} finally {
|
|
1332
|
-
try {
|
|
1333
|
-
if (!_n && _i["return"] != null)
|
|
1334
|
-
_i["return"]();
|
|
1335
|
-
} finally {
|
|
1336
|
-
if (_d)
|
|
1337
|
-
throw _e;
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
return _arr;
|
|
1341
|
-
};
|
|
1342
|
-
var _arrayWithHoles = function(arr) {
|
|
1343
|
-
if (Array.isArray(arr))
|
|
1344
|
-
return arr;
|
|
1345
|
-
};
|
|
1346
|
-
module.exports = function mapToDictionary(fn) {
|
|
1347
|
-
var collection = {};
|
|
1348
|
-
this.items.forEach(function(item, k) {
|
|
1349
|
-
var _fn = fn(item, k), _fn2 = _slicedToArray(_fn, 2), key2 = _fn2[0], value = _fn2[1];
|
|
1350
|
-
if (collection[key2] === undefined) {
|
|
1351
|
-
collection[key2] = [value];
|
|
1352
|
-
} else {
|
|
1353
|
-
collection[key2].push(value);
|
|
1354
|
-
}
|
|
1355
|
-
});
|
|
1356
|
-
return new this.constructor(collection);
|
|
1357
|
-
};
|
|
1358
|
-
});
|
|
1359
|
-
|
|
1360
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/mapInto.js
|
|
1361
|
-
var require_mapInto = __commonJS((exports, module) => {
|
|
1362
|
-
module.exports = function mapInto(ClassName) {
|
|
1363
|
-
return this.map(function(value, key2) {
|
|
1364
|
-
return new ClassName(value, key2);
|
|
1365
|
-
});
|
|
1366
|
-
};
|
|
1367
|
-
});
|
|
1368
|
-
|
|
1369
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/mapToGroups.js
|
|
1370
|
-
var require_mapToGroups = __commonJS((exports, module) => {
|
|
1371
|
-
var _slicedToArray = function(arr, i) {
|
|
1372
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1373
|
-
};
|
|
1374
|
-
var _nonIterableRest = function() {
|
|
1375
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1376
|
-
};
|
|
1377
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
1378
|
-
if (!o)
|
|
1379
|
-
return;
|
|
1380
|
-
if (typeof o === "string")
|
|
1381
|
-
return _arrayLikeToArray(o, minLen);
|
|
1382
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1383
|
-
if (n === "Object" && o.constructor)
|
|
1384
|
-
n = o.constructor.name;
|
|
1385
|
-
if (n === "Map" || n === "Set")
|
|
1386
|
-
return Array.from(o);
|
|
1387
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1388
|
-
return _arrayLikeToArray(o, minLen);
|
|
1389
|
-
};
|
|
1390
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
1391
|
-
if (len == null || len > arr.length)
|
|
1392
|
-
len = arr.length;
|
|
1393
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
1394
|
-
arr2[i] = arr[i];
|
|
1395
|
-
}
|
|
1396
|
-
return arr2;
|
|
1397
|
-
};
|
|
1398
|
-
var _iterableToArrayLimit = function(arr, i) {
|
|
1399
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1400
|
-
if (_i == null)
|
|
1401
|
-
return;
|
|
1402
|
-
var _arr = [];
|
|
1403
|
-
var _n = true;
|
|
1404
|
-
var _d = false;
|
|
1405
|
-
var _s, _e;
|
|
1406
|
-
try {
|
|
1407
|
-
for (_i = _i.call(arr);!(_n = (_s = _i.next()).done); _n = true) {
|
|
1408
|
-
_arr.push(_s.value);
|
|
1409
|
-
if (i && _arr.length === i)
|
|
1410
|
-
break;
|
|
1411
|
-
}
|
|
1412
|
-
} catch (err) {
|
|
1413
|
-
_d = true;
|
|
1414
|
-
_e = err;
|
|
1415
|
-
} finally {
|
|
1416
|
-
try {
|
|
1417
|
-
if (!_n && _i["return"] != null)
|
|
1418
|
-
_i["return"]();
|
|
1419
|
-
} finally {
|
|
1420
|
-
if (_d)
|
|
1421
|
-
throw _e;
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
return _arr;
|
|
1425
|
-
};
|
|
1426
|
-
var _arrayWithHoles = function(arr) {
|
|
1427
|
-
if (Array.isArray(arr))
|
|
1428
|
-
return arr;
|
|
1429
|
-
};
|
|
1430
|
-
module.exports = function mapToGroups(fn) {
|
|
1431
|
-
var collection = {};
|
|
1432
|
-
this.items.forEach(function(item, key2) {
|
|
1433
|
-
var _fn = fn(item, key2), _fn2 = _slicedToArray(_fn, 2), keyed = _fn2[0], value = _fn2[1];
|
|
1434
|
-
if (collection[keyed] === undefined) {
|
|
1435
|
-
collection[keyed] = [value];
|
|
1436
|
-
} else {
|
|
1437
|
-
collection[keyed].push(value);
|
|
1438
|
-
}
|
|
1439
|
-
});
|
|
1440
|
-
return new this.constructor(collection);
|
|
1441
|
-
};
|
|
1442
|
-
});
|
|
1443
|
-
|
|
1444
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/mapWithKeys.js
|
|
1445
|
-
var require_mapWithKeys = __commonJS((exports, module) => {
|
|
1446
|
-
var _slicedToArray = function(arr, i) {
|
|
1447
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1448
|
-
};
|
|
1449
|
-
var _nonIterableRest = function() {
|
|
1450
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1451
|
-
};
|
|
1452
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
1453
|
-
if (!o)
|
|
1454
|
-
return;
|
|
1455
|
-
if (typeof o === "string")
|
|
1456
|
-
return _arrayLikeToArray(o, minLen);
|
|
1457
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1458
|
-
if (n === "Object" && o.constructor)
|
|
1459
|
-
n = o.constructor.name;
|
|
1460
|
-
if (n === "Map" || n === "Set")
|
|
1461
|
-
return Array.from(o);
|
|
1462
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1463
|
-
return _arrayLikeToArray(o, minLen);
|
|
1464
|
-
};
|
|
1465
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
1466
|
-
if (len == null || len > arr.length)
|
|
1467
|
-
len = arr.length;
|
|
1468
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
1469
|
-
arr2[i] = arr[i];
|
|
1470
|
-
}
|
|
1471
|
-
return arr2;
|
|
1472
|
-
};
|
|
1473
|
-
var _iterableToArrayLimit = function(arr, i) {
|
|
1474
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1475
|
-
if (_i == null)
|
|
1476
|
-
return;
|
|
1477
|
-
var _arr = [];
|
|
1478
|
-
var _n = true;
|
|
1479
|
-
var _d = false;
|
|
1480
|
-
var _s, _e;
|
|
1481
|
-
try {
|
|
1482
|
-
for (_i = _i.call(arr);!(_n = (_s = _i.next()).done); _n = true) {
|
|
1483
|
-
_arr.push(_s.value);
|
|
1484
|
-
if (i && _arr.length === i)
|
|
1485
|
-
break;
|
|
1486
|
-
}
|
|
1487
|
-
} catch (err) {
|
|
1488
|
-
_d = true;
|
|
1489
|
-
_e = err;
|
|
1490
|
-
} finally {
|
|
1491
|
-
try {
|
|
1492
|
-
if (!_n && _i["return"] != null)
|
|
1493
|
-
_i["return"]();
|
|
1494
|
-
} finally {
|
|
1495
|
-
if (_d)
|
|
1496
|
-
throw _e;
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
return _arr;
|
|
1500
|
-
};
|
|
1501
|
-
var _arrayWithHoles = function(arr) {
|
|
1502
|
-
if (Array.isArray(arr))
|
|
1503
|
-
return arr;
|
|
1504
|
-
};
|
|
1505
|
-
module.exports = function mapWithKeys(fn) {
|
|
1506
|
-
var _this = this;
|
|
1507
|
-
var collection = {};
|
|
1508
|
-
if (Array.isArray(this.items)) {
|
|
1509
|
-
this.items.forEach(function(item, index) {
|
|
1510
|
-
var _fn = fn(item, index), _fn2 = _slicedToArray(_fn, 2), keyed = _fn2[0], value = _fn2[1];
|
|
1511
|
-
collection[keyed] = value;
|
|
1512
|
-
});
|
|
1513
|
-
} else {
|
|
1514
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
1515
|
-
var _fn3 = fn(_this.items[key2], key2), _fn4 = _slicedToArray(_fn3, 2), keyed = _fn4[0], value = _fn4[1];
|
|
1516
|
-
collection[keyed] = value;
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
|
-
return new this.constructor(collection);
|
|
1520
|
-
};
|
|
1521
|
-
});
|
|
1522
|
-
|
|
1523
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/max.js
|
|
1524
|
-
var require_max = __commonJS((exports, module) => {
|
|
1525
|
-
var _toConsumableArray = function(arr) {
|
|
1526
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
1527
|
-
};
|
|
1528
|
-
var _nonIterableSpread = function() {
|
|
1529
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1530
|
-
};
|
|
1531
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
1532
|
-
if (!o)
|
|
1533
|
-
return;
|
|
1534
|
-
if (typeof o === "string")
|
|
1535
|
-
return _arrayLikeToArray(o, minLen);
|
|
1536
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1537
|
-
if (n === "Object" && o.constructor)
|
|
1538
|
-
n = o.constructor.name;
|
|
1539
|
-
if (n === "Map" || n === "Set")
|
|
1540
|
-
return Array.from(o);
|
|
1541
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1542
|
-
return _arrayLikeToArray(o, minLen);
|
|
1543
|
-
};
|
|
1544
|
-
var _iterableToArray = function(iter) {
|
|
1545
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
1546
|
-
return Array.from(iter);
|
|
1547
|
-
};
|
|
1548
|
-
var _arrayWithoutHoles = function(arr) {
|
|
1549
|
-
if (Array.isArray(arr))
|
|
1550
|
-
return _arrayLikeToArray(arr);
|
|
1551
|
-
};
|
|
1552
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
1553
|
-
if (len == null || len > arr.length)
|
|
1554
|
-
len = arr.length;
|
|
1555
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
1556
|
-
arr2[i] = arr[i];
|
|
1557
|
-
}
|
|
1558
|
-
return arr2;
|
|
1559
|
-
};
|
|
1560
|
-
module.exports = function max(key2) {
|
|
1561
|
-
if (typeof key2 === "string") {
|
|
1562
|
-
var filtered = this.items.filter(function(item) {
|
|
1563
|
-
return item[key2] !== undefined;
|
|
1564
|
-
});
|
|
1565
|
-
return Math.max.apply(Math, _toConsumableArray(filtered.map(function(item) {
|
|
1566
|
-
return item[key2];
|
|
1567
|
-
})));
|
|
1568
|
-
}
|
|
1569
|
-
return Math.max.apply(Math, _toConsumableArray(this.items));
|
|
1570
|
-
};
|
|
1571
|
-
});
|
|
1572
|
-
|
|
1573
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/median.js
|
|
1574
|
-
var require_median = __commonJS((exports, module) => {
|
|
1575
|
-
module.exports = function median(key2) {
|
|
1576
|
-
var length = this.items.length;
|
|
1577
|
-
if (key2 === undefined) {
|
|
1578
|
-
if (length % 2 === 0) {
|
|
1579
|
-
return (this.items[length / 2 - 1] + this.items[length / 2]) / 2;
|
|
1580
|
-
}
|
|
1581
|
-
return this.items[Math.floor(length / 2)];
|
|
1582
|
-
}
|
|
1583
|
-
if (length % 2 === 0) {
|
|
1584
|
-
return (this.items[length / 2 - 1][key2] + this.items[length / 2][key2]) / 2;
|
|
1585
|
-
}
|
|
1586
|
-
return this.items[Math.floor(length / 2)][key2];
|
|
1587
|
-
};
|
|
1588
|
-
});
|
|
1589
|
-
|
|
1590
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/merge.js
|
|
1591
|
-
var require_merge = __commonJS((exports, module) => {
|
|
1592
|
-
module.exports = function merge(value) {
|
|
1593
|
-
var arrayOrObject = value;
|
|
1594
|
-
if (typeof arrayOrObject === "string") {
|
|
1595
|
-
arrayOrObject = [arrayOrObject];
|
|
1596
|
-
}
|
|
1597
|
-
if (Array.isArray(this.items) && Array.isArray(arrayOrObject)) {
|
|
1598
|
-
return new this.constructor(this.items.concat(arrayOrObject));
|
|
1599
|
-
}
|
|
1600
|
-
var collection = JSON.parse(JSON.stringify(this.items));
|
|
1601
|
-
Object.keys(arrayOrObject).forEach(function(key2) {
|
|
1602
|
-
collection[key2] = arrayOrObject[key2];
|
|
1603
|
-
});
|
|
1604
|
-
return new this.constructor(collection);
|
|
1605
|
-
};
|
|
1606
|
-
});
|
|
1607
|
-
|
|
1608
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/mergeRecursive.js
|
|
1609
|
-
var require_mergeRecursive = __commonJS((exports, module) => {
|
|
1610
|
-
var _typeof = function(obj) {
|
|
1611
|
-
"@babel/helpers - typeof";
|
|
1612
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
1613
|
-
return typeof obj2;
|
|
1614
|
-
} : function(obj2) {
|
|
1615
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
1616
|
-
}, _typeof(obj);
|
|
1617
|
-
};
|
|
1618
|
-
var ownKeys = function(object, enumerableOnly) {
|
|
1619
|
-
var keys = Object.keys(object);
|
|
1620
|
-
if (Object.getOwnPropertySymbols) {
|
|
1621
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
1622
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
1623
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1624
|
-
})), keys.push.apply(keys, symbols);
|
|
1625
|
-
}
|
|
1626
|
-
return keys;
|
|
1627
|
-
};
|
|
1628
|
-
var _objectSpread = function(target) {
|
|
1629
|
-
for (var i = 1;i < arguments.length; i++) {
|
|
1630
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
1631
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key2) {
|
|
1632
|
-
_defineProperty(target, key2, source[key2]);
|
|
1633
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key2) {
|
|
1634
|
-
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
return target;
|
|
1638
|
-
};
|
|
1639
|
-
var _defineProperty = function(obj, key2, value) {
|
|
1640
|
-
if (key2 in obj) {
|
|
1641
|
-
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
1642
|
-
} else {
|
|
1643
|
-
obj[key2] = value;
|
|
1644
|
-
}
|
|
1645
|
-
return obj;
|
|
1646
|
-
};
|
|
1647
|
-
module.exports = function mergeRecursive(items) {
|
|
1648
|
-
var merge = function merge(target, source) {
|
|
1649
|
-
var merged = {};
|
|
1650
|
-
var mergedKeys = Object.keys(_objectSpread(_objectSpread({}, target), source));
|
|
1651
|
-
mergedKeys.forEach(function(key2) {
|
|
1652
|
-
if (target[key2] === undefined && source[key2] !== undefined) {
|
|
1653
|
-
merged[key2] = source[key2];
|
|
1654
|
-
} else if (target[key2] !== undefined && source[key2] === undefined) {
|
|
1655
|
-
merged[key2] = target[key2];
|
|
1656
|
-
} else if (target[key2] !== undefined && source[key2] !== undefined) {
|
|
1657
|
-
if (target[key2] === source[key2]) {
|
|
1658
|
-
merged[key2] = target[key2];
|
|
1659
|
-
} else if (!Array.isArray(target[key2]) && _typeof(target[key2]) === "object" && !Array.isArray(source[key2]) && _typeof(source[key2]) === "object") {
|
|
1660
|
-
merged[key2] = merge(target[key2], source[key2]);
|
|
1661
|
-
} else {
|
|
1662
|
-
merged[key2] = [].concat(target[key2], source[key2]);
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
});
|
|
1666
|
-
return merged;
|
|
1667
|
-
};
|
|
1668
|
-
if (!items) {
|
|
1669
|
-
return this;
|
|
1670
|
-
}
|
|
1671
|
-
if (items.constructor.name === "Collection") {
|
|
1672
|
-
return new this.constructor(merge(this.items, items.all()));
|
|
1673
|
-
}
|
|
1674
|
-
return new this.constructor(merge(this.items, items));
|
|
1675
|
-
};
|
|
1676
|
-
});
|
|
1677
|
-
|
|
1678
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/min.js
|
|
1679
|
-
var require_min = __commonJS((exports, module) => {
|
|
1680
|
-
var _toConsumableArray = function(arr) {
|
|
1681
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
1682
|
-
};
|
|
1683
|
-
var _nonIterableSpread = function() {
|
|
1684
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1685
|
-
};
|
|
1686
|
-
var _unsupportedIterableToArray = function(o, minLen) {
|
|
1687
|
-
if (!o)
|
|
1688
|
-
return;
|
|
1689
|
-
if (typeof o === "string")
|
|
1690
|
-
return _arrayLikeToArray(o, minLen);
|
|
1691
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1692
|
-
if (n === "Object" && o.constructor)
|
|
1693
|
-
n = o.constructor.name;
|
|
1694
|
-
if (n === "Map" || n === "Set")
|
|
1695
|
-
return Array.from(o);
|
|
1696
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1697
|
-
return _arrayLikeToArray(o, minLen);
|
|
1698
|
-
};
|
|
1699
|
-
var _iterableToArray = function(iter) {
|
|
1700
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
1701
|
-
return Array.from(iter);
|
|
1702
|
-
};
|
|
1703
|
-
var _arrayWithoutHoles = function(arr) {
|
|
1704
|
-
if (Array.isArray(arr))
|
|
1705
|
-
return _arrayLikeToArray(arr);
|
|
1706
|
-
};
|
|
1707
|
-
var _arrayLikeToArray = function(arr, len) {
|
|
1708
|
-
if (len == null || len > arr.length)
|
|
1709
|
-
len = arr.length;
|
|
1710
|
-
for (var i = 0, arr2 = new Array(len);i < len; i++) {
|
|
1711
|
-
arr2[i] = arr[i];
|
|
1712
|
-
}
|
|
1713
|
-
return arr2;
|
|
1714
|
-
};
|
|
1715
|
-
module.exports = function min(key2) {
|
|
1716
|
-
if (key2 !== undefined) {
|
|
1717
|
-
var filtered = this.items.filter(function(item) {
|
|
1718
|
-
return item[key2] !== undefined;
|
|
1719
|
-
});
|
|
1720
|
-
return Math.min.apply(Math, _toConsumableArray(filtered.map(function(item) {
|
|
1721
|
-
return item[key2];
|
|
1722
|
-
})));
|
|
1723
|
-
}
|
|
1724
|
-
return Math.min.apply(Math, _toConsumableArray(this.items));
|
|
1725
|
-
};
|
|
1726
|
-
});
|
|
1727
|
-
|
|
1728
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/mode.js
|
|
1729
|
-
var require_mode = __commonJS((exports, module) => {
|
|
1730
|
-
module.exports = function mode(key2) {
|
|
1731
|
-
var values = [];
|
|
1732
|
-
var highestCount = 1;
|
|
1733
|
-
if (!this.items.length) {
|
|
1734
|
-
return null;
|
|
1735
|
-
}
|
|
1736
|
-
this.items.forEach(function(item) {
|
|
1737
|
-
var tempValues = values.filter(function(value) {
|
|
1738
|
-
if (key2 !== undefined) {
|
|
1739
|
-
return value.key === item[key2];
|
|
1740
|
-
}
|
|
1741
|
-
return value.key === item;
|
|
1742
|
-
});
|
|
1743
|
-
if (!tempValues.length) {
|
|
1744
|
-
if (key2 !== undefined) {
|
|
1745
|
-
values.push({
|
|
1746
|
-
key: item[key2],
|
|
1747
|
-
count: 1
|
|
1748
|
-
});
|
|
1749
|
-
} else {
|
|
1750
|
-
values.push({
|
|
1751
|
-
key: item,
|
|
1752
|
-
count: 1
|
|
1753
|
-
});
|
|
1754
|
-
}
|
|
1755
|
-
} else {
|
|
1756
|
-
tempValues[0].count += 1;
|
|
1757
|
-
var count = tempValues[0].count;
|
|
1758
|
-
if (count > highestCount) {
|
|
1759
|
-
highestCount = count;
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
});
|
|
1763
|
-
return values.filter(function(value) {
|
|
1764
|
-
return value.count === highestCount;
|
|
1765
|
-
}).map(function(value) {
|
|
1766
|
-
return value.key;
|
|
1767
|
-
});
|
|
1768
|
-
};
|
|
1769
|
-
});
|
|
1770
|
-
|
|
1771
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/nth.js
|
|
1772
|
-
var require_nth = __commonJS((exports, module) => {
|
|
1773
|
-
var values = require_values();
|
|
1774
|
-
module.exports = function nth(n) {
|
|
1775
|
-
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1776
|
-
var items = values(this.items);
|
|
1777
|
-
var collection = items.slice(offset).filter(function(item, index) {
|
|
1778
|
-
return index % n === 0;
|
|
1779
|
-
});
|
|
1780
|
-
return new this.constructor(collection);
|
|
1781
|
-
};
|
|
1782
|
-
});
|
|
1783
|
-
|
|
1784
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/only.js
|
|
1785
|
-
var require_only = __commonJS((exports, module) => {
|
|
1786
|
-
var variadic = require_variadic();
|
|
1787
|
-
module.exports = function only() {
|
|
1788
|
-
var _this = this;
|
|
1789
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
1790
|
-
args[_key] = arguments[_key];
|
|
1791
|
-
}
|
|
1792
|
-
var properties = variadic(args);
|
|
1793
|
-
if (Array.isArray(this.items)) {
|
|
1794
|
-
var _collection = this.items.filter(function(item) {
|
|
1795
|
-
return properties.indexOf(item) !== -1;
|
|
1796
|
-
});
|
|
1797
|
-
return new this.constructor(_collection);
|
|
1798
|
-
}
|
|
1799
|
-
var collection = {};
|
|
1800
|
-
Object.keys(this.items).forEach(function(prop) {
|
|
1801
|
-
if (properties.indexOf(prop) !== -1) {
|
|
1802
|
-
collection[prop] = _this.items[prop];
|
|
1803
|
-
}
|
|
1804
|
-
});
|
|
1805
|
-
return new this.constructor(collection);
|
|
1806
|
-
};
|
|
1807
|
-
});
|
|
1808
|
-
|
|
1809
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/pad.js
|
|
1810
|
-
var require_pad = __commonJS((exports, module) => {
|
|
1811
|
-
var clone = require_clone();
|
|
1812
|
-
module.exports = function pad(size, value) {
|
|
1813
|
-
var abs = Math.abs(size);
|
|
1814
|
-
var count = this.count();
|
|
1815
|
-
if (abs <= count) {
|
|
1816
|
-
return this;
|
|
1817
|
-
}
|
|
1818
|
-
var diff = abs - count;
|
|
1819
|
-
var items = clone(this.items);
|
|
1820
|
-
var isArray = Array.isArray(this.items);
|
|
1821
|
-
var prepend = size < 0;
|
|
1822
|
-
for (var iterator = 0;iterator < diff; ) {
|
|
1823
|
-
if (!isArray) {
|
|
1824
|
-
if (items[iterator] !== undefined) {
|
|
1825
|
-
diff += 1;
|
|
1826
|
-
} else {
|
|
1827
|
-
items[iterator] = value;
|
|
1828
|
-
}
|
|
1829
|
-
} else if (prepend) {
|
|
1830
|
-
items.unshift(value);
|
|
1831
|
-
} else {
|
|
1832
|
-
items.push(value);
|
|
1833
|
-
}
|
|
1834
|
-
iterator += 1;
|
|
1835
|
-
}
|
|
1836
|
-
return new this.constructor(items);
|
|
1837
|
-
};
|
|
1838
|
-
});
|
|
1839
|
-
|
|
1840
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/partition.js
|
|
1841
|
-
var require_partition = __commonJS((exports, module) => {
|
|
1842
|
-
module.exports = function partition(fn) {
|
|
1843
|
-
var _this = this;
|
|
1844
|
-
var arrays;
|
|
1845
|
-
if (Array.isArray(this.items)) {
|
|
1846
|
-
arrays = [new this.constructor([]), new this.constructor([])];
|
|
1847
|
-
this.items.forEach(function(item) {
|
|
1848
|
-
if (fn(item) === true) {
|
|
1849
|
-
arrays[0].push(item);
|
|
1850
|
-
} else {
|
|
1851
|
-
arrays[1].push(item);
|
|
1852
|
-
}
|
|
1853
|
-
});
|
|
1854
|
-
} else {
|
|
1855
|
-
arrays = [new this.constructor({}), new this.constructor({})];
|
|
1856
|
-
Object.keys(this.items).forEach(function(prop) {
|
|
1857
|
-
var value = _this.items[prop];
|
|
1858
|
-
if (fn(value) === true) {
|
|
1859
|
-
arrays[0].put(prop, value);
|
|
1860
|
-
} else {
|
|
1861
|
-
arrays[1].put(prop, value);
|
|
1862
|
-
}
|
|
1863
|
-
});
|
|
1864
|
-
}
|
|
1865
|
-
return new this.constructor(arrays);
|
|
1866
|
-
};
|
|
1867
|
-
});
|
|
1868
|
-
|
|
1869
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/pipe.js
|
|
1870
|
-
var require_pipe = __commonJS((exports, module) => {
|
|
1871
|
-
module.exports = function pipe(fn) {
|
|
1872
|
-
return fn(this);
|
|
1873
|
-
};
|
|
1874
|
-
});
|
|
1875
|
-
|
|
1876
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/pluck.js
|
|
1877
|
-
var require_pluck = __commonJS((exports, module) => {
|
|
1878
|
-
var _require = require_is();
|
|
1879
|
-
var isArray = _require.isArray;
|
|
1880
|
-
var isObject = _require.isObject;
|
|
1881
|
-
var nestedValue = require_nestedValue();
|
|
1882
|
-
var buildKeyPathMap = function buildKeyPathMap(items) {
|
|
1883
|
-
var keyPaths = {};
|
|
1884
|
-
items.forEach(function(item, index) {
|
|
1885
|
-
function buildKeyPath(val, keyPath) {
|
|
1886
|
-
if (isObject(val)) {
|
|
1887
|
-
Object.keys(val).forEach(function(prop) {
|
|
1888
|
-
buildKeyPath(val[prop], "".concat(keyPath, ".").concat(prop));
|
|
1889
|
-
});
|
|
1890
|
-
} else if (isArray(val)) {
|
|
1891
|
-
val.forEach(function(v, i) {
|
|
1892
|
-
buildKeyPath(v, "".concat(keyPath, ".").concat(i));
|
|
1893
|
-
});
|
|
1894
|
-
}
|
|
1895
|
-
keyPaths[keyPath] = val;
|
|
1896
|
-
}
|
|
1897
|
-
buildKeyPath(item, index);
|
|
1898
|
-
});
|
|
1899
|
-
return keyPaths;
|
|
1900
|
-
};
|
|
1901
|
-
module.exports = function pluck(value, key2) {
|
|
1902
|
-
if (value.indexOf("*") !== -1) {
|
|
1903
|
-
var keyPathMap = buildKeyPathMap(this.items);
|
|
1904
|
-
var keyMatches = [];
|
|
1905
|
-
if (key2 !== undefined) {
|
|
1906
|
-
var keyRegex = new RegExp("0.".concat(key2), "g");
|
|
1907
|
-
var keyNumberOfLevels = "0.".concat(key2).split(".").length;
|
|
1908
|
-
Object.keys(keyPathMap).forEach(function(k) {
|
|
1909
|
-
var matchingKey = k.match(keyRegex);
|
|
1910
|
-
if (matchingKey) {
|
|
1911
|
-
var match = matchingKey[0];
|
|
1912
|
-
if (match.split(".").length === keyNumberOfLevels) {
|
|
1913
|
-
keyMatches.push(keyPathMap[match]);
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
});
|
|
1917
|
-
}
|
|
1918
|
-
var valueMatches = [];
|
|
1919
|
-
var valueRegex = new RegExp("0.".concat(value), "g");
|
|
1920
|
-
var valueNumberOfLevels = "0.".concat(value).split(".").length;
|
|
1921
|
-
Object.keys(keyPathMap).forEach(function(k) {
|
|
1922
|
-
var matchingValue = k.match(valueRegex);
|
|
1923
|
-
if (matchingValue) {
|
|
1924
|
-
var match = matchingValue[0];
|
|
1925
|
-
if (match.split(".").length === valueNumberOfLevels) {
|
|
1926
|
-
valueMatches.push(keyPathMap[match]);
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
});
|
|
1930
|
-
if (key2 !== undefined) {
|
|
1931
|
-
var collection = {};
|
|
1932
|
-
this.items.forEach(function(item, index) {
|
|
1933
|
-
collection[keyMatches[index] || ""] = valueMatches;
|
|
1934
|
-
});
|
|
1935
|
-
return new this.constructor(collection);
|
|
1936
|
-
}
|
|
1937
|
-
return new this.constructor([valueMatches]);
|
|
1938
|
-
}
|
|
1939
|
-
if (key2 !== undefined) {
|
|
1940
|
-
var _collection = {};
|
|
1941
|
-
this.items.forEach(function(item) {
|
|
1942
|
-
if (nestedValue(item, value) !== undefined) {
|
|
1943
|
-
_collection[item[key2] || ""] = nestedValue(item, value);
|
|
1944
|
-
} else {
|
|
1945
|
-
_collection[item[key2] || ""] = null;
|
|
1946
|
-
}
|
|
1947
|
-
});
|
|
1948
|
-
return new this.constructor(_collection);
|
|
1949
|
-
}
|
|
1950
|
-
return this.map(function(item) {
|
|
1951
|
-
if (nestedValue(item, value) !== undefined) {
|
|
1952
|
-
return nestedValue(item, value);
|
|
1953
|
-
}
|
|
1954
|
-
return null;
|
|
1955
|
-
});
|
|
1956
|
-
};
|
|
1957
|
-
});
|
|
1958
|
-
|
|
1959
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/helpers/deleteKeys.js
|
|
1960
|
-
var require_deleteKeys = __commonJS((exports, module) => {
|
|
1961
|
-
var variadic = require_variadic();
|
|
1962
|
-
module.exports = function deleteKeys(obj) {
|
|
1963
|
-
for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) {
|
|
1964
|
-
keys[_key - 1] = arguments[_key];
|
|
1965
|
-
}
|
|
1966
|
-
variadic(keys).forEach(function(key2) {
|
|
1967
|
-
delete obj[key2];
|
|
1968
|
-
});
|
|
1969
|
-
};
|
|
1970
|
-
});
|
|
1971
|
-
|
|
1972
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/pop.js
|
|
1973
|
-
var require_pop = __commonJS((exports, module) => {
|
|
1974
|
-
var _require = require_is();
|
|
1975
|
-
var isArray = _require.isArray;
|
|
1976
|
-
var isObject = _require.isObject;
|
|
1977
|
-
var deleteKeys = require_deleteKeys();
|
|
1978
|
-
module.exports = function pop() {
|
|
1979
|
-
var _this = this;
|
|
1980
|
-
var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1981
|
-
if (this.isEmpty()) {
|
|
1982
|
-
return null;
|
|
1983
|
-
}
|
|
1984
|
-
if (isArray(this.items)) {
|
|
1985
|
-
if (count === 1) {
|
|
1986
|
-
return this.items.pop();
|
|
1987
|
-
}
|
|
1988
|
-
return new this.constructor(this.items.splice(-count));
|
|
1989
|
-
}
|
|
1990
|
-
if (isObject(this.items)) {
|
|
1991
|
-
var keys = Object.keys(this.items);
|
|
1992
|
-
if (count === 1) {
|
|
1993
|
-
var key2 = keys[keys.length - 1];
|
|
1994
|
-
var last = this.items[key2];
|
|
1995
|
-
deleteKeys(this.items, key2);
|
|
1996
|
-
return last;
|
|
1997
|
-
}
|
|
1998
|
-
var poppedKeys = keys.slice(-count);
|
|
1999
|
-
var newObject = poppedKeys.reduce(function(acc, current) {
|
|
2000
|
-
acc[current] = _this.items[current];
|
|
2001
|
-
return acc;
|
|
2002
|
-
}, {});
|
|
2003
|
-
deleteKeys(this.items, poppedKeys);
|
|
2004
|
-
return new this.constructor(newObject);
|
|
2005
|
-
}
|
|
2006
|
-
return null;
|
|
2007
|
-
};
|
|
2008
|
-
});
|
|
2009
|
-
|
|
2010
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/prepend.js
|
|
2011
|
-
var require_prepend = __commonJS((exports, module) => {
|
|
2012
|
-
module.exports = function prepend(value, key2) {
|
|
2013
|
-
if (key2 !== undefined) {
|
|
2014
|
-
return this.put(key2, value);
|
|
2015
|
-
}
|
|
2016
|
-
this.items.unshift(value);
|
|
2017
|
-
return this;
|
|
2018
|
-
};
|
|
2019
|
-
});
|
|
2020
|
-
|
|
2021
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/pull.js
|
|
2022
|
-
var require_pull = __commonJS((exports, module) => {
|
|
2023
|
-
var _require = require_is();
|
|
2024
|
-
var isFunction = _require.isFunction;
|
|
2025
|
-
module.exports = function pull(key2, defaultValue) {
|
|
2026
|
-
var returnValue = this.items[key2] || null;
|
|
2027
|
-
if (!returnValue && defaultValue !== undefined) {
|
|
2028
|
-
if (isFunction(defaultValue)) {
|
|
2029
|
-
returnValue = defaultValue();
|
|
2030
|
-
} else {
|
|
2031
|
-
returnValue = defaultValue;
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
delete this.items[key2];
|
|
2035
|
-
return returnValue;
|
|
2036
|
-
};
|
|
2037
|
-
});
|
|
2038
|
-
|
|
2039
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/push.js
|
|
2040
|
-
var require_push = __commonJS((exports, module) => {
|
|
2041
|
-
module.exports = function push() {
|
|
2042
|
-
var _this$items;
|
|
2043
|
-
(_this$items = this.items).push.apply(_this$items, arguments);
|
|
2044
|
-
return this;
|
|
2045
|
-
};
|
|
2046
|
-
});
|
|
2047
|
-
|
|
2048
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/put.js
|
|
2049
|
-
var require_put = __commonJS((exports, module) => {
|
|
2050
|
-
module.exports = function put(key2, value) {
|
|
2051
|
-
this.items[key2] = value;
|
|
2052
|
-
return this;
|
|
2053
|
-
};
|
|
2054
|
-
});
|
|
2055
|
-
|
|
2056
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/random.js
|
|
2057
|
-
var require_random = __commonJS((exports, module) => {
|
|
2058
|
-
var values = require_values();
|
|
2059
|
-
module.exports = function random() {
|
|
2060
|
-
var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
2061
|
-
var items = values(this.items);
|
|
2062
|
-
var collection = new this.constructor(items).shuffle();
|
|
2063
|
-
if (length !== parseInt(length, 10)) {
|
|
2064
|
-
return collection.first();
|
|
2065
|
-
}
|
|
2066
|
-
return collection.take(length);
|
|
2067
|
-
};
|
|
2068
|
-
});
|
|
2069
|
-
|
|
2070
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/reduce.js
|
|
2071
|
-
var require_reduce = __commonJS((exports, module) => {
|
|
2072
|
-
module.exports = function reduce(fn, carry) {
|
|
2073
|
-
var _this = this;
|
|
2074
|
-
var reduceCarry = null;
|
|
2075
|
-
if (carry !== undefined) {
|
|
2076
|
-
reduceCarry = carry;
|
|
2077
|
-
}
|
|
2078
|
-
if (Array.isArray(this.items)) {
|
|
2079
|
-
this.items.forEach(function(item) {
|
|
2080
|
-
reduceCarry = fn(reduceCarry, item);
|
|
2081
|
-
});
|
|
2082
|
-
} else {
|
|
2083
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
2084
|
-
reduceCarry = fn(reduceCarry, _this.items[key2], key2);
|
|
2085
|
-
});
|
|
2086
|
-
}
|
|
2087
|
-
return reduceCarry;
|
|
2088
|
-
};
|
|
2089
|
-
});
|
|
2090
|
-
|
|
2091
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/reject.js
|
|
2092
|
-
var require_reject = __commonJS((exports, module) => {
|
|
2093
|
-
module.exports = function reject(fn) {
|
|
2094
|
-
return new this.constructor(this.items).filter(function(item) {
|
|
2095
|
-
return !fn(item);
|
|
2096
|
-
});
|
|
2097
|
-
};
|
|
2098
|
-
});
|
|
2099
|
-
|
|
2100
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/replace.js
|
|
2101
|
-
var require_replace = __commonJS((exports, module) => {
|
|
2102
|
-
var ownKeys = function(object, enumerableOnly) {
|
|
2103
|
-
var keys = Object.keys(object);
|
|
2104
|
-
if (Object.getOwnPropertySymbols) {
|
|
2105
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2106
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2107
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2108
|
-
})), keys.push.apply(keys, symbols);
|
|
2109
|
-
}
|
|
2110
|
-
return keys;
|
|
2111
|
-
};
|
|
2112
|
-
var _objectSpread = function(target) {
|
|
2113
|
-
for (var i = 1;i < arguments.length; i++) {
|
|
2114
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
2115
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key2) {
|
|
2116
|
-
_defineProperty(target, key2, source[key2]);
|
|
2117
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key2) {
|
|
2118
|
-
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
2119
|
-
});
|
|
2120
|
-
}
|
|
2121
|
-
return target;
|
|
2122
|
-
};
|
|
2123
|
-
var _defineProperty = function(obj, key2, value) {
|
|
2124
|
-
if (key2 in obj) {
|
|
2125
|
-
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
2126
|
-
} else {
|
|
2127
|
-
obj[key2] = value;
|
|
2128
|
-
}
|
|
2129
|
-
return obj;
|
|
2130
|
-
};
|
|
2131
|
-
module.exports = function replace(items) {
|
|
2132
|
-
if (!items) {
|
|
2133
|
-
return this;
|
|
2134
|
-
}
|
|
2135
|
-
if (Array.isArray(items)) {
|
|
2136
|
-
var _replaced = this.items.map(function(value, index) {
|
|
2137
|
-
return items[index] || value;
|
|
2138
|
-
});
|
|
2139
|
-
return new this.constructor(_replaced);
|
|
2140
|
-
}
|
|
2141
|
-
if (items.constructor.name === "Collection") {
|
|
2142
|
-
var _replaced2 = _objectSpread(_objectSpread({}, this.items), items.all());
|
|
2143
|
-
return new this.constructor(_replaced2);
|
|
2144
|
-
}
|
|
2145
|
-
var replaced = _objectSpread(_objectSpread({}, this.items), items);
|
|
2146
|
-
return new this.constructor(replaced);
|
|
2147
|
-
};
|
|
2148
|
-
});
|
|
2149
|
-
|
|
2150
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/replaceRecursive.js
|
|
2151
|
-
var require_replaceRecursive = __commonJS((exports, module) => {
|
|
2152
|
-
var _typeof = function(obj) {
|
|
2153
|
-
"@babel/helpers - typeof";
|
|
2154
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
2155
|
-
return typeof obj2;
|
|
2156
|
-
} : function(obj2) {
|
|
2157
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
2158
|
-
}, _typeof(obj);
|
|
2159
|
-
};
|
|
2160
|
-
var ownKeys = function(object, enumerableOnly) {
|
|
2161
|
-
var keys = Object.keys(object);
|
|
2162
|
-
if (Object.getOwnPropertySymbols) {
|
|
2163
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2164
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2165
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2166
|
-
})), keys.push.apply(keys, symbols);
|
|
2167
|
-
}
|
|
2168
|
-
return keys;
|
|
2169
|
-
};
|
|
2170
|
-
var _objectSpread = function(target) {
|
|
2171
|
-
for (var i = 1;i < arguments.length; i++) {
|
|
2172
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
2173
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key2) {
|
|
2174
|
-
_defineProperty(target, key2, source[key2]);
|
|
2175
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key2) {
|
|
2176
|
-
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
2177
|
-
});
|
|
2178
|
-
}
|
|
2179
|
-
return target;
|
|
2180
|
-
};
|
|
2181
|
-
var _defineProperty = function(obj, key2, value) {
|
|
2182
|
-
if (key2 in obj) {
|
|
2183
|
-
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
2184
|
-
} else {
|
|
2185
|
-
obj[key2] = value;
|
|
2186
|
-
}
|
|
2187
|
-
return obj;
|
|
2188
|
-
};
|
|
2189
|
-
module.exports = function replaceRecursive(items) {
|
|
2190
|
-
var replace = function replace(target, source) {
|
|
2191
|
-
var replaced = _objectSpread({}, target);
|
|
2192
|
-
var mergedKeys = Object.keys(_objectSpread(_objectSpread({}, target), source));
|
|
2193
|
-
mergedKeys.forEach(function(key2) {
|
|
2194
|
-
if (!Array.isArray(source[key2]) && _typeof(source[key2]) === "object") {
|
|
2195
|
-
replaced[key2] = replace(target[key2], source[key2]);
|
|
2196
|
-
} else if (target[key2] === undefined && source[key2] !== undefined) {
|
|
2197
|
-
if (_typeof(target[key2]) === "object") {
|
|
2198
|
-
replaced[key2] = _objectSpread({}, source[key2]);
|
|
2199
|
-
} else {
|
|
2200
|
-
replaced[key2] = source[key2];
|
|
2201
|
-
}
|
|
2202
|
-
} else if (target[key2] !== undefined && source[key2] === undefined) {
|
|
2203
|
-
if (_typeof(target[key2]) === "object") {
|
|
2204
|
-
replaced[key2] = _objectSpread({}, target[key2]);
|
|
2205
|
-
} else {
|
|
2206
|
-
replaced[key2] = target[key2];
|
|
2207
|
-
}
|
|
2208
|
-
} else if (target[key2] !== undefined && source[key2] !== undefined) {
|
|
2209
|
-
if (_typeof(source[key2]) === "object") {
|
|
2210
|
-
replaced[key2] = _objectSpread({}, source[key2]);
|
|
2211
|
-
} else {
|
|
2212
|
-
replaced[key2] = source[key2];
|
|
2213
|
-
}
|
|
2214
|
-
}
|
|
2215
|
-
});
|
|
2216
|
-
return replaced;
|
|
2217
|
-
};
|
|
2218
|
-
if (!items) {
|
|
2219
|
-
return this;
|
|
2220
|
-
}
|
|
2221
|
-
if (!Array.isArray(items) && _typeof(items) !== "object") {
|
|
2222
|
-
return new this.constructor(replace(this.items, [items]));
|
|
2223
|
-
}
|
|
2224
|
-
if (items.constructor.name === "Collection") {
|
|
2225
|
-
return new this.constructor(replace(this.items, items.all()));
|
|
2226
|
-
}
|
|
2227
|
-
return new this.constructor(replace(this.items, items));
|
|
2228
|
-
};
|
|
2229
|
-
});
|
|
2230
|
-
|
|
2231
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/reverse.js
|
|
2232
|
-
var require_reverse = __commonJS((exports, module) => {
|
|
2233
|
-
module.exports = function reverse() {
|
|
2234
|
-
var collection = [].concat(this.items).reverse();
|
|
2235
|
-
return new this.constructor(collection);
|
|
2236
|
-
};
|
|
2237
|
-
});
|
|
2238
|
-
|
|
2239
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/search.js
|
|
2240
|
-
var require_search = __commonJS((exports, module) => {
|
|
2241
|
-
var _require = require_is();
|
|
2242
|
-
var isArray = _require.isArray;
|
|
2243
|
-
var isObject = _require.isObject;
|
|
2244
|
-
var isFunction = _require.isFunction;
|
|
2245
|
-
module.exports = function search(valueOrFunction, strict) {
|
|
2246
|
-
var _this = this;
|
|
2247
|
-
var result;
|
|
2248
|
-
var find = function find(item, key2) {
|
|
2249
|
-
if (isFunction(valueOrFunction)) {
|
|
2250
|
-
return valueOrFunction(_this.items[key2], key2);
|
|
2251
|
-
}
|
|
2252
|
-
if (strict) {
|
|
2253
|
-
return _this.items[key2] === valueOrFunction;
|
|
2254
|
-
}
|
|
2255
|
-
return _this.items[key2] == valueOrFunction;
|
|
2256
|
-
};
|
|
2257
|
-
if (isArray(this.items)) {
|
|
2258
|
-
result = this.items.findIndex(find);
|
|
2259
|
-
} else if (isObject(this.items)) {
|
|
2260
|
-
result = Object.keys(this.items).find(function(key2) {
|
|
2261
|
-
return find(_this.items[key2], key2);
|
|
2262
|
-
});
|
|
2263
|
-
}
|
|
2264
|
-
if (result === undefined || result < 0) {
|
|
2265
|
-
return false;
|
|
2266
|
-
}
|
|
2267
|
-
return result;
|
|
2268
|
-
};
|
|
2269
|
-
});
|
|
2270
|
-
|
|
2271
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/shift.js
|
|
2272
|
-
var require_shift = __commonJS((exports, module) => {
|
|
2273
|
-
var _require = require_is();
|
|
2274
|
-
var isArray = _require.isArray;
|
|
2275
|
-
var isObject = _require.isObject;
|
|
2276
|
-
var deleteKeys = require_deleteKeys();
|
|
2277
|
-
module.exports = function shift() {
|
|
2278
|
-
var _this = this;
|
|
2279
|
-
var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2280
|
-
if (this.isEmpty()) {
|
|
2281
|
-
return null;
|
|
2282
|
-
}
|
|
2283
|
-
if (isArray(this.items)) {
|
|
2284
|
-
if (count === 1) {
|
|
2285
|
-
return this.items.shift();
|
|
2286
|
-
}
|
|
2287
|
-
return new this.constructor(this.items.splice(0, count));
|
|
2288
|
-
}
|
|
2289
|
-
if (isObject(this.items)) {
|
|
2290
|
-
if (count === 1) {
|
|
2291
|
-
var key2 = Object.keys(this.items)[0];
|
|
2292
|
-
var value = this.items[key2];
|
|
2293
|
-
delete this.items[key2];
|
|
2294
|
-
return value;
|
|
2295
|
-
}
|
|
2296
|
-
var keys = Object.keys(this.items);
|
|
2297
|
-
var poppedKeys = keys.slice(0, count);
|
|
2298
|
-
var newObject = poppedKeys.reduce(function(acc, current) {
|
|
2299
|
-
acc[current] = _this.items[current];
|
|
2300
|
-
return acc;
|
|
2301
|
-
}, {});
|
|
2302
|
-
deleteKeys(this.items, poppedKeys);
|
|
2303
|
-
return new this.constructor(newObject);
|
|
2304
|
-
}
|
|
2305
|
-
return null;
|
|
2306
|
-
};
|
|
2307
|
-
});
|
|
2308
|
-
|
|
2309
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/shuffle.js
|
|
2310
|
-
var require_shuffle = __commonJS((exports, module) => {
|
|
2311
|
-
var values = require_values();
|
|
2312
|
-
module.exports = function shuffle() {
|
|
2313
|
-
var items = values(this.items);
|
|
2314
|
-
var j;
|
|
2315
|
-
var x;
|
|
2316
|
-
var i;
|
|
2317
|
-
for (i = items.length;i; i -= 1) {
|
|
2318
|
-
j = Math.floor(Math.random() * i);
|
|
2319
|
-
x = items[i - 1];
|
|
2320
|
-
items[i - 1] = items[j];
|
|
2321
|
-
items[j] = x;
|
|
2322
|
-
}
|
|
2323
|
-
this.items = items;
|
|
2324
|
-
return this;
|
|
2325
|
-
};
|
|
2326
|
-
});
|
|
2327
|
-
|
|
2328
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/skip.js
|
|
2329
|
-
var require_skip = __commonJS((exports, module) => {
|
|
2330
|
-
var _require = require_is();
|
|
2331
|
-
var isObject = _require.isObject;
|
|
2332
|
-
module.exports = function skip(number) {
|
|
2333
|
-
var _this = this;
|
|
2334
|
-
if (isObject(this.items)) {
|
|
2335
|
-
return new this.constructor(Object.keys(this.items).reduce(function(accumulator, key2, index) {
|
|
2336
|
-
if (index + 1 > number) {
|
|
2337
|
-
accumulator[key2] = _this.items[key2];
|
|
2338
|
-
}
|
|
2339
|
-
return accumulator;
|
|
2340
|
-
}, {}));
|
|
2341
|
-
}
|
|
2342
|
-
return new this.constructor(this.items.slice(number));
|
|
2343
|
-
};
|
|
2344
|
-
});
|
|
2345
|
-
|
|
2346
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/skipUntil.js
|
|
2347
|
-
var require_skipUntil = __commonJS((exports, module) => {
|
|
2348
|
-
var _require = require_is();
|
|
2349
|
-
var isArray = _require.isArray;
|
|
2350
|
-
var isObject = _require.isObject;
|
|
2351
|
-
var isFunction = _require.isFunction;
|
|
2352
|
-
module.exports = function skipUntil(valueOrFunction) {
|
|
2353
|
-
var _this = this;
|
|
2354
|
-
var previous = null;
|
|
2355
|
-
var items;
|
|
2356
|
-
var callback = function callback(value) {
|
|
2357
|
-
return value === valueOrFunction;
|
|
2358
|
-
};
|
|
2359
|
-
if (isFunction(valueOrFunction)) {
|
|
2360
|
-
callback = valueOrFunction;
|
|
2361
|
-
}
|
|
2362
|
-
if (isArray(this.items)) {
|
|
2363
|
-
items = this.items.filter(function(item) {
|
|
2364
|
-
if (previous !== true) {
|
|
2365
|
-
previous = callback(item);
|
|
2366
|
-
}
|
|
2367
|
-
return previous;
|
|
2368
|
-
});
|
|
2369
|
-
}
|
|
2370
|
-
if (isObject(this.items)) {
|
|
2371
|
-
items = Object.keys(this.items).reduce(function(acc, key2) {
|
|
2372
|
-
if (previous !== true) {
|
|
2373
|
-
previous = callback(_this.items[key2]);
|
|
2374
|
-
}
|
|
2375
|
-
if (previous !== false) {
|
|
2376
|
-
acc[key2] = _this.items[key2];
|
|
2377
|
-
}
|
|
2378
|
-
return acc;
|
|
2379
|
-
}, {});
|
|
2380
|
-
}
|
|
2381
|
-
return new this.constructor(items);
|
|
2382
|
-
};
|
|
2383
|
-
});
|
|
2384
|
-
|
|
2385
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/skipWhile.js
|
|
2386
|
-
var require_skipWhile = __commonJS((exports, module) => {
|
|
2387
|
-
var _require = require_is();
|
|
2388
|
-
var isArray = _require.isArray;
|
|
2389
|
-
var isObject = _require.isObject;
|
|
2390
|
-
var isFunction = _require.isFunction;
|
|
2391
|
-
module.exports = function skipWhile(valueOrFunction) {
|
|
2392
|
-
var _this = this;
|
|
2393
|
-
var previous = null;
|
|
2394
|
-
var items;
|
|
2395
|
-
var callback = function callback(value) {
|
|
2396
|
-
return value === valueOrFunction;
|
|
2397
|
-
};
|
|
2398
|
-
if (isFunction(valueOrFunction)) {
|
|
2399
|
-
callback = valueOrFunction;
|
|
2400
|
-
}
|
|
2401
|
-
if (isArray(this.items)) {
|
|
2402
|
-
items = this.items.filter(function(item) {
|
|
2403
|
-
if (previous !== true) {
|
|
2404
|
-
previous = !callback(item);
|
|
2405
|
-
}
|
|
2406
|
-
return previous;
|
|
2407
|
-
});
|
|
2408
|
-
}
|
|
2409
|
-
if (isObject(this.items)) {
|
|
2410
|
-
items = Object.keys(this.items).reduce(function(acc, key2) {
|
|
2411
|
-
if (previous !== true) {
|
|
2412
|
-
previous = !callback(_this.items[key2]);
|
|
2413
|
-
}
|
|
2414
|
-
if (previous !== false) {
|
|
2415
|
-
acc[key2] = _this.items[key2];
|
|
2416
|
-
}
|
|
2417
|
-
return acc;
|
|
2418
|
-
}, {});
|
|
2419
|
-
}
|
|
2420
|
-
return new this.constructor(items);
|
|
2421
|
-
};
|
|
2422
|
-
});
|
|
2423
|
-
|
|
2424
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/slice.js
|
|
2425
|
-
var require_slice = __commonJS((exports, module) => {
|
|
2426
|
-
module.exports = function slice(remove, limit) {
|
|
2427
|
-
var collection = this.items.slice(remove);
|
|
2428
|
-
if (limit !== undefined) {
|
|
2429
|
-
collection = collection.slice(0, limit);
|
|
2430
|
-
}
|
|
2431
|
-
return new this.constructor(collection);
|
|
2432
|
-
};
|
|
2433
|
-
});
|
|
2434
|
-
|
|
2435
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sole.js
|
|
2436
|
-
var require_sole = __commonJS((exports, module) => {
|
|
2437
|
-
var _require = require_is();
|
|
2438
|
-
var isFunction = _require.isFunction;
|
|
2439
|
-
module.exports = function sole(key2, operator, value) {
|
|
2440
|
-
var collection;
|
|
2441
|
-
if (isFunction(key2)) {
|
|
2442
|
-
collection = this.filter(key2);
|
|
2443
|
-
} else {
|
|
2444
|
-
collection = this.where(key2, operator, value);
|
|
2445
|
-
}
|
|
2446
|
-
if (collection.isEmpty()) {
|
|
2447
|
-
throw new Error("Item not found.");
|
|
2448
|
-
}
|
|
2449
|
-
if (collection.count() > 1) {
|
|
2450
|
-
throw new Error("Multiple items found.");
|
|
2451
|
-
}
|
|
2452
|
-
return collection.first();
|
|
2453
|
-
};
|
|
2454
|
-
});
|
|
2455
|
-
|
|
2456
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/some.js
|
|
2457
|
-
var require_some = __commonJS((exports, module) => {
|
|
2458
|
-
var contains = require_contains();
|
|
2459
|
-
module.exports = contains;
|
|
2460
|
-
});
|
|
2461
|
-
|
|
2462
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sort.js
|
|
2463
|
-
var require_sort = __commonJS((exports, module) => {
|
|
2464
|
-
module.exports = function sort(fn) {
|
|
2465
|
-
var collection = [].concat(this.items);
|
|
2466
|
-
if (fn === undefined) {
|
|
2467
|
-
if (this.every(function(item) {
|
|
2468
|
-
return typeof item === "number";
|
|
2469
|
-
})) {
|
|
2470
|
-
collection.sort(function(a, b) {
|
|
2471
|
-
return a - b;
|
|
2472
|
-
});
|
|
2473
|
-
} else {
|
|
2474
|
-
collection.sort();
|
|
2475
|
-
}
|
|
2476
|
-
} else {
|
|
2477
|
-
collection.sort(fn);
|
|
2478
|
-
}
|
|
2479
|
-
return new this.constructor(collection);
|
|
2480
|
-
};
|
|
2481
|
-
});
|
|
2482
|
-
|
|
2483
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sortDesc.js
|
|
2484
|
-
var require_sortDesc = __commonJS((exports, module) => {
|
|
2485
|
-
module.exports = function sortDesc() {
|
|
2486
|
-
return this.sort().reverse();
|
|
2487
|
-
};
|
|
2488
|
-
});
|
|
2489
|
-
|
|
2490
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sortBy.js
|
|
2491
|
-
var require_sortBy = __commonJS((exports, module) => {
|
|
2492
|
-
var nestedValue = require_nestedValue();
|
|
2493
|
-
var _require = require_is();
|
|
2494
|
-
var isFunction = _require.isFunction;
|
|
2495
|
-
module.exports = function sortBy(valueOrFunction) {
|
|
2496
|
-
var collection = [].concat(this.items);
|
|
2497
|
-
var getValue = function getValue(item) {
|
|
2498
|
-
if (isFunction(valueOrFunction)) {
|
|
2499
|
-
return valueOrFunction(item);
|
|
2500
|
-
}
|
|
2501
|
-
return nestedValue(item, valueOrFunction);
|
|
2502
|
-
};
|
|
2503
|
-
collection.sort(function(a, b) {
|
|
2504
|
-
var valueA = getValue(a);
|
|
2505
|
-
var valueB = getValue(b);
|
|
2506
|
-
if (valueA === null || valueA === undefined) {
|
|
2507
|
-
return 1;
|
|
2508
|
-
}
|
|
2509
|
-
if (valueB === null || valueB === undefined) {
|
|
2510
|
-
return -1;
|
|
2511
|
-
}
|
|
2512
|
-
if (valueA < valueB) {
|
|
2513
|
-
return -1;
|
|
2514
|
-
}
|
|
2515
|
-
if (valueA > valueB) {
|
|
2516
|
-
return 1;
|
|
2517
|
-
}
|
|
2518
|
-
return 0;
|
|
2519
|
-
});
|
|
2520
|
-
return new this.constructor(collection);
|
|
2521
|
-
};
|
|
2522
|
-
});
|
|
2523
|
-
|
|
2524
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sortByDesc.js
|
|
2525
|
-
var require_sortByDesc = __commonJS((exports, module) => {
|
|
2526
|
-
module.exports = function sortByDesc(valueOrFunction) {
|
|
2527
|
-
return this.sortBy(valueOrFunction).reverse();
|
|
2528
|
-
};
|
|
2529
|
-
});
|
|
2530
|
-
|
|
2531
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sortKeys.js
|
|
2532
|
-
var require_sortKeys = __commonJS((exports, module) => {
|
|
2533
|
-
module.exports = function sortKeys() {
|
|
2534
|
-
var _this = this;
|
|
2535
|
-
var ordered = {};
|
|
2536
|
-
Object.keys(this.items).sort().forEach(function(key2) {
|
|
2537
|
-
ordered[key2] = _this.items[key2];
|
|
2538
|
-
});
|
|
2539
|
-
return new this.constructor(ordered);
|
|
2540
|
-
};
|
|
2541
|
-
});
|
|
2542
|
-
|
|
2543
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sortKeysDesc.js
|
|
2544
|
-
var require_sortKeysDesc = __commonJS((exports, module) => {
|
|
2545
|
-
module.exports = function sortKeysDesc() {
|
|
2546
|
-
var _this = this;
|
|
2547
|
-
var ordered = {};
|
|
2548
|
-
Object.keys(this.items).sort().reverse().forEach(function(key2) {
|
|
2549
|
-
ordered[key2] = _this.items[key2];
|
|
2550
|
-
});
|
|
2551
|
-
return new this.constructor(ordered);
|
|
2552
|
-
};
|
|
2553
|
-
});
|
|
2554
|
-
|
|
2555
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/splice.js
|
|
2556
|
-
var require_splice = __commonJS((exports, module) => {
|
|
2557
|
-
module.exports = function splice(index, limit, replace) {
|
|
2558
|
-
var slicedCollection = this.slice(index, limit);
|
|
2559
|
-
this.items = this.diff(slicedCollection.all()).all();
|
|
2560
|
-
if (Array.isArray(replace)) {
|
|
2561
|
-
for (var iterator = 0, length = replace.length;iterator < length; iterator += 1) {
|
|
2562
|
-
this.items.splice(index + iterator, 0, replace[iterator]);
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
2565
|
-
return slicedCollection;
|
|
2566
|
-
};
|
|
2567
|
-
});
|
|
2568
|
-
|
|
2569
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/split.js
|
|
2570
|
-
var require_split = __commonJS((exports, module) => {
|
|
2571
|
-
module.exports = function split(numberOfGroups) {
|
|
2572
|
-
var itemsPerGroup = Math.round(this.items.length / numberOfGroups);
|
|
2573
|
-
var items = JSON.parse(JSON.stringify(this.items));
|
|
2574
|
-
var collection = [];
|
|
2575
|
-
for (var iterator = 0;iterator < numberOfGroups; iterator += 1) {
|
|
2576
|
-
collection.push(new this.constructor(items.splice(0, itemsPerGroup)));
|
|
2577
|
-
}
|
|
2578
|
-
return new this.constructor(collection);
|
|
2579
|
-
};
|
|
2580
|
-
});
|
|
2581
|
-
|
|
2582
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/sum.js
|
|
2583
|
-
var require_sum = __commonJS((exports, module) => {
|
|
2584
|
-
var values = require_values();
|
|
2585
|
-
var _require = require_is();
|
|
2586
|
-
var isFunction = _require.isFunction;
|
|
2587
|
-
module.exports = function sum(key2) {
|
|
2588
|
-
var items = values(this.items);
|
|
2589
|
-
var total = 0;
|
|
2590
|
-
if (key2 === undefined) {
|
|
2591
|
-
for (var i = 0, length = items.length;i < length; i += 1) {
|
|
2592
|
-
total += parseFloat(items[i]);
|
|
2593
|
-
}
|
|
2594
|
-
} else if (isFunction(key2)) {
|
|
2595
|
-
for (var _i = 0, _length = items.length;_i < _length; _i += 1) {
|
|
2596
|
-
total += parseFloat(key2(items[_i]));
|
|
2597
|
-
}
|
|
2598
|
-
} else {
|
|
2599
|
-
for (var _i2 = 0, _length2 = items.length;_i2 < _length2; _i2 += 1) {
|
|
2600
|
-
total += parseFloat(items[_i2][key2]);
|
|
2601
|
-
}
|
|
2602
|
-
}
|
|
2603
|
-
return parseFloat(total.toPrecision(12));
|
|
2604
|
-
};
|
|
2605
|
-
});
|
|
2606
|
-
|
|
2607
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/take.js
|
|
2608
|
-
var require_take = __commonJS((exports, module) => {
|
|
2609
|
-
var _typeof = function(obj) {
|
|
2610
|
-
"@babel/helpers - typeof";
|
|
2611
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
2612
|
-
return typeof obj2;
|
|
2613
|
-
} : function(obj2) {
|
|
2614
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
2615
|
-
}, _typeof(obj);
|
|
2616
|
-
};
|
|
2617
|
-
module.exports = function take(length) {
|
|
2618
|
-
var _this = this;
|
|
2619
|
-
if (!Array.isArray(this.items) && _typeof(this.items) === "object") {
|
|
2620
|
-
var keys = Object.keys(this.items);
|
|
2621
|
-
var slicedKeys;
|
|
2622
|
-
if (length < 0) {
|
|
2623
|
-
slicedKeys = keys.slice(length);
|
|
2624
|
-
} else {
|
|
2625
|
-
slicedKeys = keys.slice(0, length);
|
|
2626
|
-
}
|
|
2627
|
-
var collection = {};
|
|
2628
|
-
keys.forEach(function(prop) {
|
|
2629
|
-
if (slicedKeys.indexOf(prop) !== -1) {
|
|
2630
|
-
collection[prop] = _this.items[prop];
|
|
2631
|
-
}
|
|
2632
|
-
});
|
|
2633
|
-
return new this.constructor(collection);
|
|
2634
|
-
}
|
|
2635
|
-
if (length < 0) {
|
|
2636
|
-
return new this.constructor(this.items.slice(length));
|
|
2637
|
-
}
|
|
2638
|
-
return new this.constructor(this.items.slice(0, length));
|
|
2639
|
-
};
|
|
2640
|
-
});
|
|
2641
|
-
|
|
2642
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/takeUntil.js
|
|
2643
|
-
var require_takeUntil = __commonJS((exports, module) => {
|
|
2644
|
-
var _require = require_is();
|
|
2645
|
-
var isArray = _require.isArray;
|
|
2646
|
-
var isObject = _require.isObject;
|
|
2647
|
-
var isFunction = _require.isFunction;
|
|
2648
|
-
module.exports = function takeUntil(valueOrFunction) {
|
|
2649
|
-
var _this = this;
|
|
2650
|
-
var previous = null;
|
|
2651
|
-
var items;
|
|
2652
|
-
var callback = function callback(value) {
|
|
2653
|
-
return value === valueOrFunction;
|
|
2654
|
-
};
|
|
2655
|
-
if (isFunction(valueOrFunction)) {
|
|
2656
|
-
callback = valueOrFunction;
|
|
2657
|
-
}
|
|
2658
|
-
if (isArray(this.items)) {
|
|
2659
|
-
items = this.items.filter(function(item) {
|
|
2660
|
-
if (previous !== false) {
|
|
2661
|
-
previous = !callback(item);
|
|
2662
|
-
}
|
|
2663
|
-
return previous;
|
|
2664
|
-
});
|
|
2665
|
-
}
|
|
2666
|
-
if (isObject(this.items)) {
|
|
2667
|
-
items = Object.keys(this.items).reduce(function(acc, key2) {
|
|
2668
|
-
if (previous !== false) {
|
|
2669
|
-
previous = !callback(_this.items[key2]);
|
|
2670
|
-
}
|
|
2671
|
-
if (previous !== false) {
|
|
2672
|
-
acc[key2] = _this.items[key2];
|
|
2673
|
-
}
|
|
2674
|
-
return acc;
|
|
2675
|
-
}, {});
|
|
2676
|
-
}
|
|
2677
|
-
return new this.constructor(items);
|
|
2678
|
-
};
|
|
2679
|
-
});
|
|
2680
|
-
|
|
2681
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/takeWhile.js
|
|
2682
|
-
var require_takeWhile = __commonJS((exports, module) => {
|
|
2683
|
-
var _require = require_is();
|
|
2684
|
-
var isArray = _require.isArray;
|
|
2685
|
-
var isObject = _require.isObject;
|
|
2686
|
-
var isFunction = _require.isFunction;
|
|
2687
|
-
module.exports = function takeWhile(valueOrFunction) {
|
|
2688
|
-
var _this = this;
|
|
2689
|
-
var previous = null;
|
|
2690
|
-
var items;
|
|
2691
|
-
var callback = function callback(value) {
|
|
2692
|
-
return value === valueOrFunction;
|
|
2693
|
-
};
|
|
2694
|
-
if (isFunction(valueOrFunction)) {
|
|
2695
|
-
callback = valueOrFunction;
|
|
2696
|
-
}
|
|
2697
|
-
if (isArray(this.items)) {
|
|
2698
|
-
items = this.items.filter(function(item) {
|
|
2699
|
-
if (previous !== false) {
|
|
2700
|
-
previous = callback(item);
|
|
2701
|
-
}
|
|
2702
|
-
return previous;
|
|
2703
|
-
});
|
|
2704
|
-
}
|
|
2705
|
-
if (isObject(this.items)) {
|
|
2706
|
-
items = Object.keys(this.items).reduce(function(acc, key2) {
|
|
2707
|
-
if (previous !== false) {
|
|
2708
|
-
previous = callback(_this.items[key2]);
|
|
2709
|
-
}
|
|
2710
|
-
if (previous !== false) {
|
|
2711
|
-
acc[key2] = _this.items[key2];
|
|
2712
|
-
}
|
|
2713
|
-
return acc;
|
|
2714
|
-
}, {});
|
|
2715
|
-
}
|
|
2716
|
-
return new this.constructor(items);
|
|
2717
|
-
};
|
|
2718
|
-
});
|
|
2719
|
-
|
|
2720
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/tap.js
|
|
2721
|
-
var require_tap = __commonJS((exports, module) => {
|
|
2722
|
-
module.exports = function tap(fn) {
|
|
2723
|
-
fn(this);
|
|
2724
|
-
return this;
|
|
2725
|
-
};
|
|
2726
|
-
});
|
|
2727
|
-
|
|
2728
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/times.js
|
|
2729
|
-
var require_times = __commonJS((exports, module) => {
|
|
2730
|
-
module.exports = function times(n, fn) {
|
|
2731
|
-
for (var iterator = 1;iterator <= n; iterator += 1) {
|
|
2732
|
-
this.items.push(fn(iterator));
|
|
2733
|
-
}
|
|
2734
|
-
return this;
|
|
2735
|
-
};
|
|
2736
|
-
});
|
|
2737
|
-
|
|
2738
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/toArray.js
|
|
2739
|
-
var require_toArray = __commonJS((exports, module) => {
|
|
2740
|
-
module.exports = function toArray() {
|
|
2741
|
-
var collectionInstance = this.constructor;
|
|
2742
|
-
function iterate(list2, collection2) {
|
|
2743
|
-
var childCollection = [];
|
|
2744
|
-
if (list2 instanceof collectionInstance) {
|
|
2745
|
-
list2.items.forEach(function(i) {
|
|
2746
|
-
return iterate(i, childCollection);
|
|
2747
|
-
});
|
|
2748
|
-
collection2.push(childCollection);
|
|
2749
|
-
} else if (Array.isArray(list2)) {
|
|
2750
|
-
list2.forEach(function(i) {
|
|
2751
|
-
return iterate(i, childCollection);
|
|
2752
|
-
});
|
|
2753
|
-
collection2.push(childCollection);
|
|
2754
|
-
} else {
|
|
2755
|
-
collection2.push(list2);
|
|
2756
|
-
}
|
|
2757
|
-
}
|
|
2758
|
-
if (Array.isArray(this.items)) {
|
|
2759
|
-
var collection = [];
|
|
2760
|
-
this.items.forEach(function(items) {
|
|
2761
|
-
iterate(items, collection);
|
|
2762
|
-
});
|
|
2763
|
-
return collection;
|
|
2764
|
-
}
|
|
2765
|
-
return this.values().all();
|
|
2766
|
-
};
|
|
2767
|
-
});
|
|
2768
|
-
|
|
2769
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/toJson.js
|
|
2770
|
-
var require_toJson = __commonJS((exports, module) => {
|
|
2771
|
-
var _typeof = function(obj) {
|
|
2772
|
-
"@babel/helpers - typeof";
|
|
2773
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
2774
|
-
return typeof obj2;
|
|
2775
|
-
} : function(obj2) {
|
|
2776
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
2777
|
-
}, _typeof(obj);
|
|
2778
|
-
};
|
|
2779
|
-
module.exports = function toJson() {
|
|
2780
|
-
if (_typeof(this.items) === "object" && !Array.isArray(this.items)) {
|
|
2781
|
-
return JSON.stringify(this.all());
|
|
2782
|
-
}
|
|
2783
|
-
return JSON.stringify(this.toArray());
|
|
2784
|
-
};
|
|
2785
|
-
});
|
|
2786
|
-
|
|
2787
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/transform.js
|
|
2788
|
-
var require_transform = __commonJS((exports, module) => {
|
|
2789
|
-
module.exports = function transform(fn) {
|
|
2790
|
-
var _this = this;
|
|
2791
|
-
if (Array.isArray(this.items)) {
|
|
2792
|
-
this.items = this.items.map(fn);
|
|
2793
|
-
} else {
|
|
2794
|
-
var collection = {};
|
|
2795
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
2796
|
-
collection[key2] = fn(_this.items[key2], key2);
|
|
2797
|
-
});
|
|
2798
|
-
this.items = collection;
|
|
2799
|
-
}
|
|
2800
|
-
return this;
|
|
2801
|
-
};
|
|
2802
|
-
});
|
|
2803
|
-
|
|
2804
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/undot.js
|
|
2805
|
-
var require_undot = __commonJS((exports, module) => {
|
|
2806
|
-
var ownKeys = function(object, enumerableOnly) {
|
|
2807
|
-
var keys = Object.keys(object);
|
|
2808
|
-
if (Object.getOwnPropertySymbols) {
|
|
2809
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2810
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2811
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2812
|
-
})), keys.push.apply(keys, symbols);
|
|
2813
|
-
}
|
|
2814
|
-
return keys;
|
|
2815
|
-
};
|
|
2816
|
-
var _objectSpread = function(target) {
|
|
2817
|
-
for (var i = 1;i < arguments.length; i++) {
|
|
2818
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
2819
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key2) {
|
|
2820
|
-
_defineProperty(target, key2, source[key2]);
|
|
2821
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key2) {
|
|
2822
|
-
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
2823
|
-
});
|
|
2824
|
-
}
|
|
2825
|
-
return target;
|
|
2826
|
-
};
|
|
2827
|
-
var _defineProperty = function(obj, key2, value) {
|
|
2828
|
-
if (key2 in obj) {
|
|
2829
|
-
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
2830
|
-
} else {
|
|
2831
|
-
obj[key2] = value;
|
|
2832
|
-
}
|
|
2833
|
-
return obj;
|
|
2834
|
-
};
|
|
2835
|
-
module.exports = function undot() {
|
|
2836
|
-
var _this = this;
|
|
2837
|
-
if (Array.isArray(this.items)) {
|
|
2838
|
-
return this;
|
|
2839
|
-
}
|
|
2840
|
-
var collection = {};
|
|
2841
|
-
Object.keys(this.items).forEach(function(key2) {
|
|
2842
|
-
if (key2.indexOf(".") !== -1) {
|
|
2843
|
-
var obj = collection;
|
|
2844
|
-
key2.split(".").reduce(function(acc, current, index, array) {
|
|
2845
|
-
if (!acc[current]) {
|
|
2846
|
-
acc[current] = {};
|
|
2847
|
-
}
|
|
2848
|
-
if (index === array.length - 1) {
|
|
2849
|
-
acc[current] = _this.items[key2];
|
|
2850
|
-
}
|
|
2851
|
-
return acc[current];
|
|
2852
|
-
}, obj);
|
|
2853
|
-
collection = _objectSpread(_objectSpread({}, collection), obj);
|
|
2854
|
-
} else {
|
|
2855
|
-
collection[key2] = _this.items[key2];
|
|
2856
|
-
}
|
|
2857
|
-
});
|
|
2858
|
-
return new this.constructor(collection);
|
|
2859
|
-
};
|
|
2860
|
-
});
|
|
2861
|
-
|
|
2862
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/unless.js
|
|
2863
|
-
var require_unless = __commonJS((exports, module) => {
|
|
2864
|
-
module.exports = function when(value, fn, defaultFn) {
|
|
2865
|
-
if (!value) {
|
|
2866
|
-
fn(this);
|
|
2867
|
-
} else {
|
|
2868
|
-
defaultFn(this);
|
|
2869
|
-
}
|
|
2870
|
-
};
|
|
2871
|
-
});
|
|
2872
|
-
|
|
2873
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whenNotEmpty.js
|
|
2874
|
-
var require_whenNotEmpty = __commonJS((exports, module) => {
|
|
2875
|
-
module.exports = function whenNotEmpty(fn, defaultFn) {
|
|
2876
|
-
if (Array.isArray(this.items) && this.items.length) {
|
|
2877
|
-
return fn(this);
|
|
2878
|
-
}
|
|
2879
|
-
if (Object.keys(this.items).length) {
|
|
2880
|
-
return fn(this);
|
|
2881
|
-
}
|
|
2882
|
-
if (defaultFn !== undefined) {
|
|
2883
|
-
if (Array.isArray(this.items) && !this.items.length) {
|
|
2884
|
-
return defaultFn(this);
|
|
2885
|
-
}
|
|
2886
|
-
if (!Object.keys(this.items).length) {
|
|
2887
|
-
return defaultFn(this);
|
|
2888
|
-
}
|
|
2889
|
-
}
|
|
2890
|
-
return this;
|
|
2891
|
-
};
|
|
2892
|
-
});
|
|
2893
|
-
|
|
2894
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whenEmpty.js
|
|
2895
|
-
var require_whenEmpty = __commonJS((exports, module) => {
|
|
2896
|
-
module.exports = function whenEmpty(fn, defaultFn) {
|
|
2897
|
-
if (Array.isArray(this.items) && !this.items.length) {
|
|
2898
|
-
return fn(this);
|
|
2899
|
-
}
|
|
2900
|
-
if (!Object.keys(this.items).length) {
|
|
2901
|
-
return fn(this);
|
|
2902
|
-
}
|
|
2903
|
-
if (defaultFn !== undefined) {
|
|
2904
|
-
if (Array.isArray(this.items) && this.items.length) {
|
|
2905
|
-
return defaultFn(this);
|
|
2906
|
-
}
|
|
2907
|
-
if (Object.keys(this.items).length) {
|
|
2908
|
-
return defaultFn(this);
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
return this;
|
|
2912
|
-
};
|
|
2913
|
-
});
|
|
2914
|
-
|
|
2915
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/union.js
|
|
2916
|
-
var require_union = __commonJS((exports, module) => {
|
|
2917
|
-
module.exports = function union(object) {
|
|
2918
|
-
var _this = this;
|
|
2919
|
-
var collection = JSON.parse(JSON.stringify(this.items));
|
|
2920
|
-
Object.keys(object).forEach(function(prop) {
|
|
2921
|
-
if (_this.items[prop] === undefined) {
|
|
2922
|
-
collection[prop] = object[prop];
|
|
2923
|
-
}
|
|
2924
|
-
});
|
|
2925
|
-
return new this.constructor(collection);
|
|
2926
|
-
};
|
|
2927
|
-
});
|
|
2928
|
-
|
|
2929
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/unique.js
|
|
2930
|
-
var require_unique = __commonJS((exports, module) => {
|
|
2931
|
-
var _require = require_is();
|
|
2932
|
-
var isFunction = _require.isFunction;
|
|
2933
|
-
module.exports = function unique(key2) {
|
|
2934
|
-
var collection;
|
|
2935
|
-
if (key2 === undefined) {
|
|
2936
|
-
collection = this.items.filter(function(element, index, self) {
|
|
2937
|
-
return self.indexOf(element) === index;
|
|
2938
|
-
});
|
|
2939
|
-
} else {
|
|
2940
|
-
collection = [];
|
|
2941
|
-
var usedKeys = [];
|
|
2942
|
-
for (var iterator = 0, length = this.items.length;iterator < length; iterator += 1) {
|
|
2943
|
-
var uniqueKey = undefined;
|
|
2944
|
-
if (isFunction(key2)) {
|
|
2945
|
-
uniqueKey = key2(this.items[iterator]);
|
|
2946
|
-
} else {
|
|
2947
|
-
uniqueKey = this.items[iterator][key2];
|
|
2948
|
-
}
|
|
2949
|
-
if (usedKeys.indexOf(uniqueKey) === -1) {
|
|
2950
|
-
collection.push(this.items[iterator]);
|
|
2951
|
-
usedKeys.push(uniqueKey);
|
|
2952
|
-
}
|
|
2953
|
-
}
|
|
2954
|
-
}
|
|
2955
|
-
return new this.constructor(collection);
|
|
2956
|
-
};
|
|
2957
|
-
});
|
|
2958
|
-
|
|
2959
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/unwrap.js
|
|
2960
|
-
var require_unwrap = __commonJS((exports, module) => {
|
|
2961
|
-
module.exports = function unwrap(value) {
|
|
2962
|
-
if (value instanceof this.constructor) {
|
|
2963
|
-
return value.all();
|
|
2964
|
-
}
|
|
2965
|
-
return value;
|
|
2966
|
-
};
|
|
2967
|
-
});
|
|
2968
|
-
|
|
2969
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/values.js
|
|
2970
|
-
var require_values2 = __commonJS((exports, module) => {
|
|
2971
|
-
var getValues = require_values();
|
|
2972
|
-
module.exports = function values() {
|
|
2973
|
-
return new this.constructor(getValues(this.items));
|
|
2974
|
-
};
|
|
2975
|
-
});
|
|
2976
|
-
|
|
2977
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/when.js
|
|
2978
|
-
var require_when = __commonJS((exports, module) => {
|
|
2979
|
-
module.exports = function when(value, fn, defaultFn) {
|
|
2980
|
-
if (value) {
|
|
2981
|
-
return fn(this, value);
|
|
2982
|
-
}
|
|
2983
|
-
if (defaultFn) {
|
|
2984
|
-
return defaultFn(this, value);
|
|
2985
|
-
}
|
|
2986
|
-
return this;
|
|
2987
|
-
};
|
|
2988
|
-
});
|
|
2989
|
-
|
|
2990
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/where.js
|
|
2991
|
-
var require_where = __commonJS((exports, module) => {
|
|
2992
|
-
var values = require_values();
|
|
2993
|
-
var nestedValue = require_nestedValue();
|
|
2994
|
-
module.exports = function where(key2, operator, value) {
|
|
2995
|
-
var comparisonOperator = operator;
|
|
2996
|
-
var comparisonValue = value;
|
|
2997
|
-
var items = values(this.items);
|
|
2998
|
-
if (operator === undefined || operator === true) {
|
|
2999
|
-
return new this.constructor(items.filter(function(item) {
|
|
3000
|
-
return nestedValue(item, key2);
|
|
3001
|
-
}));
|
|
3002
|
-
}
|
|
3003
|
-
if (operator === false) {
|
|
3004
|
-
return new this.constructor(items.filter(function(item) {
|
|
3005
|
-
return !nestedValue(item, key2);
|
|
3006
|
-
}));
|
|
3007
|
-
}
|
|
3008
|
-
if (value === undefined) {
|
|
3009
|
-
comparisonValue = operator;
|
|
3010
|
-
comparisonOperator = "===";
|
|
3011
|
-
}
|
|
3012
|
-
var collection = items.filter(function(item) {
|
|
3013
|
-
switch (comparisonOperator) {
|
|
3014
|
-
case "==":
|
|
3015
|
-
return nestedValue(item, key2) === Number(comparisonValue) || nestedValue(item, key2) === comparisonValue.toString();
|
|
3016
|
-
default:
|
|
3017
|
-
case "===":
|
|
3018
|
-
return nestedValue(item, key2) === comparisonValue;
|
|
3019
|
-
case "!=":
|
|
3020
|
-
case "<>":
|
|
3021
|
-
return nestedValue(item, key2) !== Number(comparisonValue) && nestedValue(item, key2) !== comparisonValue.toString();
|
|
3022
|
-
case "!==":
|
|
3023
|
-
return nestedValue(item, key2) !== comparisonValue;
|
|
3024
|
-
case "<":
|
|
3025
|
-
return nestedValue(item, key2) < comparisonValue;
|
|
3026
|
-
case "<=":
|
|
3027
|
-
return nestedValue(item, key2) <= comparisonValue;
|
|
3028
|
-
case ">":
|
|
3029
|
-
return nestedValue(item, key2) > comparisonValue;
|
|
3030
|
-
case ">=":
|
|
3031
|
-
return nestedValue(item, key2) >= comparisonValue;
|
|
3032
|
-
}
|
|
3033
|
-
});
|
|
3034
|
-
return new this.constructor(collection);
|
|
3035
|
-
};
|
|
3036
|
-
});
|
|
3037
|
-
|
|
3038
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whereBetween.js
|
|
3039
|
-
var require_whereBetween = __commonJS((exports, module) => {
|
|
3040
|
-
module.exports = function whereBetween(key2, values) {
|
|
3041
|
-
return this.where(key2, ">=", values[0]).where(key2, "<=", values[values.length - 1]);
|
|
3042
|
-
};
|
|
3043
|
-
});
|
|
3044
|
-
|
|
3045
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whereIn.js
|
|
3046
|
-
var require_whereIn = __commonJS((exports, module) => {
|
|
3047
|
-
var extractValues = require_values();
|
|
3048
|
-
var nestedValue = require_nestedValue();
|
|
3049
|
-
module.exports = function whereIn(key2, values) {
|
|
3050
|
-
var items = extractValues(values);
|
|
3051
|
-
var collection = this.items.filter(function(item) {
|
|
3052
|
-
return items.indexOf(nestedValue(item, key2)) !== -1;
|
|
3053
|
-
});
|
|
3054
|
-
return new this.constructor(collection);
|
|
3055
|
-
};
|
|
3056
|
-
});
|
|
3057
|
-
|
|
3058
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whereInstanceOf.js
|
|
3059
|
-
var require_whereInstanceOf = __commonJS((exports, module) => {
|
|
3060
|
-
module.exports = function whereInstanceOf(type) {
|
|
3061
|
-
return this.filter(function(item) {
|
|
3062
|
-
return item instanceof type;
|
|
3063
|
-
});
|
|
3064
|
-
};
|
|
3065
|
-
});
|
|
3066
|
-
|
|
3067
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whereNotBetween.js
|
|
3068
|
-
var require_whereNotBetween = __commonJS((exports, module) => {
|
|
3069
|
-
var nestedValue = require_nestedValue();
|
|
3070
|
-
module.exports = function whereNotBetween(key2, values) {
|
|
3071
|
-
return this.filter(function(item) {
|
|
3072
|
-
return nestedValue(item, key2) < values[0] || nestedValue(item, key2) > values[values.length - 1];
|
|
3073
|
-
});
|
|
3074
|
-
};
|
|
3075
|
-
});
|
|
3076
|
-
|
|
3077
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whereNotIn.js
|
|
3078
|
-
var require_whereNotIn = __commonJS((exports, module) => {
|
|
3079
|
-
var extractValues = require_values();
|
|
3080
|
-
var nestedValue = require_nestedValue();
|
|
3081
|
-
module.exports = function whereNotIn(key2, values) {
|
|
3082
|
-
var items = extractValues(values);
|
|
3083
|
-
var collection = this.items.filter(function(item) {
|
|
3084
|
-
return items.indexOf(nestedValue(item, key2)) === -1;
|
|
3085
|
-
});
|
|
3086
|
-
return new this.constructor(collection);
|
|
3087
|
-
};
|
|
3088
|
-
});
|
|
3089
|
-
|
|
3090
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whereNull.js
|
|
3091
|
-
var require_whereNull = __commonJS((exports, module) => {
|
|
3092
|
-
module.exports = function whereNull() {
|
|
3093
|
-
var key2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
3094
|
-
return this.where(key2, "===", null);
|
|
3095
|
-
};
|
|
3096
|
-
});
|
|
3097
|
-
|
|
3098
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/whereNotNull.js
|
|
3099
|
-
var require_whereNotNull = __commonJS((exports, module) => {
|
|
3100
|
-
module.exports = function whereNotNull() {
|
|
3101
|
-
var key2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
3102
|
-
return this.where(key2, "!==", null);
|
|
3103
|
-
};
|
|
3104
|
-
});
|
|
3105
|
-
|
|
3106
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/wrap.js
|
|
3107
|
-
var require_wrap = __commonJS((exports, module) => {
|
|
3108
|
-
var _typeof = function(obj) {
|
|
3109
|
-
"@babel/helpers - typeof";
|
|
3110
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
3111
|
-
return typeof obj2;
|
|
3112
|
-
} : function(obj2) {
|
|
3113
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
3114
|
-
}, _typeof(obj);
|
|
3115
|
-
};
|
|
3116
|
-
module.exports = function wrap(value) {
|
|
3117
|
-
if (value instanceof this.constructor) {
|
|
3118
|
-
return value;
|
|
3119
|
-
}
|
|
3120
|
-
if (_typeof(value) === "object") {
|
|
3121
|
-
return new this.constructor(value);
|
|
3122
|
-
}
|
|
3123
|
-
return new this.constructor([value]);
|
|
3124
|
-
};
|
|
3125
|
-
});
|
|
3126
|
-
|
|
3127
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/methods/zip.js
|
|
3128
|
-
var require_zip = __commonJS((exports, module) => {
|
|
3129
|
-
module.exports = function zip(array) {
|
|
3130
|
-
var _this = this;
|
|
3131
|
-
var values = array;
|
|
3132
|
-
if (values instanceof this.constructor) {
|
|
3133
|
-
values = values.all();
|
|
3134
|
-
}
|
|
3135
|
-
var collection = this.items.map(function(item, index) {
|
|
3136
|
-
return new _this.constructor([item, values[index]]);
|
|
3137
|
-
});
|
|
3138
|
-
return new this.constructor(collection);
|
|
3139
|
-
};
|
|
3140
|
-
});
|
|
3141
|
-
|
|
3142
|
-
// /home/runner/work/stacks/stacks/node_modules/collect.js/dist/index.js
|
|
3143
|
-
var require_dist = __commonJS((exports, module) => {
|
|
3144
|
-
var _typeof = function(obj) {
|
|
3145
|
-
"@babel/helpers - typeof";
|
|
3146
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
|
|
3147
|
-
return typeof obj2;
|
|
3148
|
-
} : function(obj2) {
|
|
3149
|
-
return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
3150
|
-
}, _typeof(obj);
|
|
3151
|
-
};
|
|
3152
|
-
var Collection = function(collection) {
|
|
3153
|
-
if (collection !== undefined && !Array.isArray(collection) && _typeof(collection) !== "object") {
|
|
3154
|
-
this.items = [collection];
|
|
3155
|
-
} else if (collection instanceof this.constructor) {
|
|
3156
|
-
this.items = collection.all();
|
|
3157
|
-
} else {
|
|
3158
|
-
this.items = collection || [];
|
|
3159
|
-
}
|
|
3160
|
-
};
|
|
3161
|
-
var SymbolIterator = require_symbol_iterator();
|
|
3162
|
-
if (typeof Symbol !== "undefined") {
|
|
3163
|
-
Collection.prototype[Symbol.iterator] = SymbolIterator;
|
|
3164
|
-
}
|
|
3165
|
-
Collection.prototype.toJSON = function toJSON() {
|
|
3166
|
-
return this.items;
|
|
3167
|
-
};
|
|
3168
|
-
Collection.prototype.all = require_all();
|
|
3169
|
-
Collection.prototype.average = require_average();
|
|
3170
|
-
Collection.prototype.avg = require_avg();
|
|
3171
|
-
Collection.prototype.chunk = require_chunk();
|
|
3172
|
-
Collection.prototype.collapse = require_collapse();
|
|
3173
|
-
Collection.prototype.combine = require_combine();
|
|
3174
|
-
Collection.prototype.concat = require_concat();
|
|
3175
|
-
Collection.prototype.contains = require_contains();
|
|
3176
|
-
Collection.prototype.containsOneItem = require_containsOneItem();
|
|
3177
|
-
Collection.prototype.count = require_count();
|
|
3178
|
-
Collection.prototype.countBy = require_countBy();
|
|
3179
|
-
Collection.prototype.crossJoin = require_crossJoin();
|
|
3180
|
-
Collection.prototype.dd = require_dd();
|
|
3181
|
-
Collection.prototype.diff = require_diff();
|
|
3182
|
-
Collection.prototype.diffAssoc = require_diffAssoc();
|
|
3183
|
-
Collection.prototype.diffKeys = require_diffKeys();
|
|
3184
|
-
Collection.prototype.diffUsing = require_diffUsing();
|
|
3185
|
-
Collection.prototype.doesntContain = require_doesntContain();
|
|
3186
|
-
Collection.prototype.dump = require_dump();
|
|
3187
|
-
Collection.prototype.duplicates = require_duplicates();
|
|
3188
|
-
Collection.prototype.each = require_each();
|
|
3189
|
-
Collection.prototype.eachSpread = require_eachSpread();
|
|
3190
|
-
Collection.prototype.every = require_every();
|
|
3191
|
-
Collection.prototype.except = require_except();
|
|
3192
|
-
Collection.prototype.filter = require_filter();
|
|
3193
|
-
Collection.prototype.first = require_first();
|
|
3194
|
-
Collection.prototype.firstOrFail = require_firstOrFail();
|
|
3195
|
-
Collection.prototype.firstWhere = require_firstWhere();
|
|
3196
|
-
Collection.prototype.flatMap = require_flatMap();
|
|
3197
|
-
Collection.prototype.flatten = require_flatten();
|
|
3198
|
-
Collection.prototype.flip = require_flip();
|
|
3199
|
-
Collection.prototype.forPage = require_forPage();
|
|
3200
|
-
Collection.prototype.forget = require_forget();
|
|
3201
|
-
Collection.prototype.get = require_get();
|
|
3202
|
-
Collection.prototype.groupBy = require_groupBy();
|
|
3203
|
-
Collection.prototype.has = require_has();
|
|
3204
|
-
Collection.prototype.implode = require_implode();
|
|
3205
|
-
Collection.prototype.intersect = require_intersect();
|
|
3206
|
-
Collection.prototype.intersectByKeys = require_intersectByKeys();
|
|
3207
|
-
Collection.prototype.isEmpty = require_isEmpty();
|
|
3208
|
-
Collection.prototype.isNotEmpty = require_isNotEmpty();
|
|
3209
|
-
Collection.prototype.join = require_join();
|
|
3210
|
-
Collection.prototype.keyBy = require_keyBy();
|
|
3211
|
-
Collection.prototype.keys = require_keys();
|
|
3212
|
-
Collection.prototype.last = require_last();
|
|
3213
|
-
Collection.prototype.macro = require_macro();
|
|
3214
|
-
Collection.prototype.make = require_make();
|
|
3215
|
-
Collection.prototype.map = require_map();
|
|
3216
|
-
Collection.prototype.mapSpread = require_mapSpread();
|
|
3217
|
-
Collection.prototype.mapToDictionary = require_mapToDictionary();
|
|
3218
|
-
Collection.prototype.mapInto = require_mapInto();
|
|
3219
|
-
Collection.prototype.mapToGroups = require_mapToGroups();
|
|
3220
|
-
Collection.prototype.mapWithKeys = require_mapWithKeys();
|
|
3221
|
-
Collection.prototype.max = require_max();
|
|
3222
|
-
Collection.prototype.median = require_median();
|
|
3223
|
-
Collection.prototype.merge = require_merge();
|
|
3224
|
-
Collection.prototype.mergeRecursive = require_mergeRecursive();
|
|
3225
|
-
Collection.prototype.min = require_min();
|
|
3226
|
-
Collection.prototype.mode = require_mode();
|
|
3227
|
-
Collection.prototype.nth = require_nth();
|
|
3228
|
-
Collection.prototype.only = require_only();
|
|
3229
|
-
Collection.prototype.pad = require_pad();
|
|
3230
|
-
Collection.prototype.partition = require_partition();
|
|
3231
|
-
Collection.prototype.pipe = require_pipe();
|
|
3232
|
-
Collection.prototype.pluck = require_pluck();
|
|
3233
|
-
Collection.prototype.pop = require_pop();
|
|
3234
|
-
Collection.prototype.prepend = require_prepend();
|
|
3235
|
-
Collection.prototype.pull = require_pull();
|
|
3236
|
-
Collection.prototype.push = require_push();
|
|
3237
|
-
Collection.prototype.put = require_put();
|
|
3238
|
-
Collection.prototype.random = require_random();
|
|
3239
|
-
Collection.prototype.reduce = require_reduce();
|
|
3240
|
-
Collection.prototype.reject = require_reject();
|
|
3241
|
-
Collection.prototype.replace = require_replace();
|
|
3242
|
-
Collection.prototype.replaceRecursive = require_replaceRecursive();
|
|
3243
|
-
Collection.prototype.reverse = require_reverse();
|
|
3244
|
-
Collection.prototype.search = require_search();
|
|
3245
|
-
Collection.prototype.shift = require_shift();
|
|
3246
|
-
Collection.prototype.shuffle = require_shuffle();
|
|
3247
|
-
Collection.prototype.skip = require_skip();
|
|
3248
|
-
Collection.prototype.skipUntil = require_skipUntil();
|
|
3249
|
-
Collection.prototype.skipWhile = require_skipWhile();
|
|
3250
|
-
Collection.prototype.slice = require_slice();
|
|
3251
|
-
Collection.prototype.sole = require_sole();
|
|
3252
|
-
Collection.prototype.some = require_some();
|
|
3253
|
-
Collection.prototype.sort = require_sort();
|
|
3254
|
-
Collection.prototype.sortDesc = require_sortDesc();
|
|
3255
|
-
Collection.prototype.sortBy = require_sortBy();
|
|
3256
|
-
Collection.prototype.sortByDesc = require_sortByDesc();
|
|
3257
|
-
Collection.prototype.sortKeys = require_sortKeys();
|
|
3258
|
-
Collection.prototype.sortKeysDesc = require_sortKeysDesc();
|
|
3259
|
-
Collection.prototype.splice = require_splice();
|
|
3260
|
-
Collection.prototype.split = require_split();
|
|
3261
|
-
Collection.prototype.sum = require_sum();
|
|
3262
|
-
Collection.prototype.take = require_take();
|
|
3263
|
-
Collection.prototype.takeUntil = require_takeUntil();
|
|
3264
|
-
Collection.prototype.takeWhile = require_takeWhile();
|
|
3265
|
-
Collection.prototype.tap = require_tap();
|
|
3266
|
-
Collection.prototype.times = require_times();
|
|
3267
|
-
Collection.prototype.toArray = require_toArray();
|
|
3268
|
-
Collection.prototype.toJson = require_toJson();
|
|
3269
|
-
Collection.prototype.transform = require_transform();
|
|
3270
|
-
Collection.prototype.undot = require_undot();
|
|
3271
|
-
Collection.prototype.unless = require_unless();
|
|
3272
|
-
Collection.prototype.unlessEmpty = require_whenNotEmpty();
|
|
3273
|
-
Collection.prototype.unlessNotEmpty = require_whenEmpty();
|
|
3274
|
-
Collection.prototype.union = require_union();
|
|
3275
|
-
Collection.prototype.unique = require_unique();
|
|
3276
|
-
Collection.prototype.unwrap = require_unwrap();
|
|
3277
|
-
Collection.prototype.values = require_values2();
|
|
3278
|
-
Collection.prototype.when = require_when();
|
|
3279
|
-
Collection.prototype.whenEmpty = require_whenEmpty();
|
|
3280
|
-
Collection.prototype.whenNotEmpty = require_whenNotEmpty();
|
|
3281
|
-
Collection.prototype.where = require_where();
|
|
3282
|
-
Collection.prototype.whereBetween = require_whereBetween();
|
|
3283
|
-
Collection.prototype.whereIn = require_whereIn();
|
|
3284
|
-
Collection.prototype.whereInstanceOf = require_whereInstanceOf();
|
|
3285
|
-
Collection.prototype.whereNotBetween = require_whereNotBetween();
|
|
3286
|
-
Collection.prototype.whereNotIn = require_whereNotIn();
|
|
3287
|
-
Collection.prototype.whereNull = require_whereNull();
|
|
3288
|
-
Collection.prototype.whereNotNull = require_whereNotNull();
|
|
3289
|
-
Collection.prototype.wrap = require_wrap();
|
|
3290
|
-
Collection.prototype.zip = require_zip();
|
|
3291
|
-
var collect = function collect(collection) {
|
|
3292
|
-
return new Collection(collection);
|
|
3293
|
-
};
|
|
3294
|
-
module.exports = collect;
|
|
3295
|
-
module.exports.collect = collect;
|
|
3296
|
-
module.exports["default"] = collect;
|
|
3297
|
-
module.exports.Collection = Collection;
|
|
3298
|
-
});
|
|
3299
|
-
|
|
3300
|
-
// src/cli.ts
|
|
3301
|
-
import process2 from "process";
|
|
3302
|
-
import {handleError} from "@stacksjs/error-handling";
|
|
3303
|
-
|
|
3304
|
-
// /home/runner/work/stacks/stacks/node_modules/cac/dist/index.mjs
|
|
3305
|
-
import {EventEmitter} from "events";
|
|
3306
|
-
var toArr = function(any) {
|
|
3307
|
-
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
3308
|
-
};
|
|
3309
|
-
var toVal = function(out, key2, val, opts) {
|
|
3310
|
-
var x, old = out[key2], nxt = ~opts.string.indexOf(key2) ? val == null || val === true ? "" : String(val) : typeof val === "boolean" ? val : ~opts.boolean.indexOf(key2) ? val === "false" ? false : val === "true" || (out._.push((x = +val, x * 0 === 0) ? x : val), !!val) : (x = +val, x * 0 === 0) ? x : val;
|
|
3311
|
-
out[key2] = old == null ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
|
|
3312
|
-
};
|
|
3313
|
-
var mri2 = function(args, opts) {
|
|
3314
|
-
args = args || [];
|
|
3315
|
-
opts = opts || {};
|
|
3316
|
-
var k, arr, arg, name, val, out = { _: [] };
|
|
3317
|
-
var i = 0, j = 0, idx = 0, len = args.length;
|
|
3318
|
-
const alibi = opts.alias !== undefined;
|
|
3319
|
-
const strict = opts.unknown !== undefined;
|
|
3320
|
-
const defaults = opts.default !== undefined;
|
|
3321
|
-
opts.alias = opts.alias || {};
|
|
3322
|
-
opts.string = toArr(opts.string);
|
|
3323
|
-
opts.boolean = toArr(opts.boolean);
|
|
3324
|
-
if (alibi) {
|
|
3325
|
-
for (k in opts.alias) {
|
|
3326
|
-
arr = opts.alias[k] = toArr(opts.alias[k]);
|
|
3327
|
-
for (i = 0;i < arr.length; i++) {
|
|
3328
|
-
(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
|
3329
|
-
}
|
|
3330
|
-
}
|
|
3331
|
-
}
|
|
3332
|
-
for (i = opts.boolean.length;i-- > 0; ) {
|
|
3333
|
-
arr = opts.alias[opts.boolean[i]] || [];
|
|
3334
|
-
for (j = arr.length;j-- > 0; )
|
|
3335
|
-
opts.boolean.push(arr[j]);
|
|
3336
|
-
}
|
|
3337
|
-
for (i = opts.string.length;i-- > 0; ) {
|
|
3338
|
-
arr = opts.alias[opts.string[i]] || [];
|
|
3339
|
-
for (j = arr.length;j-- > 0; )
|
|
3340
|
-
opts.string.push(arr[j]);
|
|
3341
|
-
}
|
|
3342
|
-
if (defaults) {
|
|
3343
|
-
for (k in opts.default) {
|
|
3344
|
-
name = typeof opts.default[k];
|
|
3345
|
-
arr = opts.alias[k] = opts.alias[k] || [];
|
|
3346
|
-
if (opts[name] !== undefined) {
|
|
3347
|
-
opts[name].push(k);
|
|
3348
|
-
for (i = 0;i < arr.length; i++) {
|
|
3349
|
-
opts[name].push(arr[i]);
|
|
3350
|
-
}
|
|
3351
|
-
}
|
|
3352
|
-
}
|
|
3353
|
-
}
|
|
3354
|
-
const keys = strict ? Object.keys(opts.alias) : [];
|
|
3355
|
-
for (i = 0;i < len; i++) {
|
|
3356
|
-
arg = args[i];
|
|
3357
|
-
if (arg === "--") {
|
|
3358
|
-
out._ = out._.concat(args.slice(++i));
|
|
3359
|
-
break;
|
|
3360
|
-
}
|
|
3361
|
-
for (j = 0;j < arg.length; j++) {
|
|
3362
|
-
if (arg.charCodeAt(j) !== 45)
|
|
3363
|
-
break;
|
|
3364
|
-
}
|
|
3365
|
-
if (j === 0) {
|
|
3366
|
-
out._.push(arg);
|
|
3367
|
-
} else if (arg.substring(j, j + 3) === "no-") {
|
|
3368
|
-
name = arg.substring(j + 3);
|
|
3369
|
-
if (strict && !~keys.indexOf(name)) {
|
|
3370
|
-
return opts.unknown(arg);
|
|
3371
|
-
}
|
|
3372
|
-
out[name] = false;
|
|
3373
|
-
} else {
|
|
3374
|
-
for (idx = j + 1;idx < arg.length; idx++) {
|
|
3375
|
-
if (arg.charCodeAt(idx) === 61)
|
|
3376
|
-
break;
|
|
3377
|
-
}
|
|
3378
|
-
name = arg.substring(j, idx);
|
|
3379
|
-
val = arg.substring(++idx) || (i + 1 === len || ("" + args[i + 1]).charCodeAt(0) === 45 || args[++i]);
|
|
3380
|
-
arr = j === 2 ? [name] : name;
|
|
3381
|
-
for (idx = 0;idx < arr.length; idx++) {
|
|
3382
|
-
name = arr[idx];
|
|
3383
|
-
if (strict && !~keys.indexOf(name))
|
|
3384
|
-
return opts.unknown("-".repeat(j) + name);
|
|
3385
|
-
toVal(out, name, idx + 1 < arr.length || val, opts);
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
}
|
|
3389
|
-
if (defaults) {
|
|
3390
|
-
for (k in opts.default) {
|
|
3391
|
-
if (out[k] === undefined) {
|
|
3392
|
-
out[k] = opts.default[k];
|
|
3393
|
-
}
|
|
3394
|
-
}
|
|
3395
|
-
}
|
|
3396
|
-
if (alibi) {
|
|
3397
|
-
for (k in out) {
|
|
3398
|
-
arr = opts.alias[k] || [];
|
|
3399
|
-
while (arr.length > 0) {
|
|
3400
|
-
out[arr.shift()] = out[k];
|
|
3401
|
-
}
|
|
3402
|
-
}
|
|
3403
|
-
}
|
|
3404
|
-
return out;
|
|
3405
|
-
};
|
|
3406
|
-
var removeBrackets = (v) => v.replace(/[<[].+/, "").trim();
|
|
3407
|
-
var findAllBrackets = (v) => {
|
|
3408
|
-
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
|
|
3409
|
-
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
|
|
3410
|
-
const res = [];
|
|
3411
|
-
const parse = (match) => {
|
|
3412
|
-
let variadic = false;
|
|
3413
|
-
let value = match[1];
|
|
3414
|
-
if (value.startsWith("...")) {
|
|
3415
|
-
value = value.slice(3);
|
|
3416
|
-
variadic = true;
|
|
3417
|
-
}
|
|
3418
|
-
return {
|
|
3419
|
-
required: match[0].startsWith("<"),
|
|
3420
|
-
value,
|
|
3421
|
-
variadic
|
|
3422
|
-
};
|
|
3423
|
-
};
|
|
3424
|
-
let angledMatch;
|
|
3425
|
-
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) {
|
|
3426
|
-
res.push(parse(angledMatch));
|
|
3427
|
-
}
|
|
3428
|
-
let squareMatch;
|
|
3429
|
-
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) {
|
|
3430
|
-
res.push(parse(squareMatch));
|
|
3431
|
-
}
|
|
3432
|
-
return res;
|
|
3433
|
-
};
|
|
3434
|
-
var getMriOptions = (options) => {
|
|
3435
|
-
const result = { alias: {}, boolean: [] };
|
|
3436
|
-
for (const [index, option] of options.entries()) {
|
|
3437
|
-
if (option.names.length > 1) {
|
|
3438
|
-
result.alias[option.names[0]] = option.names.slice(1);
|
|
3439
|
-
}
|
|
3440
|
-
if (option.isBoolean) {
|
|
3441
|
-
if (option.negated) {
|
|
3442
|
-
const hasStringTypeOption = options.some((o, i) => {
|
|
3443
|
-
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
|
3444
|
-
});
|
|
3445
|
-
if (!hasStringTypeOption) {
|
|
3446
|
-
result.boolean.push(option.names[0]);
|
|
3447
|
-
}
|
|
3448
|
-
} else {
|
|
3449
|
-
result.boolean.push(option.names[0]);
|
|
3450
|
-
}
|
|
3451
|
-
}
|
|
3452
|
-
}
|
|
3453
|
-
return result;
|
|
3454
|
-
};
|
|
3455
|
-
var findLongest = (arr) => {
|
|
3456
|
-
return arr.sort((a, b) => {
|
|
3457
|
-
return a.length > b.length ? -1 : 1;
|
|
3458
|
-
})[0];
|
|
3459
|
-
};
|
|
3460
|
-
var padRight = (str, length) => {
|
|
3461
|
-
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
|
3462
|
-
};
|
|
3463
|
-
var camelcase = (input) => {
|
|
3464
|
-
return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
|
|
3465
|
-
return p1 + p2.toUpperCase();
|
|
3466
|
-
});
|
|
3467
|
-
};
|
|
3468
|
-
var setDotProp = (obj, keys, val) => {
|
|
3469
|
-
let i = 0;
|
|
3470
|
-
let length = keys.length;
|
|
3471
|
-
let t = obj;
|
|
3472
|
-
let x;
|
|
3473
|
-
for (;i < length; ++i) {
|
|
3474
|
-
x = t[keys[i]];
|
|
3475
|
-
t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
|
|
3476
|
-
}
|
|
3477
|
-
};
|
|
3478
|
-
var setByType = (obj, transforms) => {
|
|
3479
|
-
for (const key2 of Object.keys(transforms)) {
|
|
3480
|
-
const transform = transforms[key2];
|
|
3481
|
-
if (transform.shouldTransform) {
|
|
3482
|
-
obj[key2] = Array.prototype.concat.call([], obj[key2]);
|
|
3483
|
-
if (typeof transform.transformFunction === "function") {
|
|
3484
|
-
obj[key2] = obj[key2].map(transform.transformFunction);
|
|
3485
|
-
}
|
|
3486
|
-
}
|
|
3487
|
-
}
|
|
3488
|
-
};
|
|
3489
|
-
var getFileName = (input) => {
|
|
3490
|
-
const m = /([^\\\/]+)$/.exec(input);
|
|
3491
|
-
return m ? m[1] : "";
|
|
3492
|
-
};
|
|
3493
|
-
var camelcaseOptionName = (name) => {
|
|
3494
|
-
return name.split(".").map((v, i) => {
|
|
3495
|
-
return i === 0 ? camelcase(v) : v;
|
|
3496
|
-
}).join(".");
|
|
3497
|
-
};
|
|
3498
|
-
|
|
3499
|
-
class CACError extends Error {
|
|
3500
|
-
constructor(message) {
|
|
3501
|
-
super(message);
|
|
3502
|
-
this.name = this.constructor.name;
|
|
3503
|
-
if (typeof Error.captureStackTrace === "function") {
|
|
3504
|
-
Error.captureStackTrace(this, this.constructor);
|
|
3505
|
-
} else {
|
|
3506
|
-
this.stack = new Error(message).stack;
|
|
3507
|
-
}
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
|
|
3511
|
-
class Option {
|
|
3512
|
-
constructor(rawName, description, config) {
|
|
3513
|
-
this.rawName = rawName;
|
|
3514
|
-
this.description = description;
|
|
3515
|
-
this.config = Object.assign({}, config);
|
|
3516
|
-
rawName = rawName.replace(/\.\*/g, "");
|
|
3517
|
-
this.negated = false;
|
|
3518
|
-
this.names = removeBrackets(rawName).split(",").map((v) => {
|
|
3519
|
-
let name = v.trim().replace(/^-{1,2}/, "");
|
|
3520
|
-
if (name.startsWith("no-")) {
|
|
3521
|
-
this.negated = true;
|
|
3522
|
-
name = name.replace(/^no-/, "");
|
|
3523
|
-
}
|
|
3524
|
-
return camelcaseOptionName(name);
|
|
3525
|
-
}).sort((a, b) => a.length > b.length ? 1 : -1);
|
|
3526
|
-
this.name = this.names[this.names.length - 1];
|
|
3527
|
-
if (this.negated && this.config.default == null) {
|
|
3528
|
-
this.config.default = true;
|
|
3529
|
-
}
|
|
3530
|
-
if (rawName.includes("<")) {
|
|
3531
|
-
this.required = true;
|
|
3532
|
-
} else if (rawName.includes("[")) {
|
|
3533
|
-
this.required = false;
|
|
3534
|
-
} else {
|
|
3535
|
-
this.isBoolean = true;
|
|
3536
|
-
}
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3539
|
-
var processArgs = process.argv;
|
|
3540
|
-
var platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
|
|
3541
|
-
|
|
3542
|
-
class Command {
|
|
3543
|
-
constructor(rawName, description, config = {}, cli) {
|
|
3544
|
-
this.rawName = rawName;
|
|
3545
|
-
this.description = description;
|
|
3546
|
-
this.config = config;
|
|
3547
|
-
this.cli = cli;
|
|
3548
|
-
this.options = [];
|
|
3549
|
-
this.aliasNames = [];
|
|
3550
|
-
this.name = removeBrackets(rawName);
|
|
3551
|
-
this.args = findAllBrackets(rawName);
|
|
3552
|
-
this.examples = [];
|
|
3553
|
-
}
|
|
3554
|
-
usage(text) {
|
|
3555
|
-
this.usageText = text;
|
|
3556
|
-
return this;
|
|
3557
|
-
}
|
|
3558
|
-
allowUnknownOptions() {
|
|
3559
|
-
this.config.allowUnknownOptions = true;
|
|
3560
|
-
return this;
|
|
3561
|
-
}
|
|
3562
|
-
ignoreOptionDefaultValue() {
|
|
3563
|
-
this.config.ignoreOptionDefaultValue = true;
|
|
3564
|
-
return this;
|
|
3565
|
-
}
|
|
3566
|
-
version(version, customFlags = "-v, --version") {
|
|
3567
|
-
this.versionNumber = version;
|
|
3568
|
-
this.option(customFlags, "Display version number");
|
|
3569
|
-
return this;
|
|
3570
|
-
}
|
|
3571
|
-
example(example) {
|
|
3572
|
-
this.examples.push(example);
|
|
3573
|
-
return this;
|
|
3574
|
-
}
|
|
3575
|
-
option(rawName, description, config) {
|
|
3576
|
-
const option = new Option(rawName, description, config);
|
|
3577
|
-
this.options.push(option);
|
|
3578
|
-
return this;
|
|
3579
|
-
}
|
|
3580
|
-
alias(name) {
|
|
3581
|
-
this.aliasNames.push(name);
|
|
3582
|
-
return this;
|
|
3583
|
-
}
|
|
3584
|
-
action(callback) {
|
|
3585
|
-
this.commandAction = callback;
|
|
3586
|
-
return this;
|
|
3587
|
-
}
|
|
3588
|
-
isMatched(name) {
|
|
3589
|
-
return this.name === name || this.aliasNames.includes(name);
|
|
3590
|
-
}
|
|
3591
|
-
get isDefaultCommand() {
|
|
3592
|
-
return this.name === "" || this.aliasNames.includes("!");
|
|
3593
|
-
}
|
|
3594
|
-
get isGlobalCommand() {
|
|
3595
|
-
return this instanceof GlobalCommand;
|
|
3596
|
-
}
|
|
3597
|
-
hasOption(name) {
|
|
3598
|
-
name = name.split(".")[0];
|
|
3599
|
-
return this.options.find((option) => {
|
|
3600
|
-
return option.names.includes(name);
|
|
3601
|
-
});
|
|
3602
|
-
}
|
|
3603
|
-
outputHelp() {
|
|
3604
|
-
const { name, commands } = this.cli;
|
|
3605
|
-
const {
|
|
3606
|
-
versionNumber,
|
|
3607
|
-
options: globalOptions,
|
|
3608
|
-
helpCallback
|
|
3609
|
-
} = this.cli.globalCommand;
|
|
3610
|
-
let sections = [
|
|
3611
|
-
{
|
|
3612
|
-
body: `${name}${versionNumber ? `/${versionNumber}` : ""}`
|
|
3613
|
-
}
|
|
3614
|
-
];
|
|
3615
|
-
sections.push({
|
|
3616
|
-
title: "Usage",
|
|
3617
|
-
body: ` \$ ${name} ${this.usageText || this.rawName}`
|
|
3618
|
-
});
|
|
3619
|
-
const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0;
|
|
3620
|
-
if (showCommands) {
|
|
3621
|
-
const longestCommandName = findLongest(commands.map((command) => command.rawName));
|
|
3622
|
-
sections.push({
|
|
3623
|
-
title: "Commands",
|
|
3624
|
-
body: commands.map((command) => {
|
|
3625
|
-
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
|
|
3626
|
-
}).join("\n")
|
|
3627
|
-
});
|
|
3628
|
-
sections.push({
|
|
3629
|
-
title: `For more info, run any command with the \`--help\` flag`,
|
|
3630
|
-
body: commands.map((command) => ` \$ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
|
|
3631
|
-
});
|
|
3632
|
-
}
|
|
3633
|
-
let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []];
|
|
3634
|
-
if (!this.isGlobalCommand && !this.isDefaultCommand) {
|
|
3635
|
-
options = options.filter((option) => option.name !== "version");
|
|
3636
|
-
}
|
|
3637
|
-
if (options.length > 0) {
|
|
3638
|
-
const longestOptionName = findLongest(options.map((option) => option.rawName));
|
|
3639
|
-
sections.push({
|
|
3640
|
-
title: "Options",
|
|
3641
|
-
body: options.map((option) => {
|
|
3642
|
-
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === undefined ? "" : `(default: ${option.config.default})`}`;
|
|
3643
|
-
}).join("\n")
|
|
3644
|
-
});
|
|
3645
|
-
}
|
|
3646
|
-
if (this.examples.length > 0) {
|
|
3647
|
-
sections.push({
|
|
3648
|
-
title: "Examples",
|
|
3649
|
-
body: this.examples.map((example) => {
|
|
3650
|
-
if (typeof example === "function") {
|
|
3651
|
-
return example(name);
|
|
3652
|
-
}
|
|
3653
|
-
return example;
|
|
3654
|
-
}).join("\n")
|
|
3655
|
-
});
|
|
3656
|
-
}
|
|
3657
|
-
if (helpCallback) {
|
|
3658
|
-
sections = helpCallback(sections) || sections;
|
|
3659
|
-
}
|
|
3660
|
-
console.log(sections.map((section) => {
|
|
3661
|
-
return section.title ? `${section.title}:
|
|
3662
|
-
${section.body}` : section.body;
|
|
3663
|
-
}).join("\n\n"));
|
|
3664
|
-
}
|
|
3665
|
-
outputVersion() {
|
|
3666
|
-
const { name } = this.cli;
|
|
3667
|
-
const { versionNumber } = this.cli.globalCommand;
|
|
3668
|
-
if (versionNumber) {
|
|
3669
|
-
console.log(`${name}/${versionNumber} ${platformInfo}`);
|
|
3670
|
-
}
|
|
3671
|
-
}
|
|
3672
|
-
checkRequiredArgs() {
|
|
3673
|
-
const minimalArgsCount = this.args.filter((arg) => arg.required).length;
|
|
3674
|
-
if (this.cli.args.length < minimalArgsCount) {
|
|
3675
|
-
throw new CACError(`missing required args for command \`${this.rawName}\``);
|
|
3676
|
-
}
|
|
3677
|
-
}
|
|
3678
|
-
checkUnknownOptions() {
|
|
3679
|
-
const { options, globalCommand } = this.cli;
|
|
3680
|
-
if (!this.config.allowUnknownOptions) {
|
|
3681
|
-
for (const name of Object.keys(options)) {
|
|
3682
|
-
if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) {
|
|
3683
|
-
throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
|
|
3684
|
-
}
|
|
3685
|
-
}
|
|
3686
|
-
}
|
|
3687
|
-
}
|
|
3688
|
-
checkOptionValue() {
|
|
3689
|
-
const { options: parsedOptions, globalCommand } = this.cli;
|
|
3690
|
-
const options = [...globalCommand.options, ...this.options];
|
|
3691
|
-
for (const option of options) {
|
|
3692
|
-
const value = parsedOptions[option.name.split(".")[0]];
|
|
3693
|
-
if (option.required) {
|
|
3694
|
-
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
|
|
3695
|
-
if (value === true || value === false && !hasNegated) {
|
|
3696
|
-
throw new CACError(`option \`${option.rawName}\` value is missing`);
|
|
3697
|
-
}
|
|
3698
|
-
}
|
|
3699
|
-
}
|
|
3700
|
-
}
|
|
3701
|
-
}
|
|
3702
|
-
|
|
3703
|
-
class GlobalCommand extends Command {
|
|
3704
|
-
constructor(cli) {
|
|
3705
|
-
super("@@global@@", "", {}, cli);
|
|
3706
|
-
}
|
|
3707
|
-
}
|
|
3708
|
-
var __assign = Object.assign;
|
|
3709
|
-
|
|
3710
|
-
class CAC extends EventEmitter {
|
|
3711
|
-
constructor(name = "") {
|
|
3712
|
-
super();
|
|
3713
|
-
this.name = name;
|
|
3714
|
-
this.commands = [];
|
|
3715
|
-
this.rawArgs = [];
|
|
3716
|
-
this.args = [];
|
|
3717
|
-
this.options = {};
|
|
3718
|
-
this.globalCommand = new GlobalCommand(this);
|
|
3719
|
-
this.globalCommand.usage("<command> [options]");
|
|
3720
|
-
}
|
|
3721
|
-
usage(text) {
|
|
3722
|
-
this.globalCommand.usage(text);
|
|
3723
|
-
return this;
|
|
3724
|
-
}
|
|
3725
|
-
command(rawName, description, config) {
|
|
3726
|
-
const command = new Command(rawName, description || "", config, this);
|
|
3727
|
-
command.globalCommand = this.globalCommand;
|
|
3728
|
-
this.commands.push(command);
|
|
3729
|
-
return command;
|
|
3730
|
-
}
|
|
3731
|
-
option(rawName, description, config) {
|
|
3732
|
-
this.globalCommand.option(rawName, description, config);
|
|
3733
|
-
return this;
|
|
3734
|
-
}
|
|
3735
|
-
help(callback) {
|
|
3736
|
-
this.globalCommand.option("-h, --help", "Display this message");
|
|
3737
|
-
this.globalCommand.helpCallback = callback;
|
|
3738
|
-
this.showHelpOnExit = true;
|
|
3739
|
-
return this;
|
|
3740
|
-
}
|
|
3741
|
-
version(version, customFlags = "-v, --version") {
|
|
3742
|
-
this.globalCommand.version(version, customFlags);
|
|
3743
|
-
this.showVersionOnExit = true;
|
|
3744
|
-
return this;
|
|
3745
|
-
}
|
|
3746
|
-
example(example) {
|
|
3747
|
-
this.globalCommand.example(example);
|
|
3748
|
-
return this;
|
|
3749
|
-
}
|
|
3750
|
-
outputHelp() {
|
|
3751
|
-
if (this.matchedCommand) {
|
|
3752
|
-
this.matchedCommand.outputHelp();
|
|
3753
|
-
} else {
|
|
3754
|
-
this.globalCommand.outputHelp();
|
|
3755
|
-
}
|
|
3756
|
-
}
|
|
3757
|
-
outputVersion() {
|
|
3758
|
-
this.globalCommand.outputVersion();
|
|
3759
|
-
}
|
|
3760
|
-
setParsedInfo({ args, options }, matchedCommand, matchedCommandName) {
|
|
3761
|
-
this.args = args;
|
|
3762
|
-
this.options = options;
|
|
3763
|
-
if (matchedCommand) {
|
|
3764
|
-
this.matchedCommand = matchedCommand;
|
|
3765
|
-
}
|
|
3766
|
-
if (matchedCommandName) {
|
|
3767
|
-
this.matchedCommandName = matchedCommandName;
|
|
3768
|
-
}
|
|
3769
|
-
return this;
|
|
3770
|
-
}
|
|
3771
|
-
unsetMatchedCommand() {
|
|
3772
|
-
this.matchedCommand = undefined;
|
|
3773
|
-
this.matchedCommandName = undefined;
|
|
3774
|
-
}
|
|
3775
|
-
parse(argv = processArgs, {
|
|
3776
|
-
run = true
|
|
3777
|
-
} = {}) {
|
|
3778
|
-
this.rawArgs = argv;
|
|
3779
|
-
if (!this.name) {
|
|
3780
|
-
this.name = argv[1] ? getFileName(argv[1]) : "cli";
|
|
3781
|
-
}
|
|
3782
|
-
let shouldParse = true;
|
|
3783
|
-
for (const command of this.commands) {
|
|
3784
|
-
const parsed = this.mri(argv.slice(2), command);
|
|
3785
|
-
const commandName = parsed.args[0];
|
|
3786
|
-
if (command.isMatched(commandName)) {
|
|
3787
|
-
shouldParse = false;
|
|
3788
|
-
const parsedInfo = __assign(__assign({}, parsed), {
|
|
3789
|
-
args: parsed.args.slice(1)
|
|
3790
|
-
});
|
|
3791
|
-
this.setParsedInfo(parsedInfo, command, commandName);
|
|
3792
|
-
this.emit(`command:${commandName}`, command);
|
|
3793
|
-
}
|
|
3794
|
-
}
|
|
3795
|
-
if (shouldParse) {
|
|
3796
|
-
for (const command of this.commands) {
|
|
3797
|
-
if (command.name === "") {
|
|
3798
|
-
shouldParse = false;
|
|
3799
|
-
const parsed = this.mri(argv.slice(2), command);
|
|
3800
|
-
this.setParsedInfo(parsed, command);
|
|
3801
|
-
this.emit(`command:!`, command);
|
|
3802
|
-
}
|
|
3803
|
-
}
|
|
3804
|
-
}
|
|
3805
|
-
if (shouldParse) {
|
|
3806
|
-
const parsed = this.mri(argv.slice(2));
|
|
3807
|
-
this.setParsedInfo(parsed);
|
|
3808
|
-
}
|
|
3809
|
-
if (this.options.help && this.showHelpOnExit) {
|
|
3810
|
-
this.outputHelp();
|
|
3811
|
-
run = false;
|
|
3812
|
-
this.unsetMatchedCommand();
|
|
3813
|
-
}
|
|
3814
|
-
if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) {
|
|
3815
|
-
this.outputVersion();
|
|
3816
|
-
run = false;
|
|
3817
|
-
this.unsetMatchedCommand();
|
|
3818
|
-
}
|
|
3819
|
-
const parsedArgv = { args: this.args, options: this.options };
|
|
3820
|
-
if (run) {
|
|
3821
|
-
this.runMatchedCommand();
|
|
3822
|
-
}
|
|
3823
|
-
if (!this.matchedCommand && this.args[0]) {
|
|
3824
|
-
this.emit("command:*");
|
|
3825
|
-
}
|
|
3826
|
-
return parsedArgv;
|
|
3827
|
-
}
|
|
3828
|
-
mri(argv, command) {
|
|
3829
|
-
const cliOptions = [
|
|
3830
|
-
...this.globalCommand.options,
|
|
3831
|
-
...command ? command.options : []
|
|
3832
|
-
];
|
|
3833
|
-
const mriOptions = getMriOptions(cliOptions);
|
|
3834
|
-
let argsAfterDoubleDashes = [];
|
|
3835
|
-
const doubleDashesIndex = argv.indexOf("--");
|
|
3836
|
-
if (doubleDashesIndex > -1) {
|
|
3837
|
-
argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
|
|
3838
|
-
argv = argv.slice(0, doubleDashesIndex);
|
|
3839
|
-
}
|
|
3840
|
-
let parsed = mri2(argv, mriOptions);
|
|
3841
|
-
parsed = Object.keys(parsed).reduce((res, name) => {
|
|
3842
|
-
return __assign(__assign({}, res), {
|
|
3843
|
-
[camelcaseOptionName(name)]: parsed[name]
|
|
3844
|
-
});
|
|
3845
|
-
}, { _: [] });
|
|
3846
|
-
const args = parsed._;
|
|
3847
|
-
const options = {
|
|
3848
|
-
"--": argsAfterDoubleDashes
|
|
3849
|
-
};
|
|
3850
|
-
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
|
|
3851
|
-
let transforms = Object.create(null);
|
|
3852
|
-
for (const cliOption of cliOptions) {
|
|
3853
|
-
if (!ignoreDefault && cliOption.config.default !== undefined) {
|
|
3854
|
-
for (const name of cliOption.names) {
|
|
3855
|
-
options[name] = cliOption.config.default;
|
|
3856
|
-
}
|
|
3857
|
-
}
|
|
3858
|
-
if (Array.isArray(cliOption.config.type)) {
|
|
3859
|
-
if (transforms[cliOption.name] === undefined) {
|
|
3860
|
-
transforms[cliOption.name] = Object.create(null);
|
|
3861
|
-
transforms[cliOption.name]["shouldTransform"] = true;
|
|
3862
|
-
transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
|
|
3863
|
-
}
|
|
3864
|
-
}
|
|
3865
|
-
}
|
|
3866
|
-
for (const key2 of Object.keys(parsed)) {
|
|
3867
|
-
if (key2 !== "_") {
|
|
3868
|
-
const keys = key2.split(".");
|
|
3869
|
-
setDotProp(options, keys, parsed[key2]);
|
|
3870
|
-
setByType(options, transforms);
|
|
3871
|
-
}
|
|
3872
|
-
}
|
|
3873
|
-
return {
|
|
3874
|
-
args,
|
|
3875
|
-
options
|
|
3876
|
-
};
|
|
3877
|
-
}
|
|
3878
|
-
runMatchedCommand() {
|
|
3879
|
-
const { args, options, matchedCommand: command } = this;
|
|
3880
|
-
if (!command || !command.commandAction)
|
|
3881
|
-
return;
|
|
3882
|
-
command.checkUnknownOptions();
|
|
3883
|
-
command.checkOptionValue();
|
|
3884
|
-
command.checkRequiredArgs();
|
|
3885
|
-
const actionArgs = [];
|
|
3886
|
-
command.args.forEach((arg, index) => {
|
|
3887
|
-
if (arg.variadic) {
|
|
3888
|
-
actionArgs.push(args.slice(index));
|
|
3889
|
-
} else {
|
|
3890
|
-
actionArgs.push(args[index]);
|
|
3891
|
-
}
|
|
3892
|
-
});
|
|
3893
|
-
actionArgs.push(options);
|
|
3894
|
-
return command.commandAction.apply(this, actionArgs);
|
|
3895
|
-
}
|
|
3896
|
-
}
|
|
25
|
+
upgrade,
|
|
26
|
+
version
|
|
27
|
+
} from "./chunk-1a569f35f66ae151.js";
|
|
28
|
+
import"./chunk-0455e53fab4244b1.js";
|
|
29
|
+
import"./chunk-bf054cfbc9cf2201.js";
|
|
3897
30
|
|
|
3898
31
|
// src/cli.ts
|
|
32
|
+
import process from "process";
|
|
33
|
+
import {log} from "@stacksjs/logging";
|
|
3899
34
|
import {ensureProjectIsInitialized} from "@stacksjs/utils";
|
|
3900
|
-
import {
|
|
3901
|
-
|
|
3902
|
-
// /home/runner/work/stacks/stacks/storage/framework/core/collections/src/index.ts
|
|
3903
|
-
var import_collect = __toESM(require_dist(), 1);
|
|
3904
|
-
|
|
3905
|
-
// src/cli.ts
|
|
35
|
+
import {path as p} from "@stacksjs/path";
|
|
36
|
+
import {fs} from "@stacksjs/storage";
|
|
3906
37
|
async function main() {
|
|
3907
38
|
const buddy = new CAC("buddy");
|
|
3908
39
|
setup(buddy);
|
|
@@ -3910,6 +41,7 @@ async function main() {
|
|
|
3910
41
|
await ensureProjectIsInitialized();
|
|
3911
42
|
build(buddy);
|
|
3912
43
|
changelog(buddy);
|
|
44
|
+
check(buddy);
|
|
3913
45
|
clean(buddy);
|
|
3914
46
|
cloud(buddy);
|
|
3915
47
|
configure(buddy);
|
|
@@ -3917,6 +49,8 @@ async function main() {
|
|
|
3917
49
|
domains(buddy);
|
|
3918
50
|
deploy(buddy);
|
|
3919
51
|
dns(buddy);
|
|
52
|
+
ports(buddy);
|
|
53
|
+
projects(buddy);
|
|
3920
54
|
fresh(buddy);
|
|
3921
55
|
generate(buddy);
|
|
3922
56
|
http(buddy);
|
|
@@ -3925,43 +59,35 @@ async function main() {
|
|
|
3925
59
|
list(buddy);
|
|
3926
60
|
release(buddy);
|
|
3927
61
|
setup(buddy);
|
|
62
|
+
version(buddy);
|
|
3928
63
|
upgrade(buddy);
|
|
3929
|
-
|
|
3930
|
-
"The best way to get started is to quit talking and begin doing.",
|
|
3931
|
-
"The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.",
|
|
3932
|
-
"Don\u2019t let yesterday take up too much of today.",
|
|
3933
|
-
"You learn more from failure than from success. Don\u2019t let it stop you. Failure builds character.",
|
|
3934
|
-
"It\u2019s not whether you get knocked down, it\u2019s whether you get up.",
|
|
3935
|
-
"If you are working on something that you really care about, you don\u2019t have to be pushed. The vision pulls you.",
|
|
3936
|
-
"People who are crazy enough to think they can change the world, are the ones who do.",
|
|
3937
|
-
"Failure will never overtake me if my determination to succeed is strong enough.",
|
|
3938
|
-
"Entrepreneurs are great at dealing with uncertainty and also very good at minimizing risk. That\u2019s the classic entrepreneur.",
|
|
3939
|
-
"We may encounter many defeats but we must not be defeated.",
|
|
3940
|
-
"Knowing is not enough; we must apply. Wishing is not enough; we must do.",
|
|
3941
|
-
"Imagine your life is perfect in every respect; what would it look like?",
|
|
3942
|
-
"We generate fears while we sit. We overcome them by action.",
|
|
3943
|
-
"Whether you think you can or think you can\u2019t, you\u2019re right.",
|
|
3944
|
-
"Security is mostly a superstition. Life is either a daring adventure or nothing."
|
|
3945
|
-
]);
|
|
3946
|
-
buddy.command("inspire", "Inspire yourself with a random quote").alias("insp").action(() => {
|
|
3947
|
-
log.info(quotes.random());
|
|
3948
|
-
log.success("Have a great days!");
|
|
3949
|
-
});
|
|
3950
|
-
buddy.on("inspire:*", () => {
|
|
3951
|
-
console.log("Invalid command:", buddy.args.join(" "));
|
|
3952
|
-
console.log("See `--help` for a list of available commands");
|
|
3953
|
-
throw new Error("Invalid command");
|
|
3954
|
-
});
|
|
64
|
+
await dynamicImports(buddy);
|
|
3955
65
|
buddy.help();
|
|
3956
66
|
buddy.parse();
|
|
3957
67
|
}
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
68
|
+
async function dynamicImports(buddy) {
|
|
69
|
+
const commandsDir = p.appPath("Commands");
|
|
70
|
+
const commandFiles = fs.readdirSync(commandsDir).filter((file) => file.endsWith(".ts"));
|
|
71
|
+
for (const file of commandFiles) {
|
|
72
|
+
const commandPath = `${commandsDir}/${file}`;
|
|
73
|
+
const dynamicImport = await import(commandPath);
|
|
74
|
+
if (typeof dynamicImport.default === "function")
|
|
75
|
+
dynamicImport.default(buddy);
|
|
76
|
+
else
|
|
77
|
+
console.error(`Expected a default export function in ${file}, but got:`, dynamicImport.default);
|
|
78
|
+
}
|
|
79
|
+
const listenerImport = await import(p.listenersPath("Console.ts"));
|
|
80
|
+
if (typeof listenerImport.default === "function")
|
|
81
|
+
listenerImport.default(buddy);
|
|
82
|
+
}
|
|
83
|
+
process.on("uncaughtException", (error) => {
|
|
84
|
+
log.debug("uncaughtException");
|
|
85
|
+
log.error(error);
|
|
86
|
+
process.exit(1);
|
|
87
|
+
});
|
|
88
|
+
process.on("unhandledRejection", (error) => {
|
|
89
|
+
log.debug("unhandledRejection");
|
|
90
|
+
log.error(error);
|
|
91
|
+
process.exit(1);
|
|
3966
92
|
});
|
|
3967
93
|
await main();
|