async-rails 2.1.2 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af7ef606c125f81b4b5e89f9a38e3a4cbaf02bc4
4
- data.tar.gz: 468d677fc7c71c7cc48b263b8c6a63dac8981527
3
+ metadata.gz: 87fa3fd0f1c73f460ff534125ba7c4635d8106a2
4
+ data.tar.gz: d8acf4e0a42ea4f8985f445ed8dbedad358447dd
5
5
  SHA512:
6
- metadata.gz: 2b0c36677f3d5d8e8a7e0efdd1537ab6f5ad0e5e461d6cc439de8031eb9da91c564955d78791d677dabccbd45ced981cafeede02b56599f92f94aa2574704abf
7
- data.tar.gz: 5b19bb74de4e9ff0db93162d4a2bee11f0c30e636748a9507908aed8006d1c5ad0fc56cdcd435f1bdc2d60bcaf9e7a60dd51ca660281ebeee5719d63081fb0d5
6
+ metadata.gz: 8e3074c0a08b2c7a38f664326047d0edb7d608e7230681378914c78287b481de818e87de05c1eedced4671328f569b3f84ebb5da097f38da3079adc438e47478
7
+ data.tar.gz: cfd9b3c87368d000562e011bfcd6ad7f940e457191972e133aa7c1b4ca2a13da7da52c0e5079a730e75d4bc59d14ab2b6cc44f8f0c935d7672b3f7a02e1da28d
@@ -1,5 +1,5 @@
1
1
  module Async
2
2
  module Rails
3
- VERSION = "2.1.2"
3
+ VERSION = "2.1.4"
4
4
  end
5
5
  end
@@ -4,26 +4,6 @@
4
4
  (factory((global.async = global.async || {})));
