UNPKG

104 kBJavaScriptView Raw
1/*!
2 * async-af/legacy v7.0.39
3 *
4 * AsyncAF (The asynciest of async libs there ever was or ever will be...AsyncAF!?)
5 * (https://async-af.js.org/AsyncAF)
6 *
7 * Copyright (c) 2017-present, Scott Rudiger (https://github.com/ScottRudiger)
8 *
9 * This source code is licensed under the MIT license found in this library's
10 * GitHub repository (https://github.com/AsyncAF/AsyncAF/blob/master/LICENSE).
11 */
12(function webpackUniversalModuleDefinition(root, factory) {
13 if(typeof exports === 'object' && typeof module === 'object')
14 module.exports = factory();
15 else if(typeof define === 'function' && define.amd)
16 define("AsyncAF", [], factory);
17 else if(typeof exports === 'object')
18 exports["AsyncAF"] = factory();
19 else
20 root["AsyncAF"] = factory();
21})(typeof self !== 'undefined' ? self : this, function() {
22return /******/ (function(modules) { // webpackBootstrap
23/******/ // The module cache
24/******/ var installedModules = {};
25/******/
26/******/ // The require function
27/******/ function __webpack_require__(moduleId) {
28/******/
29/******/ // Check if module is in cache
30/******/ if(installedModules[moduleId]) {
31/******/ return installedModules[moduleId].exports;
32/******/ }
33/******/ // Create a new module (and put it into the cache)
34/******/ var module = installedModules[moduleId] = {
35/******/ i: moduleId,
36/******/ l: false,
37/******/ exports: {}
38/******/ };
39/******/
40/******/ // Execute the module function
41/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
42/******/
43/******/ // Flag the module as loaded
44/******/ module.l = true;
45/******/
46/******/ // Return the exports of the module
47/******/ return module.exports;
48/******/ }
49/******/
50/******/
51/******/ // expose the modules object (__webpack_modules__)
52/******/ __webpack_require__.m = modules;
53/******/
54/******/ // expose the module cache
55/******/ __webpack_require__.c = installedModules;
56/******/
57/******/ // define getter function for harmony exports
58/******/ __webpack_require__.d = function(exports, name, getter) {
59/******/ if(!__webpack_require__.o(exports, name)) {
60/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
61/******/ }
62/******/ };
63/******/
64/******/ // define __esModule on exports
65/******/ __webpack_require__.r = function(exports) {
66/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
67/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
68/******/ }
69/******/ Object.defineProperty(exports, '__esModule', { value: true });
70/******/ };
71/******/
72/******/ // create a fake namespace object
73/******/ // mode & 1: value is a module id, require it
74/******/ // mode & 2: merge all properties of value into the ns
75/******/ // mode & 4: return value when already ns object
76/******/ // mode & 8|1: behave like require
77/******/ __webpack_require__.t = function(value, mode) {
78/******/ if(mode & 1) value = __webpack_require__(value);
79/******/ if(mode & 8) return value;
80/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
81/******/ var ns = Object.create(null);
82/******/ __webpack_require__.r(ns);
83/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
84/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
85/******/ return ns;
86/******/ };
87/******/
88/******/ // getDefaultExport function for compatibility with non-harmony modules
89/******/ __webpack_require__.n = function(module) {
90/******/ var getter = module && module.__esModule ?
91/******/ function getDefault() { return module['default']; } :
92/******/ function getModuleExports() { return module; };
93/******/ __webpack_require__.d(getter, 'a', getter);
94/******/ return getter;
95/******/ };
96/******/
97/******/ // Object.prototype.hasOwnProperty.call
98/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
99/******/
100/******/ // __webpack_public_path__
101/******/ __webpack_require__.p = "";
102/******/
103/******/
104/******/ // Load entry module and return exports
105/******/ return __webpack_require__(__webpack_require__.s = "./lib/classes/AsyncAF.js");
106/******/ })
107/************************************************************************/
108/******/ ({
109
110/***/ "./lib/classes/AsyncAF.js":
111/***/ (function(module, __webpack_exports__, __webpack_require__) {
112
113"use strict";
114
115// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
116var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js");
117var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
118
119// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js
120var taggedTemplateLiteral = __webpack_require__("./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js");
121var taggedTemplateLiteral_default = /*#__PURE__*/__webpack_require__.n(taggedTemplateLiteral);
122
123// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
124var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js");
125var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
126
127// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js
128var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js");
129var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
130
131// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
132var possibleConstructorReturn = __webpack_require__("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
133var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
134
135// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js
136var getPrototypeOf = __webpack_require__("./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
137var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
138
139// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js
140var inherits = __webpack_require__("./node_modules/@babel/runtime/helpers/inherits.js");
141var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
142
143// EXTERNAL MODULE: ./lib/methods/_internal/createNewlessClass.js
144var createNewlessClass = __webpack_require__("./lib/methods/_internal/createNewlessClass.js");
145
146// EXTERNAL MODULE: ./lib/classes/AsyncAfWrapper.js + 2 modules
147var AsyncAfWrapper = __webpack_require__("./lib/classes/AsyncAfWrapper.js");
148
149// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
150var toConsumableArray = __webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js");
151var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
152
153// EXTERNAL MODULE: ./lib/methods/_internal/nameFunction.js
154var nameFunction = __webpack_require__("./lib/methods/_internal/nameFunction.js");
155
156// EXTERNAL MODULE: ./lib/methods/other/logAF.js + 4 modules
157var logAF = __webpack_require__("./lib/methods/other/logAF.js");
158
159// EXTERNAL MODULE: ./lib/methods/arrays/mapAF.js
160var mapAF = __webpack_require__("./lib/methods/arrays/mapAF.js");
161
162// EXTERNAL MODULE: ./lib/methods/arrays/forEachAF.js
163var forEachAF = __webpack_require__("./lib/methods/arrays/forEachAF.js");
164
165// EXTERNAL MODULE: ./lib/methods/arrays/filterAF.js
166var filterAF = __webpack_require__("./lib/methods/arrays/filterAF.js");
167
168// EXTERNAL MODULE: ./lib/methods/arrays/reduceAF.js + 1 modules
169var reduceAF = __webpack_require__("./lib/methods/arrays/reduceAF.js");
170
171// EXTERNAL MODULE: ./lib/methods/arrays/everyAF.js
172var everyAF = __webpack_require__("./lib/methods/arrays/everyAF.js");
173
174// EXTERNAL MODULE: ./lib/methods/arrays/someAF.js
175var someAF = __webpack_require__("./lib/methods/arrays/someAF.js");
176
177// EXTERNAL MODULE: ./lib/methods/arrays/includesAF.js
178var includesAF = __webpack_require__("./lib/methods/arrays/includesAF.js");
179
180// EXTERNAL MODULE: ./lib/methods/arrays/findAF.js
181var findAF = __webpack_require__("./lib/methods/arrays/findAF.js");
182
183// EXTERNAL MODULE: ./lib/methods/arrays/findIndexAF.js
184var findIndexAF = __webpack_require__("./lib/methods/arrays/findIndexAF.js");
185
186// EXTERNAL MODULE: ./lib/methods/arrays/indexOfAF.js
187var indexOfAF = __webpack_require__("./lib/methods/arrays/indexOfAF.js");
188
189// EXTERNAL MODULE: ./lib/methods/arrays/lastIndexOfAF.js
190var lastIndexOfAF = __webpack_require__("./lib/methods/arrays/lastIndexOfAF.js");
191
192// EXTERNAL MODULE: ./lib/methods/arrays/joinAF.js
193var joinAF = __webpack_require__("./lib/methods/arrays/joinAF.js");
194
195// EXTERNAL MODULE: ./lib/methods/arrays/concatAF.js
196var concatAF = __webpack_require__("./lib/methods/arrays/concatAF.js");
197
198// EXTERNAL MODULE: ./lib/methods/strings/splitAF.js
199var splitAF = __webpack_require__("./lib/methods/strings/splitAF.js");
200
201// CONCATENATED MODULE: ./packageList.js
202
203
204
205/* eslint-disable import/first */
206
207var libName = 'async-af';
208var libPath = './lib/';
209
210var makeScoped = function makeScoped(name) {
211 return "@".concat(libName, "/").concat(name.replace(/AsyncAf|AF/g, '').toLowerCase());
212};
213/* ____________________________
214 | CLASSES |
215 |____________________________| */
216
217
218var classPath = "".concat(libPath, "classes/");
219var classes = [[{
220 name: 'AsyncAF'
221}, "".concat(classPath, "AsyncAF"), libName], [{
222 name: 'AsyncAfWrapper'
223}, "".concat(classPath, "AsyncAfWrapper"), makeScoped('AsyncAfWrapper')]];
224/* ____________________________
225 | STATIC METHODS |
226 |____________________________| */
227
228
229var staticMethods = [Object(nameFunction["default"])(logAF["default"], 'logAF')].map(function (method) {
230 return [method, "".concat(libPath, "methods/other/").concat(method.name), makeScoped(method.name)];
231});
232/* ____________________________
233 | PROTOTYPE METHODS |
234 |____________________________| */
235// Arrays
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250var arrayMethods = [Object(nameFunction["default"])(mapAF["default"], 'mapAF'), Object(nameFunction["default"])(forEachAF["default"], 'forEachAF'), Object(nameFunction["default"])(filterAF["default"], 'filterAF'), Object(nameFunction["default"])(reduceAF["default"], 'reduceAF'), Object(nameFunction["default"])(everyAF["default"], 'everyAF'), Object(nameFunction["default"])(someAF["default"], 'someAF'), Object(nameFunction["default"])(includesAF["default"], 'includesAF'), Object(nameFunction["default"])(findAF["default"], 'findAF'), Object(nameFunction["default"])(findIndexAF["default"], 'findIndexAF'), Object(nameFunction["default"])(indexOfAF["default"], 'indexOfAF'), Object(nameFunction["default"])(lastIndexOfAF["default"], 'lastIndexOfAF'), Object(nameFunction["default"])(joinAF["default"], 'joinAF'), Object(nameFunction["default"])(concatAF["default"], 'concatAF')].map(function (method) {
251 return [method, "".concat(libPath, "methods/arrays/").concat(method.name), makeScoped(method.name)];
252}); // strings
253
254
255var stringMethods = [Object(nameFunction["default"])(splitAF["default"], 'splitAF')].map(function (method) {
256 return [method, "".concat(libPath, "methods/strings/").concat(method.name), makeScoped(method.name)];
257});
258var prototypeMethods = [].concat(toConsumableArray_default()(arrayMethods), toConsumableArray_default()(stringMethods));
259/* ____________________________
260 | COLLECTIONS |
261 |____________________________| */
262// import arrays from './lib/collections/arrays';
263
264var collections = [// arrays,
265];
266/* harmony default export */ var packageList = ([].concat(classes, toConsumableArray_default()(staticMethods), toConsumableArray_default()(prototypeMethods), collections));
267
268var packageList_pluckMethods = function pluckMethods(packages) {
269 return packages.map(function (_ref) {
270 var _ref2 = slicedToArray_default()(_ref, 1),
271 method = _ref2[0];
272
273 return method;
274 });
275};
276
277var staticMethodsOnly = packageList_pluckMethods(staticMethods);
278var prototypeMethodsOnly = packageList_pluckMethods(prototypeMethods);
279
280// CONCATENATED MODULE: ./lib/classes/AsyncAF.js
281
282
283
284
285
286
287
288
289function _templateObject() {
290 var data = taggedTemplateLiteral_default()(["AF"]);
291
292 _templateObject = function _templateObject() {
293 return data;
294 };
295
296 return data;
297}
298
299
300
301
302/**
303 * class that holds all the AsyncAF methods
304 *
305 * while AsyncAF is a class, it can create instances with or without the `new` keyword
306 * @param {any} data the data to be wrapped by the AsyncAF class; can be promises or non-promises
307 * @returns {Object} returns an instance of AsyncAF wrapping the passed in data
308 * @example
309 *
310 * const promises = [1, 2, 3].map(n => Promise.resolve(n));
311 *
312 *
313 * AsyncAF(promises).mapAF(n => n * 2).filterAF(n => n !== 4).forEachAF(n => console.log(n));
314 * // logs 2 then 6
315 * @since 3.0.0
316 * @see AsyncAfWrapper
317 * @class AsyncAF
318 */
319
320var AsyncAF_AsyncAF = Object(createNewlessClass["default"])(
321/*#__PURE__*/
322function (_AsyncAfProto) {
323 inherits_default()(AsyncAF, _AsyncAfProto);
324
325 function AsyncAF() {
326 classCallCheck_default()(this, AsyncAF);
327
328 return possibleConstructorReturn_default()(this, getPrototypeOf_default()(AsyncAF).apply(this, arguments));
329 }
330
331 return AsyncAF;
332}(AsyncAfWrapper["AsyncAfWrapperProto"]));
333
334var AsyncAF_prepForDefine = function prepForDefine(methods) {
335 return methods.reduce(function (methods, method) {
336 // add all '*AF' methods and add 'AF-less' aliases (e.g., mapAF -> map)
337 var _ref = method.name.split(_templateObject()) ||
338 /* istanbul ignore next */
339 [method.name],
340 _ref2 = slicedToArray_default()(_ref, 1),
341 alias = _ref2[0];
342
343 return Object.assign(methods, defineProperty_default()({}, method.name, {
344 value: method
345 }), defineProperty_default()({}, alias, {
346 value: method
347 }));
348 }, {});
349};
350
351Object.defineProperties(AsyncAfWrapper["AsyncAfWrapperProto"], AsyncAF_prepForDefine(staticMethodsOnly));
352Object.defineProperties(AsyncAfWrapper["AsyncAfWrapperProto"].prototype, AsyncAF_prepForDefine(prototypeMethodsOnly));
353/* harmony default export */ var classes_AsyncAF = __webpack_exports__["default"] = (AsyncAF_AsyncAF);
354
355/***/ }),
356
357/***/ "./lib/classes/AsyncAfWrapper.js":
358/***/ (function(module, __webpack_exports__, __webpack_require__) {
359
360"use strict";
361
362// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
363var possibleConstructorReturn = __webpack_require__("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
364var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
365
366// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js
367var getPrototypeOf = __webpack_require__("./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
368var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
369
370// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js
371var inherits = __webpack_require__("./node_modules/@babel/runtime/helpers/inherits.js");
372var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
373
374// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
375var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js");
376var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
377
378// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread.js
379var objectSpread = __webpack_require__("./node_modules/@babel/runtime/helpers/objectSpread.js");
380var objectSpread_default = /*#__PURE__*/__webpack_require__.n(objectSpread);
381
382// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js
383var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/classCallCheck.js");
384var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
385
386// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js
387var createClass = __webpack_require__("./node_modules/@babel/runtime/helpers/createClass.js");
388var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
389
390// EXTERNAL MODULE: ./lib/methods/_internal/createNewlessClass.js
391var createNewlessClass = __webpack_require__("./lib/methods/_internal/createNewlessClass.js");
392
393// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
394var helpers_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");
395var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
396
397// CONCATENATED MODULE: ./lib/methods/other/use.js
398
399
400/**
401 * adds prototype/static methods to AsyncAF or AsyncAfWrapper
402 *
403 * see {@link AsyncAfWrapper AsyncAfWrapper} for an example of how to cherry-pick AsyncAF methods you'd like to use rather than pulling in the entire AsyncAF library;
404 *
405 * for something different, the following shows how to add custom methods to AsyncAF & AsyncAfWrapper
406 *
407 * **Example**
408 *
409 * say you want to extend AsyncAF with your own prototype method that acts on an array of numbers or promises that resolve to numbers and naively adds them up
410 *
411 * let's call it sumAF; here's some code:
412 *
413 * ```js
414 * // sumAF.js
415 *
416 * const sumAF = function () {
417 * return this.then(nums => Promise.all(nums))
418 * .then(nums => nums.reduce((sum, num) => sum + num));
419 * };
420 *
421 * export default sumAF;
422 * ```
423 *
424 * pull in {@link AsyncAF AsyncAF} or {@link AsyncAfWrapper AsyncAfWrapper} and `sumAF` to the file you'd like to use it in:
425 *
426 * ```js
427 * // otherFile.js
428 *
429 * import AsyncAF from 'async-af'; // or import AsyncAF from '@async-af/wrapper';
430 * import sumAF from './sumAF';
431 * ```
432 *
433 * then, call `use` on `AsyncAF` and pass in `sumAF` wrapped in an object to the first parameter, `prototypeMethods`:
434 *
435 * ```js
436 * // otherFile.js
437 * // ...
438 *
439 * AsyncAF.use({sumAF});
440 * ```
441 *
442 * ready! now your custom prototype method will be available on AsyncAF
443 *
444 * ```js
445 * // otherFile.js
446 * // ...
447 *
448 * const promises = [1, 2, 3].map(n => Promise.resolve(n));
449 *
450 * const sum = AsyncAF(promises).sumAF()
451 *
452 * AsyncAF.logAF(sum);
453 * // @otherFile.js:10:9:
454 * // 6
455 * // in 0.001 secs
456 * ```
457 *
458 * if you'd like to add a static method to AsyncAF, `use` accepts a second optional argument `staticMethods`; for example:
459 *
460 * ```js
461 * const staticNoop = () => {};
462 *
463 * AsyncAF.use({}, {staticNoop});
464 *
465 * AsyncAF.staticNoop(); // noop
466 * ```
467 *
468 * @static
469 * @param {Object} prototypeMethods an Object containing the prototype methods you'd like to use
470 * @param {Object=} staticMethods an Object containing the static methods you'd like to use
471 * @returns {undefined} adds prototype/static methods to AsyncAF or AsyncAfWrapper
472 * @since 3.0.0
473 * @see AsyncAF
474 * @see AsyncAfWrapper
475 * @see {@tutorial TOO_MANY_IMPORTS}
476 * @memberof AsyncAfWrapper
477 * @alias AsyncAfWrapper#use
478 */
479var use_use = function use(prototypeMethods) {
480 var staticMethods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
481 if (typeof_default()(prototypeMethods) !== 'object') throw TypeError('prototypeMethods param accepts an Object containing the prototypeMethods you\'d like to add to the AsyncAF prototype, or an empty Object');
482 if (typeof_default()(staticMethods) !== 'object') throw TypeError('staticMethods param accepts an Object containing the staticMethods you\'d like to add to AsyncAF');
483 Object.assign(this.prototype, prototypeMethods);
484 Object.assign(this, staticMethods);
485};
486
487/* harmony default export */ var other_use = (use_use);
488// CONCATENATED MODULE: ./lib/methods/other/series.js
489var inSeries = new WeakMap();
490var series = {
491 inSeries: {
492 get: function get() {
493 return inSeries.get(this);
494 }
495 },
496
497 /**
498 * indicates that the next method invoked should be performed in series
499 *
500 * when you need to perform a method in series rather than in parallel, prepend the method with `series`; e.g.:
501 * ```js
502 * AsyncAF(promises).series.forEachAF(callback)
503 * ```
504 *
505 * `series` can currently be chained with:
506 * - {@link AsyncAF#everyAF everyAF}
507 * - {@link AsyncAF#filterAF filterAF}
508 * - {@link AsyncAF#findAF findAF}
509 * - {@link AsyncAF#findIndexAF findIndexAF}
510 * - {@link AsyncAF#forEachAF forEachAF}
511 * - {@link AsyncAF#includesAF includesAF}
512 * - {@link AsyncAF#indexOfAF indexOfAF}
513 * - {@link AsyncAF#lastIndexOfAF lastIndexOfAF}
514 * - {@link AsyncAF#mapAF mapAF}
515 * - {@link AsyncAF#reduceAF reduceAF}
516 * - {@link AsyncAF#someAF someAF}
517 *
518 * @example
519 * import delay from 'delay'; // {@link https://www.npmjs.com/package/delay}
520 *
521 * const nums = [2, 1];
522 *
523 * // perform a serial forEach by chaining {@link AsyncAF#series series} and {@link AsyncAF#forEachAF forEachAF}
524 * (async () => {
525 * const start = Date.now();
526 *
527 * await AsyncAF(nums).series.forEachAF(async num => {
528 * await delay(num * 1000);
529 * console.log(num, `at ~${Date.now() - start} ms`);
530 * });
531 *
532 * console.log(`total: ~${Date.now() - start} ms`);
533 * })();
534 *
535 * // logs:
536 * // 2 'at ~2000 ms'
537 * // 1 'at ~3000 ms'
538 * // total: ~3000 ms
539 *
540 *
541 * // perform a parallel forEach by omitting {@link AsyncAF#series series}
542 * (async () => {
543 * const start = Date.now();
544 *
545 * await AsyncAF(nums).forEachAF(async num => {
546 * await delay(num * 1000);
547 * console.log(num, `at ~${Date.now() - start} ms`);
548 * });
549 *
550 * console.log(`total: ~${Date.now() - start} ms`);
551 * })();
552 *
553 * // logs:
554 * // 1 'at ~1000 ms'
555 * // 2 'at ~2000 ms'
556 * // total: ~2000 ms
557 *
558 * @function series
559 * @returns {AsyncAF.<any>} returns an instance of AsyncAF that will perform the next method invocation serially
560 * @since 7.0.0
561 * @see {@link AsyncAF#io io} (alias)
562 * @memberof AsyncAF#
563 */
564 series: {
565 get: function get() {
566 inSeries.set(this, !this.inSeries);
567 return this;
568 }
569 },
570
571 /**
572 * `io` (in order) indicates that the next method invoked should be performed in series
573 *
574 * when you need to perform a method in series rather than in parallel, prepend the method with `io`; e.g.:
575 * ```js
576 * AsyncAF(promises).io.forEachAF(callback)
577 * ```
578 *
579 * `io` is an alias for `series`; see {@link AsyncAF#series series's documentation} for more
580 * @function io
581 * @returns {AsyncAF.<any>} returns an instance of AsyncAF that will perform the next method invocation serially
582 * @since 7.0.0
583 * @see {@link AsyncAF#series series} (alias)
584 * @memberof AsyncAF#
585 */
586 io: {
587 get: function get() {
588 return this.series;
589 }
590 }
591};
592/* harmony default export */ var other_series = (series);
593// CONCATENATED MODULE: ./lib/classes/AsyncAfWrapper.js
594/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncAfWrapperProto", function() { return AsyncAfWrapper_AsyncAfWrapperProto; });
595
596
597
598
599
600
601
602
603
604
605var dataStore = new WeakMap();
606
607var AsyncAfWrapper_AsyncAfWrapperProto =
608/*#__PURE__*/
609function () {
610 function AsyncAfWrapperProto(data) {
611 classCallCheck_default()(this, AsyncAfWrapperProto);
612
613 dataStore.set(this, Promise.resolve(data));
614 }
615
616 createClass_default()(AsyncAfWrapperProto, [{
617 key: "then",
618 value: function then(resolve, reject) {
619 return this.constructor(dataStore.get(this).then(resolve, reject));
620 }
621 }, {
622 key: "catch",
623 value: function _catch(reject) {
624 return this.then(null, reject);
625 }
626 }, {
627 key: "finally",
628 value: function _finally(onFinally) {
629 return dataStore.get(this).finally(onFinally);
630 }
631 }]);
632
633 return AsyncAfWrapperProto;
634}();
635
636AsyncAfWrapper_AsyncAfWrapperProto.use = other_use;
637Object.defineProperties(AsyncAfWrapper_AsyncAfWrapperProto.prototype, objectSpread_default()({}, other_series, defineProperty_default()({}, Symbol.toStringTag, {
638 value: 'AsyncAF'
639})));
640/**
641 * empty AsyncAF class wrapper
642 *
643 * AsyncAfWrapper is one option for cherry-picking only the methods you'd like to use in your code; {@link AsyncAfWrapper#use use}, {@link AsyncAF#series series}, and {@link AsyncAF#io io} are the only methods initially available on AsyncAfWrapper; see example below
644 *
645 * **Note:** while AsyncAfWrapper is a class, it can create instances with or without the `new` keyword
646 *
647 * **Example**
648 *
649 * say you only want to use {@link AsyncAF#mapAF mapAF}, {@link AsyncAF#filterAF filterAF}, {@link AsyncAF#forEachAF forEachAF}, and {@link AsyncAF#logAF logAF} instead of pulling in the entire AsyncAF library
650 *
651 * first, install the separate packages (e.g., for npm):
652 *
653 * `$ npm install --save @async-af/{wrapper,map,filter,foreach,log}`
654 *
655 * or, if on Windows:
656 *
657 * `$ npm install --save @async-af/wrapper @async-af/map @async-af/filter @async-af/foreach @async-af/log`
658 *
659 * then import the packages
660 * ```js
661 * import AsyncAF from '@async-af/wrapper'; // aliasing 'AsyncAfWrapper' as 'AsyncAF'
662 * import mapAF from '@async-af/map';
663 * import filterAF from '@async-af/filter';
664 * import forEachAF from '@async-af/foreach';
665 * import logAF from '@async-af/log';
666 * ```
667 *
668 * _if you'd like to save some vertical screen real estate and cut the imports down to one line, see_ {@tutorial TOO_MANY_IMPORTS}
669 *
670 * then call {@link AsyncAfWrapper#use use}, including all prototype methods you'd like to add to AsyncAfWrapper's prototype in the first argument, `prototypeMethods` and all static methods you'd like to add to AsyncAfWrapper in the second optional argument, `staticMethods`
671 * ```js
672 * AsyncAF.use({ // prototype methods go in the first argument
673 * mapAF,
674 * filterAF,
675 * forEachAF
676 * }, { // static methods go in the second argument
677 * logAF
678 * });
679 * ```
680 *
681 * ready to go!
682 * ```js
683 * const promises = [1, 2, 3].map(n => Promise.resolve(n));
684 *
685 * AsyncAF(promises).mapAF(n => n * 2).filterAF(n => n !== 4).forEachAF(n => console.log(n));
686 * // logs 2 then 6
687 *
688 * AsyncAF.logAF(promises);
689 * // @filename.js:24:9:
690 * // [ 1, 2, 3 ]
691 * // in 0.003 secs
692 * ```
693 *
694 * **protip:** you can use the same technique to add your own custom prototype or static methods to AsyncAfWrapper or even to the main AsyncAF class; see {@link AsyncAfWrapper#use use} for an example
695 * @param {any} data the data to be wrapped by the AsyncAF class; can be promises or non-promises
696 * @returns {Object} returns an instance of AsyncAfWrapper wrapping the passed in data
697 * @since 3.0.0
698 * @see AsyncAF
699 * @see {@link AsyncAfWrapper#use use}
700 * @see {@tutorial TOO_MANY_IMPORTS}
701 * @class AsyncAfWrapper
702 */
703
704var AsyncAfWrapper_AsyncAfWrapper = Object(createNewlessClass["default"])(
705/*#__PURE__*/
706function (_AsyncAfWrapperProto) {
707 inherits_default()(AsyncAfWrapper, _AsyncAfWrapperProto);
708
709 function AsyncAfWrapper() {
710 classCallCheck_default()(this, AsyncAfWrapper);
711
712 return possibleConstructorReturn_default()(this, getPrototypeOf_default()(AsyncAfWrapper).apply(this, arguments));
713 }
714
715 return AsyncAfWrapper;
716}(AsyncAfWrapper_AsyncAfWrapperProto));
717
718/* harmony default export */ var classes_AsyncAfWrapper = __webpack_exports__["default"] = (AsyncAfWrapper_AsyncAfWrapper);
719
720/***/ }),
721
722/***/ "./lib/methods/_internal/commonCallback.js":
723/***/ (function(module, __webpack_exports__, __webpack_require__) {
724
725"use strict";
726__webpack_require__.r(__webpack_exports__);
727/* eslint-disable no-unused-vars, valid-jsdoc */
728
729/**
730 * @typedef {callback} _
731 * @param {?} currentValue
732 * @param {Number=} index
733 * @param {[]=} array
734 * @returns {any}
735 */
736function callback(currentValue, index, array) {}
737
738/* harmony default export */ __webpack_exports__["default"] = (callback);
739
740/***/ }),
741
742/***/ "./lib/methods/_internal/createNewlessClass.js":
743/***/ (function(module, __webpack_exports__, __webpack_require__) {
744
745"use strict";
746__webpack_require__.r(__webpack_exports__);
747/* harmony import */ var _babel_runtime_helpers_construct__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@babel/runtime/helpers/construct.js");
748/* harmony import */ var _babel_runtime_helpers_construct__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_construct__WEBPACK_IMPORTED_MODULE_0__);
749/* harmony import */ var _nameFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/nameFunction.js");
750
751
752
753var createNewlessClass = function createNewlessClass(Class) {
754 var name = Class.name;
755
756 var Newless = function Newless() {
757 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
758 args[_key] = arguments[_key];
759 }
760
761 return _babel_runtime_helpers_construct__WEBPACK_IMPORTED_MODULE_0___default()(Class, args);
762 };
763
764 Newless.prototype = Class.prototype;
765 Object.setPrototypeOf(Newless, Class);
766 Newless.prototype.constructor = Newless;
767 return Object(_nameFunction__WEBPACK_IMPORTED_MODULE_1__["default"])(Newless, name);
768};
769
770/* harmony default export */ __webpack_exports__["default"] = (createNewlessClass);
771
772/***/ }),
773
774/***/ "./lib/methods/_internal/nameFunction.js":
775/***/ (function(module, __webpack_exports__, __webpack_require__) {
776
777"use strict";
778__webpack_require__.r(__webpack_exports__);
779var nameFunction = function nameFunction(fn, name) {
780 return Object.defineProperty(fn, 'name', {
781 value: name,
782 configurable: true
783 });
784};
785
786/* harmony default export */ __webpack_exports__["default"] = (nameFunction);
787
788/***/ }),
789
790/***/ "./lib/methods/_internal/permissiveIsArrayLike.js":
791/***/ (function(module, __webpack_exports__, __webpack_require__) {
792
793"use strict";
794__webpack_require__.r(__webpack_exports__);
795var permissiveIsArrayLike = function permissiveIsArrayLike(obj) {
796 return Array.isArray(obj) || obj != null && obj.length != null;
797};
798
799/* harmony default export */ __webpack_exports__["default"] = (permissiveIsArrayLike);
800
801/***/ }),
802
803/***/ "./lib/methods/_internal/promiseAllWithHoles.js":
804/***/ (function(module, __webpack_exports__, __webpack_require__) {
805
806"use strict";
807__webpack_require__.r(__webpack_exports__);
808var promiseAllWithHoles = function promiseAllWithHoles(promises) {
809 return new Promise(function (resolve, reject) {
810 var length = promises.length >>> 0;
811 var result = Array(length);
812 var pending = length;
813 var i = length;
814 if (!length) return resolve(result);
815
816 var settlePromise = function settlePromise(i) {
817 return Promise.resolve(promises[i]).then(function (value) {
818 if (i in promises) result[i] = value;
819 if (! --pending) resolve(result);
820 }, reject);
821 };
822
823 while (i--) {
824 settlePromise(i);
825 }
826 });
827};
828
829/* harmony default export */ __webpack_exports__["default"] = (promiseAllWithHoles);
830
831/***/ }),
832
833/***/ "./lib/methods/_internal/resolve.js":
834/***/ (function(module, __webpack_exports__, __webpack_require__) {
835
836"use strict";
837__webpack_require__.r(__webpack_exports__);
838/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serial", function() { return serial; });
839/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallel", function() { return parallel; });
840/* harmony import */ var _promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/promiseAllWithHoles.js");
841
842
843var serial = function serial(arr) {
844 return function resolveSerially(resolved, i) {
845 var length = resolved.length;
846 if (!length) return Promise.resolve(resolved);
847 var hole = !(i in arr);
848 return Promise.resolve(arr[i]).then(function (el) {
849 if (!hole) resolved[i] = el;
850 if (i === length - 1) return resolved;
851 return resolveSerially(resolved, i + 1);
852 });
853 }(Array(arr.length >>> 0), 0);
854};
855
856var parallel = function parallel(arr, mapper) {
857 var thisArg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
858 return Object(_promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (el) {
859 return el;
860 }).then(!mapper ? undefined : function (arr) {
861 return Object(_promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(Array.prototype.map.call(arr, mapper, thisArg));
862 });
863};
864
865
866
867/***/ }),
868
869/***/ "./lib/methods/arrays/concatAF.js":
870/***/ (function(module, __webpack_exports__, __webpack_require__) {
871
872"use strict";
873__webpack_require__.r(__webpack_exports__);
874var resolveByType = function resolveByType(data) {
875 return Promise[Array.isArray(data) ? 'all' : 'resolve'](data);
876};
877/**
878 * merges an array or string with one or more arrays, strings, or other values, and resolves to a new array or string;
879 *
880 * concatAF flexibly accepts arrays, strings, promises, other values, or other instances of AsyncAF; see examples
881 *
882 * @param {any} values arrays, strings, or values to concatenate into a new array or string
883 * - if any values are a Promise, they'll first be resolved then concatenated
884 * - if any values are an instance of AsyncAF, they'll be merged into one instance
885 * @returns {Promise.<Array>|Promise.<String>} `Promise` that resolves to a newly merged array or string
886 * @example
887 *
888 * // arrays
889 * const arr = Promise.resolve([1, 2]);
890 * AsyncAF(arr).concatAF([3, 4]); // Promise that resolves to [1, 2, 3, 4]
891 * AsyncAF(arr).concatAF([3, 4], [5, 6]); // Promise that resolves to [1, 2, 3, 4, 5, 6]
892 *
893 * // nested arrays
894 * const arr1 = Promise.resolve([1, 2]);
895 * const arr2 = [3, [4, 5]];
896 * AsyncAF(arr1).concatAF(arr2); // Promise that resolves to [1, 2, 3, [4, 5]]
897 *
898 * // strings
899 * const str = Promise.resolve('str');
900 * AsyncAF(str).concatAF('ing'); // Promise that resolves to 'string'
901 * AsyncAF(str).concatAF('ing', 'y'); // Promise that resolves to 'stringy'
902 *
903 * // other instances of AsyncAF
904 * const aaf1 = AsyncAF([1, 2]);
905 * const aaf2 = AsyncAF(3);
906 *
907 * aaf1.concatAF(aaf2); // Promise that resolves to [1, 2, 3];
908 *
909 * const aaf3 = AsyncAF('stringy');
910 * const aaf4 = AsyncAF('AF');
911 *
912 * aaf3.concatAF(aaf4); // Promise that resolves to 'stringyAF'
913 *
914 * // promises
915 * const [p1, p2, p3] = [[1, 2], 3, [4, [5, 6]]].map(v => Promise.resolve(v));
916 *
917 * AsyncAF(p1).concatAF(p2); // Promise that resolves to [1, 2, 3]
918 * AsyncAF(p1).concatAF(p2, p3) // Promise that resolves to [1, 2, 3, 4, [5, 6]]
919 *
920 * const pStr1 = Promise.resolve('str');
921 * const pStr2 = Promise.resolve('ing');
922 * const pStr3 = Promise.resolve('y');
923 *
924 * AsyncAF(pStr1).concatAF(pStr2); // Promise that resolves to 'string'
925 * AsyncAF(pStr1).concatAF(pStr2, pStr3); // Promise that resolves to 'stringy'
926 *
927 * // Note: concatAF will not resolve deeply nested promises; if you need this behavior, concatAF can be used in a
928 * // function; for example, this function recursively flattens an array of promises
929 *
930 * const flattenAsync = arr => AsyncAF(arr).reduceAF(async (acc, val) => {
931 * return Array.isArray(await val)
932 * ? AsyncAF(acc).concatAF(flattenAsync(val))
933 * : AsyncAF(acc).concatAF(val), []);
934 * };
935 *
936 * @since 5.3.0
937 * @see concat (alias)
938 * @memberof AsyncAF#
939 */
940
941
942var concatAF = function concatAF() {
943 var _this = this;
944
945 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
946 values[_key] = arguments[_key];
947 }
948
949 var isThenable = function isThenable(value) {
950 return [Promise, _this.constructor].some(function (thenable) {
951 return value instanceof thenable;
952 });
953 };
954
955 var concat = function concat(arrOrStr, value) {
956 return isThenable(value) && value.then(resolveByType).then(function (value) {
957 return arrOrStr.concat(value);
958 }) || arrOrStr.concat(value);
959 };
960
961 return this.then(function (arrOrStr) {
962 if (!(typeof arrOrStr === 'string' || Array.isArray(arrOrStr))) throw TypeError("concatAF cannot be called on ".concat(arrOrStr, ", only on an Array or String"));
963 return resolveByType(arrOrStr).then(function (arrOrStr) {
964 return values.reduce(function (arrOrStr, value) {
965 return isThenable(arrOrStr) ? arrOrStr.then(function (arrOrStr) {
966 return concat(arrOrStr, value);
967 }) : concat(arrOrStr, value);
968 }, arrOrStr);
969 });
970 });
971};
972
973/* harmony default export */ __webpack_exports__["default"] = (concatAF);
974
975/***/ }),
976
977/***/ "./lib/methods/arrays/everyAF.js":
978/***/ (function(module, __webpack_exports__, __webpack_require__) {
979
980"use strict";
981__webpack_require__.r(__webpack_exports__);
982/* harmony import */ var _internal_commonCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/commonCallback.js");
983/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
984/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/resolve.js");
985 // eslint-disable-line no-unused-vars
986
987
988
989/**
990 * tests whether all elements in the array pass the test implemented by the provided callback function
991 *
992 * if any elements are a `Promise`, they will first be resolved in parallel and then tested
993 *
994 * *Note*: since `everyAF` is run in parallel, `callback` will be run on all elements even if one of the first few elements fails the test; if this behavior is not desireable, consider using `series.everyAF` or its alias, `io.everyAF`
995 *
996 * @param {callback} callback function that tests each element of the array
997 *
998 * `callback` accepts three arguments:
999 * - `currentValue` value of the current element being processed in the array
1000 * - `index`*`(optional)`* index of `currentValue` in the array
1001 * - `array`*`(optional)`* the array that `everyAF` is being applied to
1002 * @param {Object=} thisArg value to use as `this` when executing `callback`
1003 * @returns {Promise.<Boolean>} `Promise` that resolves to `true` if the callback function returns a truthy value for every array element; otherwise, `false`
1004 * @example
1005 *
1006 * const promises = [1, 2, 3].map(n => Promise.resolve(n));
1007 *
1008 *
1009 * // basic usage
1010 * const allAreOdd = AsyncAF(promises).everyAF(n => n % 2);
1011 *
1012 * console.log(allAreOdd); // Promise that resolves to false
1013 *
1014 * AsyncAF.logAF(allAreOdd); // logs false
1015 *
1016 *
1017 * // using .then
1018 * AsyncAF(promises).everyAF(n => n % 2).then(allAreOdd => {
1019 * console.log(allAreOdd); // logs false
1020 * });
1021 *
1022 *
1023 * // inside an async function
1024 * (async () => {
1025 * const allAreNums = await AsyncAF(promises).everyAF(
1026 * n => typeof n === 'number'
1027 * );
1028 * console.log(allAreNums); // logs true
1029 * })();
1030 * @since 3.2.0
1031 * @see every (alias)
1032 * @see {@link AsyncAF#series series.everyAF}
1033 * @memberof AsyncAF#
1034 */
1035
1036var everyAF = function everyAF(callback) {
1037 var _this = this;
1038
1039 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1040 return this.then(function (arr) {
1041 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError("everyAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1042 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1043 var length = arr.length >>> 0;
1044 return _this.inSeries ? !length && true || function seriesEveryAF(arr, i) {
1045 var hole = !(i in arr);
1046 return Promise.resolve(arr[i]).then(function (el) {
1047 arr[i] = el;
1048 return Promise.resolve(!hole && callback.call(thisArg, el, i, arr)).then(function (bool) {
1049 if (!bool && !hole) return false;
1050 if (i === length - 1) return true;
1051 return seriesEveryAF(arr, i + 1);
1052 });
1053 });
1054 }(Array.prototype.slice.call(arr), 0) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(arr, callback, thisArg).then(function (bools) {
1055 return bools.every(Boolean);
1056 });
1057 });
1058};
1059
1060/* harmony default export */ __webpack_exports__["default"] = (everyAF);
1061
1062/***/ }),
1063
1064/***/ "./lib/methods/arrays/filterAF.js":
1065/***/ (function(module, __webpack_exports__, __webpack_require__) {
1066
1067"use strict";
1068__webpack_require__.r(__webpack_exports__);
1069/* harmony import */ var _internal_commonCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/commonCallback.js");
1070/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1071/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1072 // eslint-disable-line no-unused-vars
1073
1074
1075
1076/**
1077 * creates a new `Array` with all elements that pass the test implemented by the provided callback function
1078 *
1079 * if any elements are a `Promise`, they will first be resolved in parallel and then tested
1080 *
1081 * *Note*: if you'd rather resolve and test elements in series, consider using `series.filterAF` or its alias, `io.filterAF`
1082 *
1083 * @param {callback} callback function that tests each element of the array; return `true` to keep the element, `false` to filter it out
1084 *
1085 * `callback` accepts three arguments:
1086 * - `currentValue` value of the current element being processed in the array
1087 * - `index`*`(optional)`* index of `currentValue` in the array
1088 * - `array`*`(optional)`* the array that `filterAF` is being applied to
1089 * @param {Object=} thisArg value to use as `this` when executing `callback`
1090 * @returns {Promise.<Array>} `Promise` that resolves to a new `Array` with the elements that pass the test; if no elements pass the test, the promise will resolve to an empty array
1091 * @example
1092 *
1093 * const promises = [1, 2, 3].map(n => Promise.resolve(n));
1094 *
1095 *
1096 * // basic usage
1097 * const odds = AsyncAF(promises).filterAF(n => n % 2);
1098 *
1099 * console.log(odds); // Promise that resolves to [1, 3]
1100 *
1101 * AsyncAF.logAF(odds); // logs [1, 3]
1102 *
1103 *
1104 * // using .then
1105 * AsyncAF(promises).filterAF(n => n % 2).then(odds => {
1106 * console.log(odds); // logs [1, 3]
1107 * });
1108 *
1109 *
1110 * // inside an async function
1111 * (async () => {
1112 * const odds = await AsyncAF(promises).filterAF(
1113 * n => n % 2
1114 * );
1115 * console.log(odds); // logs [1, 3]
1116 * })();
1117 * @since 3.0.0
1118 * @see filter (alias)
1119 * @see {@link AsyncAF#series series.filterAF}
1120 * @memberof AsyncAF#
1121 */
1122
1123var filterAF = function filterAF(callback) {
1124 var _this = this;
1125
1126 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1127 return this.then(function (arr) {
1128 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError("filterAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1129 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1130 return (_this.inSeries ? _internal_resolve__WEBPACK_IMPORTED_MODULE_2__["serial"] : _internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(arr).then(function (arr) {
1131 return (_this.inSeries ? arr.reduce(function (bools, el, i, arr) {
1132 return bools.then(function (bools) {
1133 bools[i] = callback.call(thisArg, el, i, arr);
1134 return Promise.all(bools);
1135 });
1136 }, Promise.all([])) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(arr, callback, thisArg)).then(function (bools) {
1137 return arr.filter(function (_, i) {
1138 return bools[i];
1139 });
1140 });
1141 });
1142 });
1143};
1144
1145/* harmony default export */ __webpack_exports__["default"] = (filterAF);
1146
1147/***/ }),
1148
1149/***/ "./lib/methods/arrays/findAF.js":
1150/***/ (function(module, __webpack_exports__, __webpack_require__) {
1151
1152"use strict";
1153__webpack_require__.r(__webpack_exports__);
1154/* harmony import */ var _internal_commonCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/commonCallback.js");
1155/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1156/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1157 // eslint-disable-line no-unused-vars
1158
1159
1160
1161/**
1162 * resolves to the value of the first element in the array that satisfies the provided callback function; otherwise, `undefined`
1163 *
1164 * *Note*: since `findAF` is run in parallel, `callback` will be run on all elements even if one of the first few elements passes the test; if this behavior is not desireable, consider using `series.findAF` or its alias, `io.findAF`
1165 *
1166 * @param {callback} callback function to test each element in the array
1167 *
1168 * `callback` accepts three arguments:
1169 * - `currentValue` value of the current element being processed in the array
1170 * - `index`*`(optional)`* index of `currentValue` in the array
1171 * - `array`*`(optional)`* the array that findAF is being applied to
1172 * @param {Object=} thisArg value to use as `this` when executing `callback`
1173 * @returns {Promise.<any>} `Promise` that resolves to the first element in the array that passes the test; otherwise, undefined
1174 * @example
1175 *
1176 * const inventory = [
1177 * {name: 'nuts', quantity: 2000},
1178 * {name: 'bolts', quantity: 5000},
1179 * {name: 'screws', quantity: 9001}
1180 * ].map(part => Promise.resolve(part));
1181 *
1182 * AsyncAF(inventory).findAF(part => part.name === 'screws');
1183 * // Promise that resolves to {name: 'screws', quantity: 9001}
1184 * @since 3.5.0
1185 * @see find (alias)
1186 * @see {@link AsyncAF#series series.findAF}
1187 * @memberof AsyncAF#
1188 */
1189
1190var findAF = function findAF(callback) {
1191 var _this = this;
1192
1193 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1194 return this.then(function (arr) {
1195 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError("findAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1196 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1197 var filled = Array.from(arr);
1198 var length = filled.length >>> 0;
1199 return _this.inSeries ? (length || undefined) && function seriesFindAF(arr, i) {
1200 return Promise.resolve(arr[i]).then(function (el) {
1201 arr[i] = el;
1202 return Promise.resolve(callback.call(thisArg, el, i, arr)).then(function (bool) {
1203 if (bool) return el;
1204 if (i === length - 1) return;
1205 return seriesFindAF(arr, i + 1);
1206 });
1207 });
1208 }(filled, 0) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(filled, callback, thisArg).then(function (bools) {
1209 return arr[bools.indexOf(true)];
1210 });
1211 });
1212};
1213
1214/* harmony default export */ __webpack_exports__["default"] = (findAF);
1215
1216/***/ }),
1217
1218/***/ "./lib/methods/arrays/findIndexAF.js":
1219/***/ (function(module, __webpack_exports__, __webpack_require__) {
1220
1221"use strict";
1222__webpack_require__.r(__webpack_exports__);
1223/* harmony import */ var _internal_commonCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/commonCallback.js");
1224/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1225/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1226 // eslint-disable-line no-unused-vars
1227
1228
1229
1230/**
1231 * resolves to the index of the first element in the array that satisfies the provided callback function; otherwise, `-1`
1232 *
1233 * *Note*: since `findIndexAF` is run in parallel, `callback` will be run on all indices even if one of the first few indices passes the test; if this behavior is not desireable, consider using `series.findIndexAF` or its alias, `io.findIndexAF`
1234 *
1235 * @param {callback} callback function to test each element in the array
1236 *
1237 * `callback` accepts three arguments:
1238 * - `currentValue` value of the current element being processed in the array
1239 * - `index`*`(optional)`* index of `currentValue` in the array
1240 * - `array`*`(optional)`* the array that findIndexAF is being applied to
1241 * @param {Object=} thisArg value to use as `this` when executing `callback`
1242 * @returns {Promise.<Number>} `Promise` that resolves to the index of the first element in the array that passes the test; otherwise, `-1`
1243 * @example
1244 *
1245 * const inventory = [
1246 * {name: 'nuts', quantity: 2000},
1247 * {name: 'bolts', quantity: 5000},
1248 * {name: 'screws', quantity: 9001}
1249 * ].map(part => Promise.resolve(part));
1250 *
1251 * AsyncAF(inventory).findIndexAF(part => part.name === 'screws');
1252 * // Promise that resolves to 2
1253 * @since 3.5.0
1254 * @see findIndex (alias)
1255 * @see {@link AsyncAF#series series.findIndexAF}
1256 * @memberof AsyncAF#
1257 */
1258
1259var findIndexAF = function findIndexAF(callback) {
1260 var _this = this;
1261
1262 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1263 return this.then(function (arr) {
1264 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError("findIndexAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1265 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1266 var filled = Array.from(arr);
1267 var length = filled.length >>> 0;
1268 return _this.inSeries ? !length && -1 || function seriesFindIndexAF(arr, i) {
1269 return Promise.resolve(arr[i]).then(function (el) {
1270 arr[i] = el;
1271 return Promise.resolve(callback.call(thisArg, el, i, arr)).then(function (bool) {
1272 if (bool) return i;
1273 if (i === length - 1) return -1;
1274 return seriesFindIndexAF(arr, i + 1);
1275 });
1276 });
1277 }(filled, 0) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(filled, callback, thisArg).then(function (bools) {
1278 return bools.indexOf(true);
1279 });
1280 });
1281};
1282
1283/* harmony default export */ __webpack_exports__["default"] = (findIndexAF);
1284
1285/***/ }),
1286
1287/***/ "./lib/methods/arrays/forEachAF.js":
1288/***/ (function(module, __webpack_exports__, __webpack_require__) {
1289
1290"use strict";
1291__webpack_require__.r(__webpack_exports__);
1292/* harmony import */ var _internal_commonCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/commonCallback.js");
1293/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1294/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1295 // eslint-disable-line no-unused-vars
1296
1297
1298
1299/**
1300 * executes a callback function on each element in an array
1301 *
1302 * if any elements are a `Promise`, they will first be resolved in parallel and then processed
1303 *
1304 * *Note*: if you'd rather resolve and process elements in series, consider using `series.forEachAF` or its alias, `io.forEachAF`
1305 *
1306 * @param {callback} callback function to execute for each element
1307 *
1308 * `callback` accepts three arguments:
1309 * - `currentValue` value of the current element being processed in the array
1310 * - `index`*`(optional)`* index of `currentValue` in the array
1311 * - `array`*`(optional)`* the array that forEachAF is being applied to
1312 * @param {Object=} thisArg value to use as `this` when executing `callback`
1313 * @returns {Promise.<undefined>} `Promise` that resolves to `undefined`
1314 * @example
1315 *
1316 * const promises = [1, 2].map(n => Promise.resolve(n));
1317 *
1318 *
1319 * AsyncAF(promises).forEachAF(el => {
1320 * console.log(el); // logs 1 then 2
1321 * });
1322 * @since 3.0.0
1323 * @see forEach (alias)
1324 * @see {@link AsyncAF#series series.forEachAF}
1325 * @memberof AsyncAF#
1326 */
1327
1328var forEachAF = function forEachAF(callback) {
1329 var _this = this;
1330
1331 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1332 return this.then(function (arr) {
1333 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError("forEachAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1334 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1335 return (_this.inSeries ? Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["serial"])(arr).then(function (arr) {
1336 return arr.reduce(function (expr, el, i, arr) {
1337 return expr.then(function () {
1338 return Promise.resolve(callback.call(thisArg, el, i, arr));
1339 });
1340 }, Promise.resolve());
1341 }) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(arr, callback, thisArg)).then(function () {});
1342 });
1343};
1344
1345/* harmony default export */ __webpack_exports__["default"] = (forEachAF);
1346
1347/***/ }),
1348
1349/***/ "./lib/methods/arrays/includesAF.js":
1350/***/ (function(module, __webpack_exports__, __webpack_require__) {
1351
1352"use strict";
1353__webpack_require__.r(__webpack_exports__);
1354/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1355/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1356
1357
1358
1359var sameValueZero = function sameValueZero(a, b) {
1360 return a === b || Number.isNaN(a) && Number.isNaN(b);
1361};
1362/**
1363 * determines whether an array, string, or array-like object includes a certain element or string, returning true or false as appropriate
1364 *
1365 * *Note*: when called on an array or array-like object, `includesAF` is run in parallel and all elements will be resolved even if one of the first few elements is a match; if this behavior is not desireable, consider using `series.includesAF` or its alias, `io.includesAF`
1366 *
1367 * @param {any} searchItem the element or string to search for
1368 * @param {Number=} fromIndex the index at which to begin searching for `searchItem`; a negative value searches from the index of `array/string.length - fromIndex`; defaults to `0`
1369 * @returns {Promise.<Boolean>} `Promise` that resolves to `true` if `searchItem` is found; otherwise, `false`
1370 * @example
1371 *
1372 * // includesAF on an array of promises
1373 * const nums = [1, 2, 3].map(n => Promise.resolve(n));
1374 *
1375 * AsyncAF(nums).includesAF(2); // Promise that resolves to true
1376 *
1377 * AsyncAF(nums).includesAF(5); // Promise that resolves to false
1378 *
1379 * AsyncAF(nums).includesAF(1, 1); // Promise that resolves to false
1380 *
1381 * AsyncAF(nums).includesAF(3, -1); // Promise that resolves to true
1382 *
1383 * // includesAF on a promise-wrapped string
1384 * const string = Promise.resolve('test string');
1385 *
1386 * AsyncAF(string).includesAF('test'); // Promise that resolves to true
1387 *
1388 * AsyncAF(string).includesAF('nope'); // Promise that resolves to false
1389 *
1390 * AsyncAF(string).includesAF('test', 5); // Promise that resolves to false
1391 *
1392 * AsyncAF(string).includesAF('string', -6); // Promise that resolves to true
1393 *
1394 * // includesAF on an array-like object
1395 * (async function () {
1396 * if (await AsyncAF(arguments).includesAF(2)) {
1397 * console.log('2 is included');
1398 * }
1399 * })(1, 2, 3); // logs '2 is included'
1400 *
1401 * @since 3.4.0
1402 * @see includes (alias)
1403 * @see {@link AsyncAF#series series.includesAF}
1404 * @memberof AsyncAF#
1405 */
1406
1407
1408var includesAF = function includesAF(searchItem) {
1409 var _this = this;
1410
1411 var fromIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1412 return this.then(function (arrOrStr) {
1413 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__["default"])(arrOrStr)) throw TypeError("includesAF cannot be called on ".concat(arrOrStr, ", only on an Array, String, or array-like Object"));
1414 var length = arrOrStr.length >>> 0;
1415 var fromIdx = fromIndex | 0;
1416 return typeof arrOrStr === 'string' ? arrOrStr.includes(searchItem, fromIdx) : _this.inSeries ? (length || false) && function seriesIncludesAF(i) {
1417 return Promise.resolve(arrOrStr[i]).then(function (el) {
1418 if (sameValueZero(el, searchItem)) return true;
1419 if (i >= length - 1) return false;
1420 return seriesIncludesAF(i + 1);
1421 });
1422 }(Math.max(fromIdx >= 0 ? fromIdx : length - Math.abs(fromIdx), 0)) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_1__["parallel"])(arrOrStr).then(function (arr) {
1423 return arr.includes(searchItem, fromIdx);
1424 });
1425 });
1426};
1427
1428/* harmony default export */ __webpack_exports__["default"] = (includesAF);
1429
1430/***/ }),
1431
1432/***/ "./lib/methods/arrays/indexOfAF.js":
1433/***/ (function(module, __webpack_exports__, __webpack_require__) {
1434
1435"use strict";
1436__webpack_require__.r(__webpack_exports__);
1437/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1438/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1439
1440
1441/**
1442 * resolves to the first index of the specified element or string in an array, string, or array-like object, starting the search at `fromIndex`; if the value is not found, resolves to `-1`
1443 *
1444 * *Note*: when called on an array or array-like object, `indexOfAF` is run in parallel and all elements will be resolved even if one of the first few indices is a match; if this behavior is not desireable, consider using `series.indexOfAF` or its alias, `io.indexOfAF`
1445 *
1446 * @param {any} searchItem the element or string to search for
1447 * @param {Number=} fromIndex the index at which to begin searching for `searchItem`; a negative value searches from the index of `array/string.length - fromIndex`; defaults to `0`
1448 * @returns {Promise.<Number>} `Promise` that resolves to the index of `searchItem` if found; otherwise, `-1`
1449 * @example
1450 *
1451 * // indexOfAF on an array of promises
1452 * const nums = [1, 2, 3].map(n => Promise.resolve(n));
1453 *
1454 * AsyncAF(nums).indexOfAF(2); // Promise that resolves to 1
1455 *
1456 * AsyncAF(nums).indexOfAF(5); // Promise that resolves to -1
1457 *
1458 * AsyncAF(nums).indexOfAF(1, 1); // Promise that resolves to -1
1459 *
1460 * AsyncAF(nums).indexOfAF(3, -1); // Promise that resolves to 2
1461 *
1462 * // indexOfAF on a promise-wrapped string
1463 * const string = Promise.resolve('test string');
1464 *
1465 * AsyncAF(string).indexOfAF('test'); // Promise that resolves to 0
1466 *
1467 * AsyncAF(string).indexOfAF('nope'); // Promise that resolves to -1
1468 *
1469 * AsyncAF(string).indexOfAF('test', 5); // Promise that resolves to -1
1470 *
1471 * AsyncAF(string).indexOfAF('string', -6); // Promise that resolves to 5
1472 *
1473 * // indexOfAF on an array-like object
1474 * (async function () {
1475 * if (await AsyncAF(arguments).indexOfAF(2) > -1) {
1476 * console.log('2 is included');
1477 * }
1478 * })(1, 2, 3); // logs '2 is included'
1479 *
1480 * @since 3.5.0
1481 * @see indexOf (alias)
1482 * @see {@link AsyncAF#series series.indexOfAF}
1483 * @memberof AsyncAF#
1484 */
1485
1486var indexOfAF = function indexOfAF(searchItem) {
1487 var _this = this;
1488
1489 var fromIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1490 return this.then(function (arrOrStr) {
1491 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__["default"])(arrOrStr)) throw TypeError("indexOfAF cannot be called on ".concat(arrOrStr, ", only on an Array, String, or array-like Object"));
1492 var length = arrOrStr.length >>> 0;
1493 var fromIdx = fromIndex | 0;
1494 return typeof arrOrStr === 'string' ? arrOrStr.indexOf(searchItem, fromIdx) : _this.inSeries ? function seriesIndexOfAF(i) {
1495 return Promise.resolve(arrOrStr[i]).then(function (el) {
1496 if (i in arrOrStr && el === searchItem) return i;
1497 if (i >= length - 1) return -1;
1498 return seriesIndexOfAF(i + 1);
1499 });
1500 }(Math.max(fromIdx >= 0 ? fromIdx : length - Math.abs(fromIdx), 0)) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_1__["parallel"])(arrOrStr).then(function (arr) {
1501 return arr.indexOf(searchItem, fromIdx);
1502 });
1503 });
1504};
1505
1506/* harmony default export */ __webpack_exports__["default"] = (indexOfAF);
1507
1508/***/ }),
1509
1510/***/ "./lib/methods/arrays/joinAF.js":
1511/***/ (function(module, __webpack_exports__, __webpack_require__) {
1512
1513"use strict";
1514__webpack_require__.r(__webpack_exports__);
1515/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1516/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1517
1518
1519/**
1520 * joins all elements of an array or array-like object into a string and resolves to that string
1521 *
1522 * @param {any} separator the string that separates each element in the resulting string; defaults to `','`; non-string separators will be converted to strings if necessary; if `separator` is an empty string `''`, the array elements are joined without any characters between them
1523 * @returns {Promise.<String>} `Promise` that resolves to a string with all array elements joined; if array.length is `0`, an empty string `''` is returned
1524 * @example
1525 *
1526 * const animals = ['cow', 'chicken', 'cat', 'dog'].map(a => Promise.resolve(a));
1527 *
1528 * // joinAF separator defaults to ','
1529 * AsyncAF(animals).joinAF(); // Promise that resolves to 'cow,chicken,cat,dog'
1530 *
1531 * // specifying separator
1532 * AsyncAF(animals).joinAF(' & '); // Promise that resolves to 'cow & chicken & cat & dog'
1533 *
1534 * // a non-string separator will be converted to a string
1535 * AsyncAF(animals).joinAF(2); // Promise that resolves to 'cow2chicken2cat2dog'
1536 *
1537 * // empty string separator
1538 * AsyncAF(animals).joinAF(''); // Promise that resolves to 'cowchickencatdog'
1539 *
1540 * // joining an empty array resolves to an empty string
1541 * AsyncAF([]).joinAF('+'); // Promise that resolves to ''
1542 *
1543 * // joinAF on an array-like object
1544 * (async function () {
1545 * const list = await AsyncAF(arguments).joinAF(' - ');
1546 * console.log(`Shopping List: ${list}`);
1547 * })('eggs', 'milk', 'butter', 'pancake mix');
1548 * // Shopping List: eggs - milk - butter - pancake mix
1549 *
1550 * @since 3.6.0
1551 * @see join (alias)
1552 * @memberof AsyncAF#
1553 */
1554
1555var joinAF = function joinAF() {
1556 var separator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ',';
1557 return this.then(function (arr) {
1558 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) throw TypeError("joinAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1559 return Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_1__["parallel"])(arr).then(function (arr) {
1560 return arr.join(separator);
1561 });
1562 });
1563};
1564
1565Object.defineProperty(joinAF, 'length', {
1566 value: 1
1567});
1568/* harmony default export */ __webpack_exports__["default"] = (joinAF);
1569
1570/***/ }),
1571
1572/***/ "./lib/methods/arrays/lastIndexOfAF.js":
1573/***/ (function(module, __webpack_exports__, __webpack_require__) {
1574
1575"use strict";
1576__webpack_require__.r(__webpack_exports__);
1577/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1578/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1579
1580
1581/**
1582 * resolves to the last index of the specified element or string, searching backwards in an array, string, or array-like object; `fromIndex` offsets the start of the search; if the value is not found, resolves to `-1`
1583 *
1584 * *Note*: when called on an array or array-like object, `lastIndexOfAF` is run in parallel and all elements will be resolved even if one of the last few indices is a match; if this behavior is not desireable, consider using `series.lastIndexOfAF` or its alias, `io.lastIndexOfAF`
1585 *
1586 * @param {any} searchItem the element or string to search for
1587 * @param {Number=} fromIndex the index at which to begin searching backwards for `searchItem`; a negative value searches from the index of `array/string.length - fromIndex`; defaults to `array/string.length - 1`
1588 * @returns {Promise.<Number>} `Promise` that resolves to the last index of `searchItem` if found; otherwise, `-1`
1589 * @example
1590 *
1591 * // lastIndexOfAF on an array of promises
1592 * const nums = [1, 1, 2, 2, 3, 3].map(n => Promise.resolve(n));
1593 *
1594 * AsyncAF(nums).lastIndexOfAF(2); // Promise that resolves to 3
1595 *
1596 * AsyncAF(nums).lastIndexOfAF(5); // Promise that resolves to -1
1597 *
1598 * AsyncAF(nums).lastIndexOfAF(2, -4); // Promise that resolves to 2
1599 *
1600 * AsyncAF(nums).lastIndexOfAF(3, -3); // Promise that resolves to -1
1601 *
1602 * // lastIndexOfAF on a promise-wrapped string
1603 * const string = Promise.resolve('test string to test');
1604 *
1605 * AsyncAF(string).lastIndexOfAF('test'); // Promise that resolves to 15
1606 *
1607 * AsyncAF(string).lastIndexOfAF('nope'); // Promise that resolves to -1
1608 *
1609 * AsyncAF(string).lastIndexOfAF('test', -5); // Promise that resolves to 0
1610 *
1611 * AsyncAF(string).lastIndexOfAF('to', -7); // Promise that resolves to -1
1612 *
1613 * // lastIndexOfAF on an array-like object
1614 * (async function () {
1615 * const lastIndexOf2 = await AsyncAF(arguments).lastIndexOfAF(2);
1616 * console.log(`the last index of 2 in the arguments array-like object is ${lastIndexOf2}`)
1617 * })(1, 1, 2, 2, 3, 3); // the last index of 2 in the arguments array-like object is 3
1618 *
1619 * @since 3.6.0
1620 * @see lastIndexOf (alias)
1621 * @see {@link AsyncAF#series series.lastIndexOfAF}
1622 * @memberof AsyncAF#
1623 */
1624
1625var lastIndexOfAF = function lastIndexOfAF(searchItem) {
1626 var _this = this;
1627
1628 var fromIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1629 return this.then(function (arrOrStr) {
1630 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_0__["default"])(arrOrStr)) throw TypeError("lastIndexOfAF cannot be called on ".concat(arrOrStr, ", only on an Array, String, or array-like Object"));
1631 var len = arrOrStr.length >>> 0;
1632 var fromIdx = Number(fromIndex);
1633 if (Number.isNaN(fromIdx)) fromIdx = len - 1;
1634 return typeof arrOrStr === 'string' ? arrOrStr.lastIndexOf(searchItem, fromIdx) : _this.inSeries ? function seriesLastIndexOfAF(i) {
1635 return Promise.resolve(arrOrStr[i]).then(function (el) {
1636 if (i in arrOrStr && el === searchItem) return i;
1637 if (i <= 0) return -1;
1638 return seriesLastIndexOfAF(i - 1);
1639 });
1640 }(Math.min(fromIdx >= 0 ? fromIdx : Math.max(len - Math.abs(fromIdx), 0), len - 1)) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_1__["parallel"])(arrOrStr).then(function (arr) {
1641 return arr.lastIndexOf(searchItem, fromIdx);
1642 });
1643 });
1644};
1645
1646/* harmony default export */ __webpack_exports__["default"] = (lastIndexOfAF);
1647
1648/***/ }),
1649
1650/***/ "./lib/methods/arrays/mapAF.js":
1651/***/ (function(module, __webpack_exports__, __webpack_require__) {
1652
1653"use strict";
1654__webpack_require__.r(__webpack_exports__);
1655/* harmony import */ var _internal_commonCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/commonCallback.js");
1656/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1657/* harmony import */ var _internal_promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/promiseAllWithHoles.js");
1658/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1659 // eslint-disable-line no-unused-vars
1660
1661
1662
1663
1664/**
1665 * creates a new `Array` with the results of calling a provided function on every element in the original array
1666 *
1667 * if any elements are a `Promise`, they will first be resolved in parallel and then processed
1668 *
1669 * *Note*: if you'd rather resolve and process elements in series, consider using `series.mapAF` or its alias, `io.mapAF`
1670 *
1671 * @param {callback} callback function that produces an element of the new `Array`
1672 *
1673 * `callback` accepts three arguments:
1674 * - `currentValue` value of the current element being processed in the array
1675 * - `index`*`(optional)`* index of `currentValue` in the array
1676 * - `array`*`(optional)`* the array that mapAF is being applied to
1677 * @param {Object=} thisArg value to use as `this` when executing `callback`
1678 * @returns {Promise.<Array>} `Promise` that resolves to a new `Array` with each element being the result of calling `callback` on each original element
1679 * @example
1680 *
1681 * const promises = [1, 2].map(n => Promise.resolve(n));
1682 *
1683 *
1684 * // basic usage
1685 * const doubled = AsyncAF(promises).mapAF(el => el * 2);
1686 *
1687 * console.log(doubled); // Promise that resolves to [2, 4]
1688 *
1689 * AsyncAF.logAF(doubled); // logs [2, 4]
1690 *
1691 *
1692 * // using .then
1693 * AsyncAF(promises).mapAF(el => el * 3).then(tripled => {
1694 * console.log(tripled); // logs [3, 6]
1695 * });
1696 *
1697 *
1698 * // inside an async function
1699 * (async () => {
1700 * const quadrupled = await AsyncAF(promises).mapAF(
1701 * el => el * 4
1702 * );
1703 * console.log(quadrupled); // logs [4, 8]
1704 * })();
1705 * @since 3.0.0
1706 * @see map (alias)
1707 * @see {@link AsyncAF#series series.mapAF}
1708 * @memberof AsyncAF#
1709 */
1710
1711var mapAF = function mapAF(callback) {
1712 var _this = this;
1713
1714 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1715 return this.then(function (arr) {
1716 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError("mapAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1717 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1718 return _this.inSeries ? Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_3__["serial"])(arr).then(function (arr) {
1719 return arr.reduce(function (map, el, i, arr) {
1720 return map.then(function (map) {
1721 map[i] = Promise.resolve(callback.call(thisArg, el, i, arr));
1722 return Object(_internal_promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_2__["default"])(map);
1723 });
1724 }, Promise.resolve(Array(arr.length >>> 0)));
1725 }) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_3__["parallel"])(arr, callback, thisArg);
1726 });
1727};
1728
1729/* harmony default export */ __webpack_exports__["default"] = (mapAF);
1730
1731/***/ }),
1732
1733/***/ "./lib/methods/arrays/reduceAF.js":
1734/***/ (function(module, __webpack_exports__, __webpack_require__) {
1735
1736"use strict";
1737
1738// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
1739var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js");
1740var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
1741
1742// CONCATENATED MODULE: ./lib/methods/_internal/reduceCallback.js
1743/* eslint-disable no-unused-vars, valid-jsdoc */
1744
1745/**
1746 * @typedef {callback} _
1747 * @param {?} accumulator
1748 * @param {?} currentValue
1749 * @param {Number=} index
1750 * @param {[]=} array
1751 */
1752function reduceCallback_callback(accumulator, currentValue, index, array) {}
1753
1754/* harmony default export */ var reduceCallback = (reduceCallback_callback);
1755// EXTERNAL MODULE: ./lib/methods/_internal/permissiveIsArrayLike.js
1756var permissiveIsArrayLike = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1757
1758// EXTERNAL MODULE: ./lib/methods/_internal/resolve.js
1759var resolve = __webpack_require__("./lib/methods/_internal/resolve.js");
1760
1761// CONCATENATED MODULE: ./lib/methods/arrays/reduceAF.js
1762
1763 // eslint-disable-line no-unused-vars
1764
1765
1766
1767/* eslint-disable prefer-rest-params */
1768
1769/**
1770 * applies a function against an accumulator and each element in an array (from left to right) to reduce it to a single value
1771 *
1772 * if any elements are a `Promise`, they will first be resolved in parallel and then processed in series
1773 *
1774 * *Note*: if this behavior is not desirable, consider using `series.reduceAF` or its alias, `io.reduceAF`; that way, if any elements are a `Promise`, they will both be resolved in series _and_ processed in series
1775 *
1776 * @param {callback} callback function to execute for each element
1777 *
1778 * `callback` accepts up to four arguments:
1779 * - `accumulator` accumulates the callback's return values; the accumulated value previously returned in the last invocation of the callback, or initialValue, if supplied
1780 * - `currentValue` value of the current element being processed in the array
1781 * - `index`*`(optional)`* index of `currentValue` in the array
1782 * - `array`*`(optional)`* the array that `reduceAF` is being applied to
1783 * @param {any=} initialValue value to use as the first argument to the first call of the callback; if no initial value is supplied, the first element in the array will be used; note: calling reduceAF on an empty array with no initial value will throw an error
1784 * @returns {Promise.<any>} `Promise` that resolves to the reduced value
1785 * @example
1786 *
1787 * const promises = [1, 2, 3].map(n => Promise.resolve(n));
1788 *
1789 *
1790 * // basic usage
1791 * const sum = AsyncAF(promises).reduceAF((sum, num) => sum + num);
1792 *
1793 * console.log(sum); // Promise that resolves to 6
1794 *
1795 * AsyncAF.logAF(sum); // logs 6
1796 *
1797 *
1798 * // using .then
1799 * AsyncAF(promises).reduceAF((sum, num) => sum + num).then(sum => {
1800 * console.log(sum); // logs 6
1801 * });
1802 *
1803 *
1804 * // inside an async function
1805 * (async () => {
1806 * const sum = await AsyncAF(promises).reduceAF((sum, num) => sum + num);
1807 * console.log(sum); // logs 6
1808 * })();
1809 *
1810 *
1811 * // using an initial value
1812 * AsyncAF(promises).reduceAF((sum, num) => sum + num, 12) // Promise that resolves to 18
1813 * @since 3.1.0
1814 * @see reduce (alias)
1815 * @see {@link AsyncAF#series series.reduceAF}
1816 * @memberof AsyncAF#
1817 */
1818
1819var reduceAF_reduceAF = function reduceAF(callback
1820/* , initialValue */
1821) {
1822 var _this = this,
1823 _arguments = arguments;
1824
1825 return this.then(function (arr) {
1826 if (!Object(permissiveIsArrayLike["default"])(arr)) throw TypeError("reduceAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1827 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1828 var length = arr.length >>> 0;
1829 if (!length && _arguments.length === 1) throw TypeError('reduceAF cannot be called on an empty array without an initial value');
1830 if (!length) return _arguments[1];
1831
1832 var hole = function hole(i) {
1833 return !(i in arr);
1834 };
1835
1836 var i = 0;
1837 var acc;
1838
1839 if (_arguments.length === 2) {
1840 var _arguments2 = slicedToArray_default()(_arguments, 2);
1841
1842 acc = _arguments2[1];
1843 } else {
1844 while (hole(i)) {
1845 i++;
1846 }
1847
1848 acc = arr[i++];
1849 }
1850
1851 return (_this.inSeries ? resolve["serial"] : resolve["parallel"])(arr).then(function (arr) {
1852 var reduceAF = function reduceAF(acc, i) {
1853 return Promise.resolve(acc).then(function (acc) {
1854 return Promise.resolve(!hole(i) ? callback(acc, arr[i], i, arr) : acc).then(function (acc) {
1855 return i === length - 1 ? acc : reduceAF(acc, i + 1);
1856 });
1857 });
1858 };
1859
1860 return reduceAF(acc, i);
1861 });
1862 });
1863};
1864
1865/* harmony default export */ var arrays_reduceAF = __webpack_exports__["default"] = (reduceAF_reduceAF);
1866
1867/***/ }),
1868
1869/***/ "./lib/methods/arrays/someAF.js":
1870/***/ (function(module, __webpack_exports__, __webpack_require__) {
1871
1872"use strict";
1873__webpack_require__.r(__webpack_exports__);
1874/* harmony import */ var _internal_commonCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/commonCallback.js");
1875/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
1876/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/resolve.js");
1877 // eslint-disable-line no-unused-vars
1878
1879
1880
1881/**
1882 * tests whether at least one element in the array passes the test implemented by the provided callback function
1883 *
1884 * if any elements are a `Promise`, they will first be resolved in parallel and then tested
1885 *
1886 * *Note*: since `someAF` is run in parallel, `callback` will be run on all elements even if one of the first few elements passes the test; if this behavior is not desireable, consider using `series.someAF` or its alias, `io.someAF`
1887 *
1888 * @param {callback} callback function that tests each element of the array
1889 *
1890 * `callback` accepts three arguments:
1891 * - `currentValue` value of the current element being processed in the array
1892 * - `index`*`(optional)`* index of `currentValue` in the array
1893 * - `array`*`(optional)`* the array that `someAF` is being applied to
1894 * @param {Object=} thisArg value to use as `this` when executing `callback`
1895 * @returns {Promise.<Boolean>} `Promise` that resolves to `true` if the callback function returns a truthy value for any array element; otherwise, `false`
1896 * @example
1897 *
1898 * const promises = [1, 2, 3].map(n => Promise.resolve(n));
1899 *
1900 *
1901 * // basic usage
1902 * const someAreEven = AsyncAF(promises).someAF(n => n % 2 === 0);
1903 *
1904 * console.log(someAreEven); // Promise that resolves to true
1905 *
1906 * AsyncAF.logAF(someAreEven); // logs true
1907 *
1908 *
1909 * // using .then
1910 * AsyncAF(promises).someAF(n => n % 2 === 0).then(someAreEven => {
1911 * console.log(someAreEven); // logs true
1912 * });
1913 *
1914 *
1915 * // inside an async function
1916 * (async () => {
1917 * const someAreStrings = await AsyncAF(promises).someAF(
1918 * n => typeof n === 'string'
1919 * );
1920 * console.log(someAreStrings); // logs false
1921 * })();
1922 * @since 3.3.0
1923 * @see some (alias)
1924 * @see {@link AsyncAF#series series.someAF}
1925 * @memberof AsyncAF#
1926 */
1927
1928var someAF = function someAF(callback) {
1929 var _this = this;
1930
1931 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
1932 return this.then(function (arr) {
1933 if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError("someAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
1934 if (typeof callback !== 'function') throw TypeError("".concat(callback, " is not a function"));
1935 var length = arr.length >>> 0;
1936 return _this.inSeries ? (length || false) && function seriesSomeAF(arr, i) {
1937 var hole = !(i in arr);
1938 return Promise.resolve(arr[i]).then(function (el) {
1939 arr[i] = el;
1940 return Promise.resolve(!hole && callback.call(thisArg, el, i, arr)).then(function (bool) {
1941 if (bool && !hole) return true;
1942 if (i === length - 1) return false;
1943 return seriesSomeAF(arr, i + 1);
1944 });
1945 });
1946 }(Array.prototype.slice.call(arr), 0) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(arr, callback, thisArg).then(function (bools) {
1947 return bools.some(Boolean);
1948 });
1949 });
1950};
1951
1952/* harmony default export */ __webpack_exports__["default"] = (someAF);
1953
1954/***/ }),
1955
1956/***/ "./lib/methods/other/logAF.js":
1957/***/ (function(module, __webpack_exports__, __webpack_require__) {
1958
1959"use strict";
1960
1961// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
1962var toConsumableArray = __webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js");
1963var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
1964
1965// CONCATENATED MODULE: ./lib/methods/_internal/logging.js
1966/* eslint-disable no-console */
1967var wrappedLog = function wrappedLog() {
1968 var _console;
1969
1970 console && console.log && (_console = console).log.apply(_console, arguments);
1971};
1972
1973var wrappedWarn = function wrappedWarn() {
1974 var _console2;
1975
1976 console && console.warn && (_console2 = console).warn.apply(_console2, arguments);
1977};
1978
1979
1980// CONCATENATED MODULE: ./lib/methods/other/logAfHelpers/logAfOptions.js
1981
1982/**
1983 * Sets logging options for {@link AsyncAF#logAF logAF}
1984 *
1985 * accepts an options object with the following optional properties:
1986 * - label (`Boolean`) - set to `false` to disable logging the location of calls to logAF
1987 * - duration (`Boolean`) - set to `false` to disable logging the time it takes (in secs) to complete each call to logAF
1988 * - labelFormat (`String`|`Function`) - alters the format of logAF labels; choose between `file` (*default*), `path`, `parent`, `arrow`, or a custom string or function
1989 *
1990 * ```js
1991 * const promise = new Promise(resolve => setTimeout(
1992 * () => resolve(1), 1000)
1993 * );
1994 * ```
1995 * **default logging**
1996 * ```js
1997 * logAF(promise, 2);
1998 *
1999 * // @filename.js:24:1:
2000 * // 1 2
2001 * // in 0.998 secs
2002 * ```
2003 * **turn off label**
2004 * ```js
2005 * logAF.options({ label: false });
2006 * logAF(promise, 2);
2007 *
2008 * // 1 2
2009 * // in 0.999 secs
2010 * ```
2011 * **turn off duration**
2012 * ```js
2013 * logAF.options({ duration: false });
2014 * logAF(promise, 2);
2015 *
2016 * // @filename.js:24:1:
2017 * // 1 2
2018 * ```
2019 * **change labelFormat**
2020 *
2021 * &#9679; file (*default*)
2022 *
2023 * ```js
2024 * logAF.options({ labelFormat: 'file' });
2025 * logAF(promise, 2);
2026 *
2027 * // @filename.js:24:1:
2028 * // 1 2
2029 * // in 0.998 secs
2030 * ```
2031 * &#9679; path
2032 *
2033 * ```js
2034 * logAF.options({ labelFormat: 'path' });
2035 * logAF(promise, 2);
2036 *
2037 * // @/Path/to/current/directory/filename.js:24:1:
2038 * // 1 2
2039 * // in 0.997 secs
2040 * ```
2041 * &#9679; parent
2042 *
2043 * ```js
2044 * logAF.options({ labelFormat: 'parent' });
2045 * logAF(promise, 2);
2046 *
2047 * // @parentDirectory/filename.js:24:1:
2048 * // 1 2
2049 * // in 0.998 secs
2050 * ```
2051 * &#9679; arrow
2052 *
2053 * ```js
2054 * logAF.options({ labelFormat: 'arrow' });
2055 * logAF(promise, 2);
2056 *
2057 * // ========================> 1 2
2058 * // in 0.999 secs
2059 * ```
2060 *
2061 * &#9679; custom (create your own labelFormat)
2062 * - to set a custom labelFormat, set it to any string other than the formats above
2063 *
2064 * ```js
2065 * logAF.options({
2066 * labelFormat: 'I logged this:'
2067 * });
2068 * logAF(promise, 2);
2069 *
2070 * // I logged this: 1 2
2071 * // in 1.000 secs
2072 * ```
2073 *
2074 * - labelFormat also accepts a function with access to an object containing the location variables `file`, `path`, `parent`, `arrow`, `line`, and `col`
2075 *
2076 * e.g., to set the labelFormat to `file:line:col =>`:
2077 * ```js
2078 * logAF.options({
2079 * labelFormat: ({file, line, col}) => `${file}:${line}:${col} =>`
2080 * });
2081 * logAF(promise, 2);
2082 *
2083 * // filename.js:24:1 => 1 2
2084 * // in 0.998 secs
2085 * ```
2086 *
2087 * and just to demonstrate all the location variables in one custom format:
2088 * ```js
2089 * logAF.options({
2090 * labelFormat: ({arrow, line, col, parent, file, path}) =>
2091 * `${arrow}
2092 * line: ${line}
2093 * col: ${col}
2094 * parent: ${parent}
2095 * file: ${file}
2096 * path: ${path}
2097 * `
2098 * });
2099 * logAF(promise, 2);
2100 *
2101 * // ========================>
2102 * // line: 24
2103 * // col: 1
2104 * // parent: parentDirectory/
2105 * // file: filename.js
2106 * // path: /Full/path/to/the/parentDirectory/
2107 * // 1 2
2108 * // in 0.998 secs
2109 * ```
2110 *
2111 * to reset `logAF.options` to its default values, call `logAF.options.reset`
2112 * ```js
2113 * logAF.options.reset();
2114 *
2115 * // options are now:
2116 * // label: true,
2117 * // duration: true,
2118 * // labelFormat: 'file'
2119 * ```
2120 *
2121 * @static
2122 * @param {Object} options the options for logAF
2123 * @param {Boolean} [options.label=true] set to false to turn off the label
2124 * @param {Boolean} [options.duration=true] set to false to turn off duration
2125 * @param {String|Function} [options.labelFormat=file] see examples for sample label formats
2126 * @returns {undefined} sets the options for logAF
2127 * @see {@link AsyncAF#logAF logAF}
2128 * @see logAF.options.reset to reset options to default
2129 * @memberof AsyncAF
2130 * @alias AsyncAF#logAF_options
2131 */
2132
2133var logAfOptions_logAfOptions = function logAfOptions() {
2134 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2135 var label = options.label,
2136 duration = options.duration,
2137 labelFormat = options.labelFormat;
2138 if (typeof label === 'boolean') other_logAF.label = label;
2139 if (typeof duration === 'boolean') other_logAF.duration = duration;
2140 if (labelFormat) if (typeof labelFormat === 'string' || typeof labelFormat === 'function') other_logAF.labelFormat = labelFormat;else other_logAF.wrappedWarn('Warning: logAF labelFormat option must be set to \'file\' (default), \'path\', \'parent\', \'arrow\', or a custom string or function\n');
2141};
2142
2143/* harmony default export */ var logAfHelpers_logAfOptions = (logAfOptions_logAfOptions);
2144// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js
2145var taggedTemplateLiteral = __webpack_require__("./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js");
2146var taggedTemplateLiteral_default = /*#__PURE__*/__webpack_require__.n(taggedTemplateLiteral);
2147
2148// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
2149var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js");
2150var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
2151
2152// CONCATENATED MODULE: ./lib/methods/other/logAfHelpers/customFormat.js
2153
2154
2155
2156function _templateObject4() {
2157 var data = taggedTemplateLiteral_default()(["/"]);
2158
2159 _templateObject4 = function _templateObject4() {
2160 return data;
2161 };
2162
2163 return data;
2164}
2165
2166function _templateObject3() {
2167 var data = taggedTemplateLiteral_default()(["/"]);
2168
2169 _templateObject3 = function _templateObject3() {
2170 return data;
2171 };
2172
2173 return data;
2174}
2175
2176function _templateObject2() {
2177 var data = taggedTemplateLiteral_default()(["/"]);
2178
2179 _templateObject2 = function _templateObject2() {
2180 return data;
2181 };
2182
2183 return data;
2184}
2185
2186function _templateObject() {
2187 var data = taggedTemplateLiteral_default()([":"]);
2188
2189 _templateObject = function _templateObject() {
2190 return data;
2191 };
2192
2193 return data;
2194}
2195
2196var customFormat_custom = function custom(format, fullPath, arrow) {
2197 if (typeof format === 'string') return format;
2198
2199 var _ref = fullPath.split(_templateObject()),
2200 _ref2 = slicedToArray_default()(_ref, 3),
2201 path = _ref2[0],
2202 line = _ref2[1],
2203 col = _ref2[2]; // eslint-disable-line prefer-const
2204
2205
2206 path = path.split(_templateObject2());
2207 var file = path.pop();
2208 path = path.join(_templateObject3());
2209 var parent = "".concat(path.split(_templateObject4()).pop(), "/");
2210 path += '/';
2211 return format({
2212 path: path,
2213 line: line,
2214 col: col,
2215 file: file,
2216 parent: parent,
2217 arrow: arrow
2218 });
2219};
2220
2221/* harmony default export */ var customFormat = (customFormat_custom);
2222// CONCATENATED MODULE: ./lib/methods/other/logAfHelpers/setFormat.js
2223
2224
2225
2226function setFormat_templateObject4() {
2227 var data = taggedTemplateLiteral_default()(["/"]);
2228
2229 setFormat_templateObject4 = function _templateObject4() {
2230 return data;
2231 };
2232
2233 return data;
2234}
2235
2236function setFormat_templateObject3() {
2237 var data = taggedTemplateLiteral_default()(["/"]);
2238
2239 setFormat_templateObject3 = function _templateObject3() {
2240 return data;
2241 };
2242
2243 return data;
2244}
2245
2246function setFormat_templateObject2() {
2247 var data = taggedTemplateLiteral_default()(["/"]);
2248
2249 setFormat_templateObject2 = function _templateObject2() {
2250 return data;
2251 };
2252
2253 return data;
2254}
2255
2256function setFormat_templateObject() {
2257 var data = taggedTemplateLiteral_default()(["\n"], ["\\n"]);
2258
2259 setFormat_templateObject = function _templateObject() {
2260 return data;
2261 };
2262
2263 return data;
2264}
2265
2266
2267
2268var setFormat_setFormat = function setFormat(labelFormat) {
2269 var error = new Error();
2270 /* istanbul ignore if */
2271
2272 if (!error.stack) return '';
2273
2274 var _filter = error.stack.split(setFormat_templateObject()).filter(function (_, i, lines) {
2275 return /logAF(?:\s+|\s+\[.+\]\s+)\(/.test(lines[i ? i - 1 : i]) || /logAfStub(?:\s+|\s+\[.+\]\s+)\(/.test(lines[i]);
2276 }),
2277 _filter2 = slicedToArray_default()(_filter, 1),
2278 targetLine = _filter2[0];
2279
2280 var fullPath = targetLine.slice(targetLine.indexOf(setFormat_templateObject2())).replace(')', '');
2281 var target = fullPath.lastIndexOf(setFormat_templateObject3());
2282 var formats = {
2283 file: function file() {
2284 return "@".concat(fullPath.slice(target + 1), ":\n");
2285 },
2286 path: function path() {
2287 return "@".concat(fullPath, ":\n");
2288 },
2289 parent: function parent() {
2290 var start = fullPath.slice(0, target).lastIndexOf(setFormat_templateObject4()) + 1;
2291 return "@".concat(fullPath.slice(start), ":\n");
2292 },
2293 arrow: function arrow() {
2294 return '========================>';
2295 }
2296 };
2297 return formats[labelFormat] ? formats[labelFormat]() : customFormat(labelFormat, fullPath, formats.arrow());
2298};
2299
2300/* harmony default export */ var logAfHelpers_setFormat = (setFormat_setFormat);
2301// EXTERNAL MODULE: ./lib/methods/_internal/nameFunction.js
2302var nameFunction = __webpack_require__("./lib/methods/_internal/nameFunction.js");
2303
2304// CONCATENATED MODULE: ./lib/methods/other/logAF.js
2305
2306
2307
2308
2309
2310/**
2311 * logs items to the console in the order given
2312 *
2313 * if any items are a promise, they will first be resolved in parallel and then logged
2314 *
2315 * ```js
2316 * import { logAF } from 'async-af';
2317 *
2318 * const promise = new Promise(resolve => setTimeout(
2319 * () => resolve(2), 1000)
2320 * );
2321 *
2322 * logAF(1, promise, 3);
2323 *
2324 * // @filename.js:6:12:
2325 * // 1 2 3
2326 * // in 0.998 secs
2327 * ```
2328 *
2329 * **Note:** since logAF returns a promise, the items in the previous example would be logged *after* any synchronous calls to `console.log`
2330 *
2331 * to produce in-order logging with any surrounding calls to `console.log`, `await` logAF:
2332 * ```js
2333 * logAF.options({ label: false, duration: false });
2334 *
2335 * (async () => {
2336 * console.log(1);
2337 * // ...some code
2338 * await logAF(promise);
2339 * // ...some more code
2340 * console.log(3);
2341 * })();
2342 *
2343 * // 1
2344 * // 2
2345 * // 3
2346 * ```
2347 *
2348 * **experimental feature**: the label may not work correctly in all environments; to turn the label off, set `label` to `false` in {@link AsyncAF#logAF_options logAF.options}, where you can also change the label's format
2349 *
2350 * @static
2351 * @param {any} items The items to print (log to the console)
2352 * @returns {Promise<undefined>} returns a `Promise` that logs items to the console
2353 * @see log (alias)
2354 * @see {@link AsyncAF#logAF_options logAF.options} to turn the label off or change its format
2355 * @see logAF.options.reset to reset options to default
2356 * @since 3.0.0
2357 * @memberof AsyncAF
2358 * @alias AsyncAF#logAF
2359 */
2360
2361var logAF_logAF = function logAF() {
2362 for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {
2363 items[_key] = arguments[_key];
2364 }
2365
2366 if (logAF.label) items.unshift(logAF.setFormat(logAF.labelFormat));
2367 var start = Date.now();
2368 return Promise.all(items).then(function (toLog) {
2369 if (logAF.duration) {
2370 var end = Date.now();
2371 var numberOf = ((end - start) / 1000).toFixed(3);
2372 toLog.push("\n in ".concat(numberOf, " secs"));
2373 }
2374
2375 logAF.wrappedLog.apply(logAF, [''].concat(toConsumableArray_default()(toLog)));
2376 });
2377};
2378
2379Object.defineProperties(logAF_logAF, {
2380 wrappedLog: {
2381 value: wrappedLog,
2382 writable: true
2383 },
2384 wrappedWarn: {
2385 value: wrappedWarn,
2386 writable: true
2387 },
2388 setFormat: {
2389 value: logAfHelpers_setFormat,
2390 writable: true
2391 },
2392 options: {
2393 value: logAfHelpers_logAfOptions,
2394 writable: true
2395 }
2396});
2397(logAF_logAF.options.reset = function logAfOptionsReset() {
2398 logAF_logAF.label = true;
2399 logAF_logAF.labelFormat = 'file';
2400 logAF_logAF.duration = true;
2401})();
2402/* harmony default export */ var other_logAF = __webpack_exports__["default"] = (Object(nameFunction["default"])(logAF_logAF, 'logAF'));
2403
2404/***/ }),
2405
2406/***/ "./lib/methods/strings/splitAF.js":
2407/***/ (function(module, __webpack_exports__, __webpack_require__) {
2408
2409"use strict";
2410__webpack_require__.r(__webpack_exports__);
2411/**
2412 * splits a string into an array of substrings, using a specified separator to determine where to make each split
2413 *
2414 * @param {String|RegExp=} separator a string or regular expression that denotes the points at which each split should occur
2415 * - if a plain-text separator contains more than one character, the entire separator must be found to represent a split point
2416 * - if separator is omitted or does not occur in the string, the array returned will contain one element consisting of the entire string
2417 * - if separator is an empty string, the string is converted to an array of individual characters
2418 * - if separator is a regular expression, the array returned will also contain any separators found as a result of matches within capturing parentheses
2419 * @param {Number=} limit integer specifying a limit on the number of elements to be included in the result; when provided, the string is split at each occurrence of the specified separator but stops including elements when the limit is reached (or the end of the string, if reached sooner); any left-over text is not included in the result
2420 * @returns {Promise.<String[]>} `Promise` that resolves to an array of strings, split at each point the separator occurs in the given string
2421 * @example
2422 *
2423 * // basic usage
2424 * const str = Promise.resolve('s; p; l; i; t');
2425 *
2426 * AsyncAF(str).splitAF('; '); // Promise that resolves to ['s', 'p', 'l', 'i', 't']
2427 *
2428 * // no separator specified or separator not found
2429 * const str = Promise.resolve('splat');
2430 *
2431 * AsyncAF(str).splitAF(); // Promise that resolves to ['splat']
2432 * AsyncAF(str).splitAF('n/a'); // Promise that resolves to ['splat']
2433 *
2434 * // split to individual characters
2435 * const str = Promise.resolve('splitAF');
2436 *
2437 * AsyncAF(str).splitAF(''); // Promise that resolves to ['s', 'p', 'l', 'i', 't', 'A', 'F']
2438 *
2439 * // split on a regular expression
2440 * const str = Promise.resolve('splittedAF');
2441 *
2442 * AsyncAF(str).splitAF(/sp|ted/); // Promise that resolves to ['', 'lit', 'AF']
2443 *
2444 * // and w/ capturing parentheses
2445 *
2446 * AsyncAF(str).splitAF(/(lit|AF)/); // Promise that resolves to ['sp', 'lit', '', 'AF', '']
2447 *
2448 * // setting limit
2449 * const str = Promise.resolve('splitted');
2450 *
2451 * AsyncAF(str).splitAF('', 5); // Promise that resolves to ['s', 'p', 'l', 'i', 't']
2452 * AsyncAF(str).splitAF('', 12); // Promise that resolves to ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
2453 * AsyncAF(str).splitAF('', 0); // Promise that resolves to []
2454 *
2455 * @since 5.1.0
2456 * @see split (alias)
2457 * @memberof AsyncAF#
2458 */
2459var splitAF = function splitAF() {
2460 var separator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
2461 var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
2462 return this.then(function (str) {
2463 if (typeof str !== 'string' || Array.isArray(str)) throw TypeError("splitAF may be called on a string but was called on ".concat(str));
2464 return String.prototype.split.call(str, separator, limit);
2465 });
2466};
2467
2468/* harmony default export */ __webpack_exports__["default"] = (splitAF);
2469
2470/***/ }),
2471
2472/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
2473/***/ (function(module, exports) {
2474
2475function _arrayWithHoles(arr) {
2476 if (Array.isArray(arr)) return arr;
2477}
2478
2479module.exports = _arrayWithHoles;
2480
2481/***/ }),
2482
2483/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
2484/***/ (function(module, exports) {
2485
2486function _arrayWithoutHoles(arr) {
2487 if (Array.isArray(arr)) {
2488 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
2489 arr2[i] = arr[i];
2490 }
2491
2492 return arr2;
2493 }
2494}
2495
2496module.exports = _arrayWithoutHoles;
2497
2498/***/ }),
2499
2500/***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
2501/***/ (function(module, exports) {
2502
2503function _assertThisInitialized(self) {
2504 if (self === void 0) {
2505 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2506 }
2507
2508 return self;
2509}
2510
2511module.exports = _assertThisInitialized;
2512
2513/***/ }),
2514
2515/***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
2516/***/ (function(module, exports) {
2517
2518function _classCallCheck(instance, Constructor) {
2519 if (!(instance instanceof Constructor)) {
2520 throw new TypeError("Cannot call a class as a function");
2521 }
2522}
2523
2524module.exports = _classCallCheck;
2525
2526/***/ }),
2527
2528/***/ "./node_modules/@babel/runtime/helpers/construct.js":
2529/***/ (function(module, exports, __webpack_require__) {
2530
2531var setPrototypeOf = __webpack_require__("./node_modules/@babel/runtime/helpers/setPrototypeOf.js");
2532
2533function isNativeReflectConstruct() {
2534 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
2535 if (Reflect.construct.sham) return false;
2536 if (typeof Proxy === "function") return true;
2537
2538 try {
2539 Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
2540 return true;
2541 } catch (e) {
2542 return false;
2543 }
2544}
2545
2546function _construct(Parent, args, Class) {
2547 if (isNativeReflectConstruct()) {
2548 module.exports = _construct = Reflect.construct;
2549 } else {
2550 module.exports = _construct = function _construct(Parent, args, Class) {
2551 var a = [null];
2552 a.push.apply(a, args);
2553 var Constructor = Function.bind.apply(Parent, a);
2554 var instance = new Constructor();
2555 if (Class) setPrototypeOf(instance, Class.prototype);
2556 return instance;
2557 };
2558 }
2559
2560 return _construct.apply(null, arguments);
2561}
2562
2563module.exports = _construct;
2564
2565/***/ }),
2566
2567/***/ "./node_modules/@babel/runtime/helpers/createClass.js":
2568/***/ (function(module, exports) {
2569
2570function _defineProperties(target, props) {
2571 for (var i = 0; i < props.length; i++) {
2572 var descriptor = props[i];
2573 descriptor.enumerable = descriptor.enumerable || false;
2574 descriptor.configurable = true;
2575 if ("value" in descriptor) descriptor.writable = true;
2576 Object.defineProperty(target, descriptor.key, descriptor);
2577 }
2578}
2579
2580function _createClass(Constructor, protoProps, staticProps) {
2581 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
2582 if (staticProps) _defineProperties(Constructor, staticProps);
2583 return Constructor;
2584}
2585
2586module.exports = _createClass;
2587
2588/***/ }),
2589
2590/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
2591/***/ (function(module, exports) {
2592
2593function _defineProperty(obj, key, value) {
2594 if (key in obj) {
2595 Object.defineProperty(obj, key, {
2596 value: value,
2597 enumerable: true,
2598 configurable: true,
2599 writable: true
2600 });
2601 } else {
2602 obj[key] = value;
2603 }
2604
2605 return obj;
2606}
2607
2608module.exports = _defineProperty;
2609
2610/***/ }),
2611
2612/***/ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js":
2613/***/ (function(module, exports) {
2614
2615function _getPrototypeOf(o) {
2616 module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
2617 return o.__proto__ || Object.getPrototypeOf(o);
2618 };
2619 return _getPrototypeOf(o);
2620}
2621
2622module.exports = _getPrototypeOf;
2623
2624/***/ }),
2625
2626/***/ "./node_modules/@babel/runtime/helpers/inherits.js":
2627/***/ (function(module, exports, __webpack_require__) {
2628
2629var setPrototypeOf = __webpack_require__("./node_modules/@babel/runtime/helpers/setPrototypeOf.js");
2630
2631function _inherits(subClass, superClass) {
2632 if (typeof superClass !== "function" && superClass !== null) {
2633 throw new TypeError("Super expression must either be null or a function");
2634 }
2635
2636 subClass.prototype = Object.create(superClass && superClass.prototype, {
2637 constructor: {
2638 value: subClass,
2639 writable: true,
2640 configurable: true
2641 }
2642 });
2643 if (superClass) setPrototypeOf(subClass, superClass);
2644}
2645
2646module.exports = _inherits;
2647
2648/***/ }),
2649
2650/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
2651/***/ (function(module, exports) {
2652
2653function _iterableToArray(iter) {
2654 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
2655}
2656
2657module.exports = _iterableToArray;
2658
2659/***/ }),
2660
2661/***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
2662/***/ (function(module, exports) {
2663
2664function _iterableToArrayLimit(arr, i) {
2665 var _arr = [];
2666 var _n = true;
2667 var _d = false;
2668 var _e = undefined;
2669
2670 try {
2671 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
2672 _arr.push(_s.value);
2673
2674 if (i && _arr.length === i) break;
2675 }
2676 } catch (err) {
2677 _d = true;
2678 _e = err;
2679 } finally {
2680 try {
2681 if (!_n && _i["return"] != null) _i["return"]();
2682 } finally {
2683 if (_d) throw _e;
2684 }
2685 }
2686
2687 return _arr;
2688}
2689
2690module.exports = _iterableToArrayLimit;
2691
2692/***/ }),
2693
2694/***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js":
2695/***/ (function(module, exports) {
2696
2697function _nonIterableRest() {
2698 throw new TypeError("Invalid attempt to destructure non-iterable instance");
2699}
2700
2701module.exports = _nonIterableRest;
2702
2703/***/ }),
2704
2705/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
2706/***/ (function(module, exports) {
2707
2708function _nonIterableSpread() {
2709 throw new TypeError("Invalid attempt to spread non-iterable instance");
2710}
2711
2712module.exports = _nonIterableSpread;
2713
2714/***/ }),
2715
2716/***/ "./node_modules/@babel/runtime/helpers/objectSpread.js":
2717/***/ (function(module, exports, __webpack_require__) {
2718
2719var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js");
2720
2721function _objectSpread(target) {
2722 for (var i = 1; i < arguments.length; i++) {
2723 var source = arguments[i] != null ? arguments[i] : {};
2724 var ownKeys = Object.keys(source);
2725
2726 if (typeof Object.getOwnPropertySymbols === 'function') {
2727 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
2728 return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2729 }));
2730 }
2731
2732 ownKeys.forEach(function (key) {
2733 defineProperty(target, key, source[key]);
2734 });
2735 }
2736
2737 return target;
2738}
2739
2740module.exports = _objectSpread;
2741
2742/***/ }),
2743
2744/***/ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
2745/***/ (function(module, exports, __webpack_require__) {
2746
2747var _typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");
2748
2749var assertThisInitialized = __webpack_require__("./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
2750
2751function _possibleConstructorReturn(self, call) {
2752 if (call && (_typeof(call) === "object" || typeof call === "function")) {
2753 return call;
2754 }
2755
2756 return assertThisInitialized(self);
2757}
2758
2759module.exports = _possibleConstructorReturn;
2760
2761/***/ }),
2762
2763/***/ "./node_modules/@babel/runtime/helpers/setPrototypeOf.js":
2764/***/ (function(module, exports) {
2765
2766function _setPrototypeOf(o, p) {
2767 module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
2768 o.__proto__ = p;
2769 return o;
2770 };
2771
2772 return _setPrototypeOf(o, p);
2773}
2774
2775module.exports = _setPrototypeOf;
2776
2777/***/ }),
2778
2779/***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js":
2780/***/ (function(module, exports, __webpack_require__) {
2781
2782var arrayWithHoles = __webpack_require__("./node_modules/@babel/runtime/helpers/arrayWithHoles.js");
2783
2784var iterableToArrayLimit = __webpack_require__("./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
2785
2786var nonIterableRest = __webpack_require__("./node_modules/@babel/runtime/helpers/nonIterableRest.js");
2787
2788function _slicedToArray(arr, i) {
2789 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
2790}
2791
2792module.exports = _slicedToArray;
2793
2794/***/ }),
2795
2796/***/ "./node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js":
2797/***/ (function(module, exports) {
2798
2799function _taggedTemplateLiteral(strings, raw) {
2800 if (!raw) {
2801 raw = strings.slice(0);
2802 }
2803
2804 return Object.freeze(Object.defineProperties(strings, {
2805 raw: {
2806 value: Object.freeze(raw)
2807 }
2808 }));
2809}
2810
2811module.exports = _taggedTemplateLiteral;
2812
2813/***/ }),
2814
2815/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
2816/***/ (function(module, exports, __webpack_require__) {
2817
2818var arrayWithoutHoles = __webpack_require__("./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");
2819
2820var iterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/iterableToArray.js");
2821
2822var nonIterableSpread = __webpack_require__("./node_modules/@babel/runtime/helpers/nonIterableSpread.js");
2823
2824function _toConsumableArray(arr) {
2825 return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
2826}
2827
2828module.exports = _toConsumableArray;
2829
2830/***/ }),
2831
2832/***/ "./node_modules/@babel/runtime/helpers/typeof.js":
2833/***/ (function(module, exports) {
2834
2835function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
2836
2837function _typeof(obj) {
2838 if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
2839 module.exports = _typeof = function _typeof(obj) {
2840 return _typeof2(obj);
2841 };
2842 } else {
2843 module.exports = _typeof = function _typeof(obj) {
2844 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
2845 };
2846 }
2847
2848 return _typeof(obj);
2849}
2850
2851module.exports = _typeof;
2852
2853/***/ })
2854
2855/******/ })["default"];
2856});
2857//# sourceMappingURL=index.js.map
\No newline at end of file