5
5
  }(this, (function (exports) { 'use strict';
6
6
 
7
- /**
8
- * This method returns the first argument it receives.
9
- *
10
- * @static
11
- * @since 0.1.0
12
- * @memberOf _
13
- * @category Util
14
- * @param {*} value Any value.
15
- * @returns {*} Returns `value`.
16
- * @example
17
- *
18
- * var object = { 'a': 1 };
19
- *
20
- * console.log(_.identity(object) === object);
21
- * // => true
22
- */
23
- function identity(value) {
24
- return value;
25
- }
26
-
27
7
  /**
28
8
  * A faster alternative to `Function#apply`, this function invokes `func`
29
9
  * with the `this` binding of `thisArg` and the arguments of `args`.
@@ -56,7 +36,7 @@ var nativeMax = Math.max;
56
36
  * @param {Function} transform The rest array transform.
57
37
  * @returns {Function} Returns the new function.
58
38
  */
59
- function overRest(func, start, transform) {
39
+ function overRest$1(func, start, transform) {
60
40
  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
61
41
  return function() {
62
42
  var args = arguments,
@@ -78,28 +58,152 @@ function overRest(func, start, transform) {
78
58
  }
79
59
 
80
60
  /**
81
- * Creates a function that returns `value`.
61
+ * This method returns the first argument it receives.
82
62
  *
83
63
  * @static
64
+ * @since 0.1.0
84
65
  * @memberOf _
85
- * @since 2.4.0
86
66
  * @category Util
87
- * @param {*} value The value to return from the new function.
88
- * @returns {Function} Returns the new constant function.
67
+ * @param {*} value Any value.
68
+ * @returns {*} Returns `value`.
89
69
  * @example
90
70
  *
91
- * var objects = _.times(2, _.constant({ 'a': 1 }));
92
- *
93
- * console.log(objects);
94
- * // => [{ 'a': 1 }, { 'a': 1 }]
71
+ * var object = { 'a': 1 };
95
72
  *
96
- * console.log(objects[0] === objects[1]);
73
+ * console.log(_.identity(object) === object);
97
74
  * // => true
98
75
  */
99
- function constant(value) {
100
- return function() {
101
- return value;
102
- };
76
+ function identity(value) {
77
+ return value;
78
+ }
79
+
80
+ // Lodash rest function without function.toString()
81
+ // remappings
82
+ function rest(func, start) {
83
+ return overRest$1(func, start, identity);
84
+ }
85
+
86
+ var initialParams = function (fn) {
87
+ return rest(function (args /*..., callback*/) {
88
+ var callback = args.pop();
89
+ fn.call(this, args, callback);
90
+ });
91
+ };
92
+
93
+ function applyEach$1(eachfn) {
94
+ return rest(function (fns, args) {
95
+ var go = initialParams(function (args, callback) {
96
+ var that = this;
97
+ return eachfn(fns, function (fn, cb) {
98
+ fn.apply(that, args.concat([cb]));
99
+ }, callback);
100
+ });
101
+ if (args.length) {
102
+ return go.apply(this, args);
103
+ } else {
104
+ return go;
105
+ }
106
+ });
107
+ }
108
+
109
+ /** Detect free variable `global` from Node.js. */
110
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
111
+
112
+ /** Detect free variable `self`. */
113
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
114
+
115
+ /** Used as a reference to the global object. */
116
+ var root = freeGlobal || freeSelf || Function('return this')();
117
+
118
+ /** Built-in value references. */
119
+ var Symbol$1 = root.Symbol;
120
+
121
+ /** Used for built-in method references. */
122
+ var objectProto = Object.prototype;
123
+
124
+ /** Used to check objects for own properties. */
125
+ var hasOwnProperty = objectProto.hasOwnProperty;
126
+
127
+ /**
128
+ * Used to resolve the
129
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
130
+ * of values.
131
+ */
132
+ var nativeObjectToString = objectProto.toString;
133
+
134
+ /** Built-in value references. */
135
+ var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
136
+
137
+ /**
138
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
139
+ *
140
+ * @private
141
+ * @param {*} value The value to query.
142
+ * @returns {string} Returns the raw `toStringTag`.
143
+ */
144
+ function getRawTag(value) {
145
+ var isOwn = hasOwnProperty.call(value, symToStringTag$1),
146
+ tag = value[symToStringTag$1];
147
+
148
+ try {
149
+ value[symToStringTag$1] = undefined;
150
+ var unmasked = true;
151
+ } catch (e) {}
152
+
153
+ var result = nativeObjectToString.call(value);
154
+ if (unmasked) {
155
+ if (isOwn) {
156
+ value[symToStringTag$1] = tag;
157
+ } else {
158
+ delete value[symToStringTag$1];
159
+ }
160
+ }
161
+ return result;
162
+ }
163
+
164
+ /** Used for built-in method references. */
165
+ var objectProto$1 = Object.prototype;
166
+
167
+ /**
168
+ * Used to resolve the
169
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
170
+ * of values.
171
+ */
172
+ var nativeObjectToString$1 = objectProto$1.toString;
173
+
174
+ /**
175
+ * Converts `value` to a string using `Object.prototype.toString`.
176
+ *
177
+ * @private
178
+ * @param {*} value The value to convert.
179
+ * @returns {string} Returns the converted string.
180
+ */
181
+ function objectToString(value) {
182
+ return nativeObjectToString$1.call(value);
183
+ }
184
+
185
+ /** `Object#toString` result references. */
186
+ var nullTag = '[object Null]';
187
+ var undefinedTag = '[object Undefined]';
188
+
189
+ /** Built-in value references. */
190
+ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
191
+
192
+ /**
193
+ * The base implementation of `getTag` without fallbacks for buggy environments.
194
+ *
195
+ * @private
196
+ * @param {*} value The value to query.
197
+ * @returns {string} Returns the `toStringTag`.
198
+ */
199
+ function baseGetTag(value) {
200
+ if (value == null) {
201
+ return value === undefined ? undefinedTag : nullTag;
202
+ }
203
+ value = Object(value);
204
+ return (symToStringTag && symToStringTag in value)
205
+ ? getRawTag(value)
206
+ : objectToString(value);
103
207
  }
104
208
 
105
209
  /**
@@ -133,20 +237,11 @@ function isObject(value) {
133
237
  }
134
238
 
135
239
  /** `Object#toString` result references. */
240
+ var asyncTag = '[object AsyncFunction]';
136
241
  var funcTag = '[object Function]';
137
242
  var genTag = '[object GeneratorFunction]';
138
243
  var proxyTag = '[object Proxy]';
139
244
 
140
- /** Used for built-in method references. */
141
- var objectProto$1 = Object.prototype;
142
-
143
- /**
144
- * Used to resolve the
145
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
146
- * of values.
147
- */
148
- var objectToString = objectProto$1.toString;
149
-
150
245
  /**
151
246
  * Checks if `value` is classified as a `Function` object.
152
247
  *
@@ -165,236 +260,13 @@ var objectToString = objectProto$1.toString;
165
260
  * // => false
166
261
  */
167
262
  function isFunction(value) {
168
- // The use of `Object#toString` avoids issues with the `typeof` operator
169
- // in Safari 9 which returns 'object' for typed array and other constructors.
170
- var tag = isObject(value) ? objectToString.call(value) : '';
171
- return tag == funcTag || tag == genTag || tag == proxyTag;
172
- }
173
-
174
- /** Detect free variable `global` from Node.js. */
175
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
176
-
177
- /** Detect free variable `self`. */
178
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
179
-
180
- /** Used as a reference to the global object. */
181
- var root = freeGlobal || freeSelf || Function('return this')();
182
-
183
- /** Used to detect overreaching core-js shims. */
184
- var coreJsData = root['__core-js_shared__'];
185
-
186
- /** Used to detect methods masquerading as native. */
187
- var maskSrcKey = (function() {
188
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
189
- return uid ? ('Symbol(src)_1.' + uid) : '';
190
- }());
191
-
192
- /**
193
- * Checks if `func` has its source masked.
194
- *
195
- * @private
196
- * @param {Function} func The function to check.
197
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
198
- */
199
- function isMasked(func) {
200
- return !!maskSrcKey && (maskSrcKey in func);
201
- }
202
-
203
- /** Used for built-in method references. */
204
- var funcProto$1 = Function.prototype;
205
-
206
- /** Used to resolve the decompiled source of functions. */
207
- var funcToString$1 = funcProto$1.toString;
208
-
209
- /**
210
- * Converts `func` to its source code.
211
- *
212
- * @private
213
- * @param {Function} func The function to process.
214
- * @returns {string} Returns the source code.
215
- */
216
- function toSource(func) {
217
- if (func != null) {
218
- try {
219
- return funcToString$1.call(func);
220
- } catch (e) {}
221
- try {
222
- return (func + '');
223
- } catch (e) {}
224
- }
225
- return '';
226
- }
227
-
228
- /**
229
- * Used to match `RegExp`
230
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
231
- */
232
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
233
-
234
- /** Used to detect host constructors (Safari). */
235
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
236
-
237
- /** Used for built-in method references. */
238
- var funcProto = Function.prototype;
239
- var objectProto = Object.prototype;
240
-
241
- /** Used to resolve the decompiled source of functions. */
242
- var funcToString = funcProto.toString;
243
-
244
- /** Used to check objects for own properties. */
245
- var hasOwnProperty = objectProto.hasOwnProperty;
246
-
247
- /** Used to detect if a method is native. */
248
- var reIsNative = RegExp('^' +
249
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
250
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
251
- );
252
-
253
- /**
254
- * The base implementation of `_.isNative` without bad shim checks.
255
- *
256
- * @private
257
- * @param {*} value The value to check.
258
- * @returns {boolean} Returns `true` if `value` is a native function,
259
- * else `false`.
260
- */
261
- function baseIsNative(value) {
262
- if (!isObject(value) || isMasked(value)) {
263
+ if (!isObject(value)) {
263
264
  return false;
264
265
  }
265
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
266
- return pattern.test(toSource(value));
267
- }
268
-
269
- /**
270
- * Gets the value at `key` of `object`.
271
- *
272
- * @private
273
- * @param {Object} [object] The object to query.
274
- * @param {string} key The key of the property to get.
275
- * @returns {*} Returns the property value.
276
- */
277
- function getValue(object, key) {
278
- return object == null ? undefined : object[key];
279
- }
280
-
281
- /**
282
- * Gets the native function at `key` of `object`.
283
- *
284
- * @private
285
- * @param {Object} object The object to query.
286
- * @param {string} key The key of the method to get.
287
- * @returns {*} Returns the function if it's native, else `undefined`.
288
- */
289
- function getNative(object, key) {
290
- var value = getValue(object, key);
291
- return baseIsNative(value) ? value : undefined;
292
- }
293
-
294
- var defineProperty = (function() {
295
- try {
296
- var func = getNative(Object, 'defineProperty');
297
- func({}, '', {});
298
- return func;
299
- } catch (e) {}
300
- }());
301
-
302
- /**
303
- * The base implementation of `setToString` without support for hot loop shorting.
304
- *
305
- * @private
306
- * @param {Function} func The function to modify.
307
- * @param {Function} string The `toString` result.
308
- * @returns {Function} Returns `func`.
309
- */
310
- var baseSetToString = !defineProperty ? identity : function(func, string) {
311
- return defineProperty(func, 'toString', {
312
- 'configurable': true,
313
- 'enumerable': false,
314
- 'value': constant(string),
315
- 'writable': true
316
- });
317
- };
318
-
319
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
320
- var HOT_COUNT = 500;
321
- var HOT_SPAN = 16;
322
-
323
- /* Built-in method references for those with the same name as other `lodash` methods. */
324
- var nativeNow = Date.now;
325
-
326
- /**
327
- * Creates a function that'll short out and invoke `identity` instead
328
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
329
- * milliseconds.
330
- *
331
- * @private
332
- * @param {Function} func The function to restrict.
333
- * @returns {Function} Returns the new shortable function.
334
- */
335
- function shortOut(func) {
336
- var count = 0,
337
- lastCalled = 0;
338
-
339
- return function() {
340
- var stamp = nativeNow(),
341
- remaining = HOT_SPAN - (stamp - lastCalled);
342
-
343
- lastCalled = stamp;
344
- if (remaining > 0) {
345
- if (++count >= HOT_COUNT) {
346
- return arguments[0];
347
- }
348
- } else {
349
- count = 0;
350
- }
351
- return func.apply(undefined, arguments);
352
- };
353
- }
354
-
355
- /**
356
- * Sets the `toString` method of `func` to return `string`.
357
- *
358
- * @private
359
- * @param {Function} func The function to modify.
360
- * @param {Function} string The `toString` result.
361
- * @returns {Function} Returns `func`.
362
- */
363
- var setToString = shortOut(baseSetToString);
364
-
365
- /**
366
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
367
- *
368
- * @private
369
- * @param {Function} func The function to apply a rest parameter to.
370
- * @param {number} [start=func.length-1] The start position of the rest parameter.
371
- * @returns {Function} Returns the new function.
372
- */
373
- function baseRest$1(func, start) {
374
- return setToString(overRest(func, start, identity), func + '');
375
- }
376
-
377
- var initialParams = function (fn) {
378
- return baseRest$1(function (args /*..., callback*/) {
379
- var callback = args.pop();
380
- fn.call(this, args, callback);
381
- });
382
- };
383
-
384
- function applyEach$1(eachfn) {
385
- return baseRest$1(function (fns, args) {
386
- var go = initialParams(function (args, callback) {
387
- var that = this;
388
- return eachfn(fns, function (fn, cb) {
389
- fn.apply(that, args.concat([cb]));
390
- }, callback);
391
- });
392
- if (args.length) {
393
- return go.apply(this, args);
394
- } else {
395
- return go;
396
- }
397
- });
266
+ // The use of `Object#toString` avoids issues with the `typeof` operator
267
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
268
+ var tag = baseGetTag(value);
269
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
398
270
  }
399
271
 
400
272
  /** Used as references for various `Number` constants. */
@@ -541,16 +413,6 @@ function isObjectLike(value) {
541
413
  /** `Object#toString` result references. */
542
414
  var argsTag = '[object Arguments]';
543
415
 
544
- /** Used for built-in method references. */
545
- var objectProto$4 = Object.prototype;
546
-
547
- /**
548
- * Used to resolve the
549
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
550
- * of values.
551
- */
552
- var objectToString$1 = objectProto$4.toString;
553
-
554
416
  /**
555
417
  * The base implementation of `_.isArguments`.
556
418
  *
@@ -559,7 +421,7 @@ var objectToString$1 = objectProto$4.toString;
559
421
  * @returns {boolean} Returns `true` if `value` is an `arguments` object,
560
422
  */
561
423
  function baseIsArguments(value) {
562
- return isObjectLike(value) && objectToString$1.call(value) == argsTag;
424
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
563
425
  }
564
426
 
565
427
  /** Used for built-in method references. */
@@ -734,16 +596,6 @@ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
734
596
  typedArrayTags[setTag] = typedArrayTags[stringTag] =
735
597
  typedArrayTags[weakMapTag] = false;
736
598
 
737
- /** Used for built-in method references. */
738
- var objectProto$5 = Object.prototype;
739
-
740
- /**
741
- * Used to resolve the
742
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
743
- * of values.
744
- */
745
- var objectToString$2 = objectProto$5.toString;
746
-
747
599
  /**
748
600
  * The base implementation of `_.isTypedArray` without Node.js optimizations.
749
601
  *
@@ -753,7 +605,7 @@ var objectToString$2 = objectProto$5.toString;
753
605
  */
754
606
  function baseIsTypedArray(value) {
755
607
  return isObjectLike(value) &&
756
- isLength(value.length) && !!typedArrayTags[objectToString$2.call(value)];
608
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
757
609
  }
758
610
 
759
611
  /**
@@ -852,7 +704,7 @@ function arrayLikeKeys(value, inherited) {
852
704
  }
853
705
 
854
706
  /** Used for built-in method references. */
855
- var objectProto$7 = Object.prototype;
707
+ var objectProto$5 = Object.prototype;
856
708
 
857
709
  /**
858
710
  * Checks if `value` is likely a prototype object.
@@ -863,7 +715,7 @@ var objectProto$7 = Object.prototype;
863
715
  */
864
716
  function isPrototype(value) {
865
717
  var Ctor = value && value.constructor,
866
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7;
718
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
867
719
 
868
720
  return value === proto;
869
721
  }
@@ -886,10 +738,10 @@ function overArg(func, transform) {
886
738
  var nativeKeys = overArg(Object.keys, Object);
887
739
 
888
740
  /** Used for built-in method references. */
889
- var objectProto$6 = Object.prototype;
741
+ var objectProto$4 = Object.prototype;
890
742
 
891
743
  /** Used to check objects for own properties. */
892
- var hasOwnProperty$3 = objectProto$6.hasOwnProperty;
744
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
893
745
 
894
746
  /**
895
747
  * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
@@ -1146,7 +998,7 @@ function doParallel(fn) {
1146
998
  }
1147
999
 
1148
1000
  function _asyncMap(eachfn, arr, iteratee, callback) {
1149
- callback = once(callback || noop);
1001
+ callback = callback || noop;
1150
1002
  arr = arr || [];
1151
1003
  var results = [];
1152
1004
  var counter = 0;
@@ -1347,8 +1199,8 @@ var applyEachSeries = applyEach$1(mapSeries);
1347
1199
  * two
1348
1200
  * three
1349
1201
  */
1350
- var apply$2 = baseRest$1(function (fn, args) {
1351
- return baseRest$1(function (callArgs) {
1202
+ var apply$2 = rest(function (fn, args) {
1203
+ return rest(function (callArgs) {
1352
1204
  return fn.apply(null, args.concat(callArgs));
1353
1205
  });
1354
1206
  });
@@ -1440,7 +1292,7 @@ function asyncify(func) {
1440
1292
  */
1441
1293
  function arrayEach(array, iteratee) {
1442
1294
  var index = -1,
1443
- length = array ? array.length : 0;
1295
+ length = array == null ? 0 : array.length;
1444
1296
 
1445
1297
  while (++index < length) {
1446
1298
  if (iteratee(array[index], index, array) === false) {
@@ -1747,7 +1599,7 @@ var auto = function (tasks, concurrency, callback) {
1747
1599
  function runTask(key, task) {
1748
1600
  if (hasError) return;
1749
1601
 
1750
- var taskCallback = onlyOnce(baseRest$1(function (err, args) {
1602
+ var taskCallback = onlyOnce(rest(function (err, args) {
1751
1603
  runningTasks--;
1752
1604
  if (args.length <= 1) {
1753
1605
  args = args[0];
@@ -1820,7 +1672,7 @@ var auto = function (tasks, concurrency, callback) {
1820
1672
  */
1821
1673
  function arrayMap(array, iteratee) {
1822
1674
  var index = -1,
1823
- length = array ? array.length : 0,
1675
+ length = array == null ? 0 : array.length,
1824
1676
  result = Array(length);
1825
1677
 
1826
1678
  while (++index < length) {
@@ -1829,41 +1681,9 @@ function arrayMap(array, iteratee) {
1829
1681
  return result;
1830
1682
  }
1831
1683
 
1832
- /**
1833
- * Copies the values of `source` to `array`.
1834
- *
1835
- * @private
1836
- * @param {Array} source The array to copy values from.
1837
- * @param {Array} [array=[]] The array to copy values to.
1838
- * @returns {Array} Returns `array`.
1839
- */
1840
- function copyArray(source, array) {
1841
- var index = -1,
1842
- length = source.length;
1843
-
1844
- array || (array = Array(length));
1845
- while (++index < length) {
1846
- array[index] = source[index];
1847
- }
1848
- return array;
1849
- }
1850
-
1851
- /** Built-in value references. */
1852
- var Symbol$1 = root.Symbol;
1853
-
1854
1684
  /** `Object#toString` result references. */
1855
1685
  var symbolTag = '[object Symbol]';
1856
1686
 
1857
- /** Used for built-in method references. */
1858
- var objectProto$8 = Object.prototype;
1859
-
1860
- /**
1861
- * Used to resolve the
1862
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1863
- * of values.
1864
- */
1865
- var objectToString$3 = objectProto$8.toString;
1866
-
1867
1687
  /**
1868
1688
  * Checks if `value` is classified as a `Symbol` primitive or object.
1869
1689
  *
@@ -1883,7 +1703,7 @@ var objectToString$3 = objectProto$8.toString;
1883
1703
  */
1884
1704
  function isSymbol(value) {
1885
1705
  return typeof value == 'symbol' ||
1886
- (isObjectLike(value) && objectToString$3.call(value) == symbolTag);
1706
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
1887
1707
  }
1888
1708
 
1889
1709
  /** Used as references for various `Number` constants. */
@@ -2249,8 +2069,8 @@ function autoInject(tasks, callback) {
2249
2069
  var params;
2250
2070
 
2251
2071
  if (isArray(taskFn)) {
2252
- params = copyArray(taskFn);
2253
- taskFn = params.pop();
2072
+ params = taskFn.slice(0, -1);
2073
+ taskFn = taskFn[taskFn.length - 1];
2254
2074
 
2255
2075
  newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);
2256
2076
  } else if (taskFn.length === 1) {
@@ -2287,7 +2107,7 @@ function fallback(fn) {
2287
2107
  }
2288
2108
 
2289
2109
  function wrap(defer) {
2290
- return baseRest$1(function (fn, args) {
2110
+ return rest(function (fn, args) {
2291
2111
  defer(function () {
2292
2112
  fn.apply(null, args);
2293
2113
  });
@@ -2401,7 +2221,7 @@ function queue(worker, concurrency, payload) {
2401
2221
  }
2402
2222
 
2403
2223
  function _next(tasks) {
2404
- return baseRest$1(function (args) {
2224
+ return rest(function (args) {
2405
2225
  workers -= 1;
2406
2226
 
2407
2227
  for (var i = 0, l = tasks.length; i < l; i++) {
@@ -2703,8 +2523,8 @@ function reduce(coll, memo, iteratee, callback) {
2703
2523
  * });
2704
2524
  * });
2705
2525
  */
2706
- var seq$1 = baseRest$1(function seq(functions) {
2707
- return baseRest$1(function (args) {
2526
+ var seq$1 = rest(function seq(functions) {
2527
+ return rest(function (args) {
2708
2528
  var that = this;
2709
2529
 
2710
2530
  var cb = args[args.length - 1];
@@ -2715,7 +2535,7 @@ var seq$1 = baseRest$1(function seq(functions) {
2715
2535
  }
2716
2536
 
2717
2537
  reduce(functions, args, function (newargs, fn, cb) {
2718
- fn.apply(that, newargs.concat([baseRest$1(function (err, nextargs) {
2538
+ fn.apply(that, newargs.concat([rest(function (err, nextargs) {
2719
2539
  cb(err, nextargs);
2720
2540
  })]));
2721
2541
  }, function (err, results) {
@@ -2759,7 +2579,7 @@ var seq$1 = baseRest$1(function seq(functions) {
2759
2579
  * // result now equals 15
2760
2580
  * });
2761
2581
  */
2762
- var compose = baseRest$1(function (args) {
2582
+ var compose = rest(function (args) {
2763
2583
  return seq$1.apply(null, args.reverse());
2764
2584
  });
2765
2585
 
@@ -2873,7 +2693,7 @@ var concatSeries = doSeries(concat$1);
2873
2693
  * //...
2874
2694
  * }, callback);
2875
2695
  */
2876
- var constant$2 = baseRest$1(function (values) {
2696
+ var constant = rest(function (values) {
2877
2697
  var args = [null].concat(values);
2878
2698
  return initialParams(function (ignoredArgs, callback) {
2879
2699
  return callback.apply(this, args);
@@ -3001,8 +2821,8 @@ var detectLimit = _createTester(eachOfLimit, identity, _findGetResult);
3001
2821
  var detectSeries = _createTester(eachOfSeries, identity, _findGetResult);
3002
2822
 
3003
2823
  function consoleFunc(name) {
3004
- return baseRest$1(function (fn, args) {
3005
- fn.apply(null, args.concat([baseRest$1(function (err, args) {
2824
+ return rest(function (fn, args) {
2825
+ fn.apply(null, args.concat([rest(function (err, args) {
3006
2826
  if (typeof console === 'object') {
3007
2827
  if (err) {
3008
2828
  if (console.error) {
@@ -3072,7 +2892,7 @@ var dir = consoleFunc('dir');
3072
2892
  function doDuring(fn, test, callback) {
3073
2893
  callback = onlyOnce(callback || noop);
3074
2894
 
3075
- var next = baseRest$1(function (err, args) {
2895
+ var next = rest(function (err, args) {
3076
2896
  if (err) return callback(err);
3077
2897
  args.push(check);
3078
2898
  test.apply(this, args);
@@ -3112,7 +2932,7 @@ function doDuring(fn, test, callback) {
3112
2932
  */
3113
2933
  function doWhilst(iteratee, test, callback) {
3114
2934
  callback = onlyOnce(callback || noop);
3115
- var next = baseRest$1(function (err, args) {
2935
+ var next = rest(function (err, args) {
3116
2936
  if (err) return callback(err);
3117
2937
  if (test.apply(this, args)) return iteratee(next);
3118
2938
  callback.apply(null, [null].concat(args));
@@ -3458,10 +3278,26 @@ function baseProperty(key) {
3458
3278
  };
3459
3279
  }
3460
3280
 
3461
- function _filter(eachfn, arr, iteratee, callback) {
3462
- callback = once(callback || noop);
3463
- var results = [];
3281
+ function filterArray(eachfn, arr, iteratee, callback) {
3282
+ var truthValues = new Array(arr.length);
3464
3283
  eachfn(arr, function (x, index, callback) {
3284
+ iteratee(x, function (err, v) {
3285
+ truthValues[index] = !!v;
3286
+ callback(err);
3287
+ });
3288
+ }, function (err) {
3289
+ if (err) return callback(err);
3290
+ var results = [];
3291
+ for (var i = 0; i < arr.length; i++) {
3292
+ if (truthValues[i]) results.push(arr[i]);
3293
+ }
3294
+ callback(null, results);
3295
+ });
3296
+ }
3297
+
3298
+ function filterGeneric(eachfn, coll, iteratee, callback) {
3299
+ var results = [];
3300
+ eachfn(coll, function (x, index, callback) {
3465
3301
  iteratee(x, function (err, v) {
3466
3302
  if (err) {
3467
3303
  callback(err);
@@ -3483,6 +3319,11 @@ function _filter(eachfn, arr, iteratee, callback) {
3483
3319
  });
3484
3320
  }
3485
3321
 
3322
+ function _filter(eachfn, coll, iteratee, callback) {
3323
+ var filter = isArrayLike(coll) ? filterArray : filterGeneric;
3324
+ filter(eachfn, coll, iteratee, callback || noop);
3325
+ }
3326
+
3486
3327
  /**
3487
3328
  * Returns a new array of all the values in `coll` which pass an async truth
3488
3329
  * test. This operation is performed in parallel, but the results array will be
@@ -3779,7 +3620,7 @@ function memoize(fn, hasher) {
3779
3620
  queues[key].push(callback);
3780
3621
  } else {
3781
3622
  queues[key] = [callback];
3782
- fn.apply(null, args.concat([baseRest$1(function (args) {
3623
+ fn.apply(null, args.concat([rest(function (args) {
3783
3624
  memo[key] = args;
3784
3625
  var q = queues[key];
3785
3626
  delete queues[key];
@@ -3842,7 +3683,7 @@ function _parallel(eachfn, tasks, callback) {
3842
3683
  var results = isArrayLike(tasks) ? [] : {};
3843
3684
 
3844
3685
  eachfn(tasks, function (task, key, callback) {
3845
- task(baseRest$1(function (err, args) {
3686
+ task(rest(function (err, args) {
3846
3687
  if (args.length <= 1) {
3847
3688
  args = args[0];
3848
3689
  }
@@ -4243,7 +4084,7 @@ function reduceRight(array, memo, iteratee, callback) {
4243
4084
  */
4244
4085
  function reflect(fn) {
4245
4086
  return initialParams(function reflectOn(args, reflectCallback) {
4246
- args.push(baseRest$1(function callback(err, cbArgs) {
4087
+ args.push(rest(function callback(err, cbArgs) {
4247
4088
  if (err) {
4248
4089
  reflectCallback(null, {
4249
4090
  error: err
@@ -4268,11 +4109,7 @@ function reflect(fn) {
4268
4109
  function reject$1(eachfn, arr, iteratee, callback) {
4269
4110
  _filter(eachfn, arr, function (value, cb) {
4270
4111
  iteratee(value, function (err, v) {
4271
- if (err) {
4272
- cb(err);
4273
- } else {
4274
- cb(null, !v);
4275
- }
4112
+ cb(err, !v);
4276
4113
  });
4277
4114
  }, callback);
4278
4115
  }
@@ -4422,6 +4259,31 @@ var rejectLimit = doParallelLimit(reject$1);
4422
4259
  */
4423
4260
  var rejectSeries = doLimit(rejectLimit, 1);
4424
4261
 
4262
+ /**
4263
+ * Creates a function that returns `value`.
4264
+ *
4265
+ * @static
4266
+ * @memberOf _
4267
+ * @since 2.4.0
4268
+ * @category Util
4269
+ * @param {*} value The value to return from the new function.
4270
+ * @returns {Function} Returns the new constant function.
4271
+ * @example
4272
+ *
4273
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
4274
+ *
4275
+ * console.log(objects);
4276
+ * // => [{ 'a': 1 }, { 'a': 1 }]
4277
+ *
4278
+ * console.log(objects[0] === objects[1]);
4279
+ * // => true
4280
+ */
4281
+ function constant$1(value) {
4282
+ return function() {
4283
+ return value;
4284
+ };
4285
+ }
4286
+
4425
4287
  /**
4426
4288
  * Attempts to get a successful response from `task` no more than `times` times
4427
4289
  * before returning an error. If the task is successful, the `callback` will be
@@ -4514,14 +4376,14 @@ function retry(opts, task, callback) {
4514
4376
 
4515
4377
  var options = {
4516
4378
  times: DEFAULT_TIMES,
4517
- intervalFunc: constant(DEFAULT_INTERVAL)
4379
+ intervalFunc: constant$1(DEFAULT_INTERVAL)
4518
4380
  };
4519
4381
 
4520
4382
  function parseTimes(acc, t) {
4521
4383
  if (typeof t === 'object') {
4522
4384
  acc.times = +t.times || DEFAULT_TIMES;
4523
4385
 
4524
- acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+t.interval || DEFAULT_INTERVAL);
4386
+ acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant$1(+t.interval || DEFAULT_INTERVAL);
4525
4387
 
4526
4388
  acc.errorFilter = t.errorFilter;
4527
4389
  } else if (typeof t === 'number' || typeof t === 'string') {
@@ -5090,7 +4952,7 @@ function unmemoize(fn) {
5090
4952
  function whilst(test, iteratee, callback) {
5091
4953
  callback = onlyOnce(callback || noop);
5092
4954
  if (!test()) return callback(null);
5093
- var next = baseRest$1(function (err, args) {
4955
+ var next = rest(function (err, args) {
5094
4956
  if (err) return callback(err);
5095
4957
  if (test()) return iteratee(next);
5096
4958
  callback.apply(null, [null].concat(args));
@@ -5195,7 +5057,7 @@ var waterfall = function (tasks, callback) {
5195
5057
  return callback.apply(null, [null].concat(args));
5196
5058
  }
5197
5059
 
5198
- var taskCallback = onlyOnce(baseRest$1(function (err, args) {
5060
+ var taskCallback = onlyOnce(rest(function (err, args) {
5199
5061
  if (err) {
5200
5062
  return callback.apply(null, [err].concat(args));
5201
5063
  }
@@ -5245,7 +5107,7 @@ var index = {
5245
5107
  compose: compose,
5246
5108
  concat: concat,
5247
5109
  concatSeries: concatSeries,
5248
- constant: constant$2,
5110
+ constant: constant,
5249
5111
  detect: detect,
5250
5112
  detectLimit: detectLimit,
5251
5113
  detectSeries: detectSeries,
@@ -5337,7 +5199,7 @@ exports.cargo = cargo;
5337
5199
  exports.compose = compose;
5338
5200
  exports.concat = concat;
5339
5201
  exports.concatSeries = concatSeries;
5340
- exports.constant = constant$2;
5202
+ exports.constant = constant;
5341
5203
  exports.detect = detect;
5342
5204
  exports.detectLimit = detectLimit;
5343
5205
  exports.detectSeries = detectSeries;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-18 00:00:00.000000000 Z
11
+ date: 2016-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties