ut2 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -134
- package/dist/ut2.js +121 -65
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/clamp.js +4 -3
- package/es/conforms.js +4 -3
- package/es/conformsTo.js +4 -3
- package/es/countBy.js +4 -3
- package/es/curry.js +32 -0
- package/es/defaultTo.js +4 -3
- package/es/every.js +4 -3
- package/es/filter.js +4 -3
- package/es/find.js +4 -3
- package/es/fromPairs.js +4 -3
- package/es/groupBy.js +4 -3
- package/es/index.js +4 -0
- package/es/internals/baseDebounce.js +2 -8
- package/es/internals/createForEach.js +2 -2
- package/es/internals/createReduce.js +2 -2
- package/es/internals/helpers.js +3 -2
- package/es/internals/native.js +2 -1
- package/es/invert.js +22 -0
- package/es/isBigInt.js +8 -0
- package/es/keyBy.js +4 -3
- package/es/map.js +4 -3
- package/es/omit.js +4 -3
- package/es/orderBy.js +4 -3
- package/es/partial.js +16 -11
- package/es/partition.js +4 -3
- package/es/pascalCase.js +11 -0
- package/es/pick.js +4 -3
- package/es/range.js +4 -3
- package/es/some.js +4 -3
- package/es/times.js +4 -3
- package/lib/clamp.js +4 -3
- package/lib/conforms.js +4 -3
- package/lib/conformsTo.js +4 -3
- package/lib/countBy.js +4 -3
- package/lib/curry.js +34 -0
- package/lib/defaultTo.js +4 -3
- package/lib/every.js +4 -3
- package/lib/filter.js +4 -3
- package/lib/find.js +4 -3
- package/lib/fromPairs.js +4 -3
- package/lib/groupBy.js +4 -3
- package/lib/index.js +12 -4
- package/lib/internals/baseDebounce.js +2 -8
- package/lib/internals/createForEach.js +2 -2
- package/lib/internals/createReduce.js +2 -2
- package/lib/internals/helpers.js +2 -1
- package/lib/internals/native.js +1 -0
- package/lib/invert.js +24 -0
- package/lib/isBigInt.js +10 -0
- package/lib/keyBy.js +4 -3
- package/lib/map.js +4 -3
- package/lib/omit.js +4 -3
- package/lib/orderBy.js +4 -3
- package/lib/partial.js +16 -11
- package/lib/partition.js +4 -3
- package/lib/pascalCase.js +13 -0
- package/lib/pick.js +4 -3
- package/lib/range.js +4 -3
- package/lib/some.js +4 -3
- package/lib/times.js +4 -3
- package/package.json +26 -24
- package/types/after.d.ts +2 -1
- package/types/allKeys.d.ts +1 -1
- package/types/allKeysIn.d.ts +1 -1
- package/types/before.d.ts +2 -1
- package/types/clamp.d.ts +29 -2
- package/types/conforms.d.ts +7 -2
- package/types/conformsTo.d.ts +24 -3
- package/types/countBy.d.ts +28 -2
- package/types/curry.d.ts +123 -0
- package/types/debounce.d.ts +2 -1
- package/types/defaultTo.d.ts +6 -3
- package/types/delay.d.ts +2 -1
- package/types/every.d.ts +28 -4
- package/types/filter.d.ts +26 -4
- package/types/find.d.ts +26 -4
- package/types/forEach.d.ts +1 -6
- package/types/forEachRight.d.ts +1 -6
- package/types/fromPairs.d.ts +20 -2
- package/types/groupBy.d.ts +28 -2
- package/types/index.d.ts +4 -0
- package/types/internals/baseDebounce.d.ts +2 -1
- package/types/internals/createForEach.d.ts +7 -6
- package/types/internals/createReduce.d.ts +11 -10
- package/types/internals/helpers.d.ts +1 -0
- package/types/internals/native.d.ts +1 -0
- package/types/internals/types.d.ts +3 -0
- package/types/invert.d.ts +19 -0
- package/types/isBigInt.d.ts +22 -0
- package/types/isFunction.d.ts +2 -1
- package/types/keyBy.d.ts +28 -2
- package/types/keys.d.ts +1 -1
- package/types/keysIn.d.ts +1 -1
- package/types/map.d.ts +28 -4
- package/types/negate.d.ts +2 -1
- package/types/omit.d.ts +6 -1
- package/types/omitBy.d.ts +3 -2
- package/types/once.d.ts +2 -1
- package/types/orderBy.d.ts +43 -2
- package/types/partial.d.ts +63 -11
- package/types/partition.d.ts +38 -2
- package/types/pascalCase.d.ts +27 -0
- package/types/pick.d.ts +6 -1
- package/types/pickBy.d.ts +3 -2
- package/types/range.d.ts +28 -3
- package/types/reduce.d.ts +1 -10
- package/types/reduceRight.d.ts +1 -10
- package/types/some.d.ts +26 -4
- package/types/throttle.d.ts +2 -1
- package/types/times.d.ts +25 -2
package/dist/ut2.js
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
33
33
|
var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
|
|
34
34
|
var MAX_ARRAY_LENGTH = 4294967295;
|
|
35
|
+
var bigIntTag = '[object BigInt]';
|
|
35
36
|
var numberTag = '[object Number]';
|
|
36
37
|
var booleanTag = '[object Boolean]';
|
|
37
38
|
var stringTag = '[object String]';
|
|
@@ -176,7 +177,7 @@
|
|
|
176
177
|
});
|
|
177
178
|
}
|
|
178
179
|
|
|
179
|
-
function
|
|
180
|
+
var fromPairs = function (array) {
|
|
180
181
|
var result = {};
|
|
181
182
|
if (!isArray(array)) {
|
|
182
183
|
return result;
|
|
@@ -185,7 +186,7 @@
|
|
|
185
186
|
result[item[0]] = item[1];
|
|
186
187
|
});
|
|
187
188
|
return result;
|
|
188
|
-
}
|
|
189
|
+
};
|
|
189
190
|
|
|
190
191
|
function intersection(array, other, iteratee, strictCheck) {
|
|
191
192
|
if (iteratee === void 0) { iteratee = identity; }
|
|
@@ -357,7 +358,7 @@
|
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
function createForEach(dir) {
|
|
360
|
-
function
|
|
361
|
+
var forEach = function (collection, iteratee) {
|
|
361
362
|
if (iteratee === void 0) { iteratee = identity; }
|
|
362
363
|
var _keys = !isArrayLike(collection) && keys$1(collection);
|
|
363
364
|
var len = (_keys || collection).length;
|
|
@@ -370,13 +371,13 @@
|
|
|
370
371
|
i += dir;
|
|
371
372
|
}
|
|
372
373
|
return collection;
|
|
373
|
-
}
|
|
374
|
+
};
|
|
374
375
|
return forEach;
|
|
375
376
|
}
|
|
376
377
|
|
|
377
378
|
var forEach = createForEach(1);
|
|
378
379
|
|
|
379
|
-
function
|
|
380
|
+
var countBy = function (collection, iteratee) {
|
|
380
381
|
var result = {};
|
|
381
382
|
var internalIteratee = createIteratee(iteratee);
|
|
382
383
|
forEach(collection, function (item) {
|
|
@@ -389,9 +390,9 @@
|
|
|
389
390
|
}
|
|
390
391
|
});
|
|
391
392
|
return result;
|
|
392
|
-
}
|
|
393
|
+
};
|
|
393
394
|
|
|
394
|
-
function
|
|
395
|
+
var every = function (collection, predicate) {
|
|
395
396
|
if (predicate === void 0) { predicate = identity; }
|
|
396
397
|
var result = true;
|
|
397
398
|
forEach(collection, function (item, index, arr) {
|
|
@@ -401,9 +402,9 @@
|
|
|
401
402
|
}
|
|
402
403
|
});
|
|
403
404
|
return result;
|
|
404
|
-
}
|
|
405
|
+
};
|
|
405
406
|
|
|
406
|
-
function
|
|
407
|
+
var find = function (collection, predicate) {
|
|
407
408
|
if (predicate === void 0) { predicate = identity; }
|
|
408
409
|
var result;
|
|
409
410
|
forEach(collection, function (item, index, arr) {
|
|
@@ -413,9 +414,9 @@
|
|
|
413
414
|
}
|
|
414
415
|
});
|
|
415
416
|
return result;
|
|
416
|
-
}
|
|
417
|
+
};
|
|
417
418
|
|
|
418
|
-
function
|
|
419
|
+
var filter = function (array, predicate) {
|
|
419
420
|
if (predicate === void 0) { predicate = identity; }
|
|
420
421
|
var results = [];
|
|
421
422
|
forEach(array, function (item, index) {
|
|
@@ -424,11 +425,11 @@
|
|
|
424
425
|
}
|
|
425
426
|
});
|
|
426
427
|
return results;
|
|
427
|
-
}
|
|
428
|
+
};
|
|
428
429
|
|
|
429
430
|
var forEachRight = createForEach(-1);
|
|
430
431
|
|
|
431
|
-
function
|
|
432
|
+
var groupBy = function (collection, iteratee) {
|
|
432
433
|
if (iteratee === void 0) { iteratee = identity; }
|
|
433
434
|
var result = {};
|
|
434
435
|
var internalIteratee = createIteratee(iteratee);
|
|
@@ -442,9 +443,9 @@
|
|
|
442
443
|
}
|
|
443
444
|
});
|
|
444
445
|
return result;
|
|
445
|
-
}
|
|
446
|
+
};
|
|
446
447
|
|
|
447
|
-
function
|
|
448
|
+
var keyBy = function (collection, iteratee) {
|
|
448
449
|
if (iteratee === void 0) { iteratee = identity; }
|
|
449
450
|
var result = {};
|
|
450
451
|
var internalIteratee = createIteratee(iteratee);
|
|
@@ -453,7 +454,7 @@
|
|
|
453
454
|
result[key] = item;
|
|
454
455
|
});
|
|
455
456
|
return result;
|
|
456
|
-
}
|
|
457
|
+
};
|
|
457
458
|
|
|
458
459
|
function isNil(value) {
|
|
459
460
|
return value == null;
|
|
@@ -519,7 +520,7 @@
|
|
|
519
520
|
return object.index - other.index;
|
|
520
521
|
}
|
|
521
522
|
|
|
522
|
-
function
|
|
523
|
+
var orderBy = function (collection, iteratees, orders) {
|
|
523
524
|
var result = [];
|
|
524
525
|
iteratees = (isArray(iteratees) ? iteratees : iteratees !== undefined ? [iteratees] : [identity]);
|
|
525
526
|
orders = (isArray(orders) ? orders : orders !== undefined ? [orders] : []);
|
|
@@ -533,18 +534,18 @@
|
|
|
533
534
|
});
|
|
534
535
|
});
|
|
535
536
|
return result.sort(function (a, b) { return compareMultiple(a, b, orders); }).map(function (item) { return item.value; });
|
|
536
|
-
}
|
|
537
|
+
};
|
|
537
538
|
|
|
538
|
-
function
|
|
539
|
+
var map = function (collection, iteratee) {
|
|
539
540
|
if (iteratee === void 0) { iteratee = identity; }
|
|
540
541
|
var result = [];
|
|
541
542
|
forEach(collection, function (item, index, arr) {
|
|
542
543
|
result.push(iteratee(item, index, arr));
|
|
543
544
|
});
|
|
544
545
|
return result;
|
|
545
|
-
}
|
|
546
|
+
};
|
|
546
547
|
|
|
547
|
-
function
|
|
548
|
+
var partition = function (collection, predicate) {
|
|
548
549
|
if (predicate === void 0) { predicate = identity; }
|
|
549
550
|
var result = [[], []];
|
|
550
551
|
var internalIteratee = createIteratee(predicate);
|
|
@@ -552,7 +553,7 @@
|
|
|
552
553
|
result[internalIteratee(item) ? 0 : 1].push(item);
|
|
553
554
|
});
|
|
554
555
|
return result;
|
|
555
|
-
}
|
|
556
|
+
};
|
|
556
557
|
|
|
557
558
|
function createReduce(dir) {
|
|
558
559
|
function reducer(collection, iteratee, memo, initial) {
|
|
@@ -570,11 +571,11 @@
|
|
|
570
571
|
}
|
|
571
572
|
return memo;
|
|
572
573
|
}
|
|
573
|
-
function
|
|
574
|
+
var reduce = function (collection, iteratee, initialValue) {
|
|
574
575
|
if (iteratee === void 0) { iteratee = identity; }
|
|
575
576
|
var initial = arguments.length >= 3;
|
|
576
577
|
return reducer(collection, iteratee, initialValue, initial);
|
|
577
|
-
}
|
|
578
|
+
};
|
|
578
579
|
return reduce;
|
|
579
580
|
}
|
|
580
581
|
|
|
@@ -582,7 +583,7 @@
|
|
|
582
583
|
|
|
583
584
|
var reduceRight = createReduce(-1);
|
|
584
585
|
|
|
585
|
-
function
|
|
586
|
+
var some = function (collection, predicate) {
|
|
586
587
|
if (predicate === void 0) { predicate = identity; }
|
|
587
588
|
var result = false;
|
|
588
589
|
forEach(collection, function (item, index, arr) {
|
|
@@ -592,13 +593,13 @@
|
|
|
592
593
|
}
|
|
593
594
|
});
|
|
594
595
|
return result;
|
|
595
|
-
}
|
|
596
|
+
};
|
|
596
597
|
|
|
597
|
-
function
|
|
598
|
+
var defaultTo = function (value, defaultValue) {
|
|
598
599
|
return value == null || value !== value ? defaultValue : value;
|
|
599
|
-
}
|
|
600
|
+
};
|
|
600
601
|
|
|
601
|
-
var VERSION = "1.
|
|
602
|
+
var VERSION = "1.8.0";
|
|
602
603
|
var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
|
|
603
604
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
604
605
|
function toSource(func) {
|
|
@@ -617,6 +618,7 @@
|
|
|
617
618
|
return '';
|
|
618
619
|
}
|
|
619
620
|
var stubFlase = function () { return false; };
|
|
621
|
+
var stubTrue = function () { return true; };
|
|
620
622
|
|
|
621
623
|
function after(n, func) {
|
|
622
624
|
if (typeof func !== 'function') {
|
|
@@ -647,6 +649,36 @@
|
|
|
647
649
|
};
|
|
648
650
|
}
|
|
649
651
|
|
|
652
|
+
function isUndefined(value) {
|
|
653
|
+
return value === void 0;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
var PLACEHOLDER$1 = {
|
|
657
|
+
__ut2_curry_ph__: null
|
|
658
|
+
};
|
|
659
|
+
var curry = function (func, arity) {
|
|
660
|
+
arity = isUndefined(arity) ? func.length : mathMax(toInteger(arity), 0);
|
|
661
|
+
function wrap() {
|
|
662
|
+
var args = arrayProtoSlice.call(arguments);
|
|
663
|
+
var context = this;
|
|
664
|
+
function inner() {
|
|
665
|
+
var argsInner = arrayProtoSlice.call(arguments);
|
|
666
|
+
for (var i = 0; i < args.length; i++) {
|
|
667
|
+
args[i] = args[i] === PLACEHOLDER$1 && argsInner.length > 0 ? argsInner.shift() : args[i];
|
|
668
|
+
}
|
|
669
|
+
args = args.concat(argsInner);
|
|
670
|
+
var realArgsLength = args.filter(function (arg) { return arg !== PLACEHOLDER$1; }).length;
|
|
671
|
+
if (realArgsLength >= arity) {
|
|
672
|
+
return func.apply(context, args);
|
|
673
|
+
}
|
|
674
|
+
return inner;
|
|
675
|
+
}
|
|
676
|
+
return inner();
|
|
677
|
+
}
|
|
678
|
+
return wrap;
|
|
679
|
+
};
|
|
680
|
+
curry.placeholder = curry._ = PLACEHOLDER$1;
|
|
681
|
+
|
|
650
682
|
function baseDebounce(func, wait, immediate, __throttle__) {
|
|
651
683
|
if (__throttle__ === void 0) { __throttle__ = false; }
|
|
652
684
|
if (typeof func !== 'function') {
|
|
@@ -660,9 +692,7 @@
|
|
|
660
692
|
}
|
|
661
693
|
var timeSinceLastCall = time - lastCallTime;
|
|
662
694
|
var timeSinceLastInvoke = time - lastInvokeTime;
|
|
663
|
-
return
|
|
664
|
-
timeSinceLastCall < 0 ||
|
|
665
|
-
(__throttle__ && timeSinceLastInvoke >= wait));
|
|
695
|
+
return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (__throttle__ && timeSinceLastInvoke >= wait);
|
|
666
696
|
}
|
|
667
697
|
function invokeFunc(time) {
|
|
668
698
|
lastInvokeTime = time;
|
|
@@ -679,11 +709,7 @@
|
|
|
679
709
|
lastArgs = args;
|
|
680
710
|
var time = Date.now();
|
|
681
711
|
var isInvoke = shouldInvoke(time);
|
|
682
|
-
var waitTime = !__throttle__
|
|
683
|
-
? wait
|
|
684
|
-
: !isInvoke && lastCallTime !== undefined && timer === undefined
|
|
685
|
-
? wait - (time - lastCallTime)
|
|
686
|
-
: wait;
|
|
712
|
+
var waitTime = !__throttle__ ? wait : !isInvoke && lastCallTime !== undefined && timer === undefined ? wait - (time - lastCallTime) : wait;
|
|
687
713
|
lastCallTime = time;
|
|
688
714
|
if (isInvoke) {
|
|
689
715
|
if (immediate && timer === undefined) {
|
|
@@ -767,19 +793,21 @@
|
|
|
767
793
|
return before(2, func);
|
|
768
794
|
}
|
|
769
795
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
796
|
+
var PLACEHOLDER = {
|
|
797
|
+
__ut2_partial_ph__: null
|
|
798
|
+
};
|
|
799
|
+
var partial = function (func) {
|
|
800
|
+
var argsOrig = arrayProtoSlice.call(arguments, 1);
|
|
775
801
|
return function () {
|
|
776
|
-
var
|
|
777
|
-
|
|
778
|
-
|
|
802
|
+
var args = [];
|
|
803
|
+
var argsPartial = arrayProtoSlice.call(arguments);
|
|
804
|
+
for (var i = 0; i < argsOrig.length; i++) {
|
|
805
|
+
args[i] = argsOrig[i] === PLACEHOLDER ? argsPartial.shift() : argsOrig[i];
|
|
779
806
|
}
|
|
780
|
-
return func.apply(this, args.concat(
|
|
807
|
+
return func.apply(this, args.concat(argsPartial));
|
|
781
808
|
};
|
|
782
|
-
}
|
|
809
|
+
};
|
|
810
|
+
partial.placeholder = partial._ = PLACEHOLDER;
|
|
783
811
|
|
|
784
812
|
function throttle(func, wait, immediate) {
|
|
785
813
|
if (wait === void 0) { wait = 0; }
|
|
@@ -817,6 +845,10 @@
|
|
|
817
845
|
return nodeIsArrayBuffer ? nodeIsArrayBuffer(value) : getTag(value) === arrayBufferTag;
|
|
818
846
|
}
|
|
819
847
|
|
|
848
|
+
function isBigInt(value) {
|
|
849
|
+
return typeof value === 'bigint' || getTag(value) === bigIntTag;
|
|
850
|
+
}
|
|
851
|
+
|
|
820
852
|
var blobExisted = typeof Blob !== 'undefined';
|
|
821
853
|
function isBlob(value) {
|
|
822
854
|
if (blobExisted && value instanceof Blob) {
|
|
@@ -1271,10 +1303,6 @@
|
|
|
1271
1303
|
return typeof value === 'string' || getTag(value) === stringTag;
|
|
1272
1304
|
}
|
|
1273
1305
|
|
|
1274
|
-
function isUndefined(value) {
|
|
1275
|
-
return value === void 0;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
1306
|
function isWeakMap(value) {
|
|
1279
1307
|
return getTagWithBugfix$1(value) === weakMapTag;
|
|
1280
1308
|
}
|
|
@@ -1355,7 +1383,7 @@
|
|
|
1355
1383
|
return decimalAdjust('round', number, precision);
|
|
1356
1384
|
}
|
|
1357
1385
|
|
|
1358
|
-
function
|
|
1386
|
+
var clamp = function (number, lower, upper) {
|
|
1359
1387
|
if (upper === undefined) {
|
|
1360
1388
|
upper = lower;
|
|
1361
1389
|
lower = undefined;
|
|
@@ -1376,7 +1404,7 @@
|
|
|
1376
1404
|
}
|
|
1377
1405
|
}
|
|
1378
1406
|
return number;
|
|
1379
|
-
}
|
|
1407
|
+
};
|
|
1380
1408
|
|
|
1381
1409
|
function inRange(number, start, end) {
|
|
1382
1410
|
if (end === void 0) { end = 0; }
|
|
@@ -1425,6 +1453,23 @@
|
|
|
1425
1453
|
return getKeysIn(object).concat(getSymbolsIn(object));
|
|
1426
1454
|
}
|
|
1427
1455
|
|
|
1456
|
+
function invert(object, predicate) {
|
|
1457
|
+
if (predicate === void 0) { predicate = stubTrue; }
|
|
1458
|
+
var _keys = keys$1(object);
|
|
1459
|
+
var result = {};
|
|
1460
|
+
_keys.forEach(function (key) {
|
|
1461
|
+
var value = object[key];
|
|
1462
|
+
if (predicate(value, key)) {
|
|
1463
|
+
var valueStr = value != null && typeof value.toString != 'function' ? objectProtoToString.call(value) : value;
|
|
1464
|
+
result[valueStr] = key;
|
|
1465
|
+
}
|
|
1466
|
+
else {
|
|
1467
|
+
result[key] = value;
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
return result;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1428
1473
|
function keysIn(object) {
|
|
1429
1474
|
if (!isObject(object)) {
|
|
1430
1475
|
return [];
|
|
@@ -1486,7 +1531,7 @@
|
|
|
1486
1531
|
return isArray(value) ? value : [value];
|
|
1487
1532
|
}
|
|
1488
1533
|
|
|
1489
|
-
function
|
|
1534
|
+
var omit = function (object, fields) {
|
|
1490
1535
|
if (fields === void 0) { fields = []; }
|
|
1491
1536
|
var keys = allKeysIn(object);
|
|
1492
1537
|
var fieldArr = castArray(fields);
|
|
@@ -1497,7 +1542,7 @@
|
|
|
1497
1542
|
}
|
|
1498
1543
|
});
|
|
1499
1544
|
return result;
|
|
1500
|
-
}
|
|
1545
|
+
};
|
|
1501
1546
|
|
|
1502
1547
|
function pickBy(object, predicate) {
|
|
1503
1548
|
if (predicate === void 0) { predicate = stubFlase; }
|
|
@@ -1519,7 +1564,7 @@
|
|
|
1519
1564
|
return pickBy(object, negate(predicate));
|
|
1520
1565
|
}
|
|
1521
1566
|
|
|
1522
|
-
function
|
|
1567
|
+
var pick = function (object, fields) {
|
|
1523
1568
|
if (fields === void 0) { fields = []; }
|
|
1524
1569
|
var result = {};
|
|
1525
1570
|
var fieldArr = castArray(fields);
|
|
@@ -1529,7 +1574,7 @@
|
|
|
1529
1574
|
}
|
|
1530
1575
|
});
|
|
1531
1576
|
return result;
|
|
1532
|
-
}
|
|
1577
|
+
};
|
|
1533
1578
|
|
|
1534
1579
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
1535
1580
|
function words(string, pattern) {
|
|
@@ -1600,6 +1645,13 @@
|
|
|
1600
1645
|
|
|
1601
1646
|
var lowerFirst = createCaseFirst('toLowerCase');
|
|
1602
1647
|
|
|
1648
|
+
function pascalCase(string, pattern) {
|
|
1649
|
+
return splitCaseWords(string, pattern).reduce(function (prev, cur) {
|
|
1650
|
+
cur = cur.toLowerCase();
|
|
1651
|
+
return prev + upperFirst(cur);
|
|
1652
|
+
}, '');
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1603
1655
|
function snakeCase(string, pattern) {
|
|
1604
1656
|
return splitCaseWords(string, pattern).reduce(function (prev, cur, index) { return prev + (index ? '_' : '') + cur.toLowerCase(); }, '');
|
|
1605
1657
|
}
|
|
@@ -1626,7 +1678,7 @@
|
|
|
1626
1678
|
return splitCaseWords(string, pattern).reduce(function (prev, cur, index) { return prev + (index ? ' ' : '') + cur.toUpperCase(); }, '');
|
|
1627
1679
|
}
|
|
1628
1680
|
|
|
1629
|
-
function
|
|
1681
|
+
var conformsTo = function (object, source) {
|
|
1630
1682
|
var props = allKeys(source);
|
|
1631
1683
|
var length = props.length;
|
|
1632
1684
|
if (isNil(object)) {
|
|
@@ -1644,13 +1696,13 @@
|
|
|
1644
1696
|
}
|
|
1645
1697
|
}
|
|
1646
1698
|
return true;
|
|
1647
|
-
}
|
|
1699
|
+
};
|
|
1648
1700
|
|
|
1649
|
-
function
|
|
1701
|
+
var conforms = function (source) {
|
|
1650
1702
|
return function (object) {
|
|
1651
1703
|
return conformsTo(object, source);
|
|
1652
1704
|
};
|
|
1653
|
-
}
|
|
1705
|
+
};
|
|
1654
1706
|
|
|
1655
1707
|
function constant(value) {
|
|
1656
1708
|
return function () {
|
|
@@ -1679,7 +1731,7 @@
|
|
|
1679
1731
|
};
|
|
1680
1732
|
}
|
|
1681
1733
|
|
|
1682
|
-
function
|
|
1734
|
+
var range = function (start, end, step) {
|
|
1683
1735
|
start = toFinite(start);
|
|
1684
1736
|
if (isNil(end)) {
|
|
1685
1737
|
end = start;
|
|
@@ -1700,7 +1752,7 @@
|
|
|
1700
1752
|
start += step;
|
|
1701
1753
|
}
|
|
1702
1754
|
return result;
|
|
1703
|
-
}
|
|
1755
|
+
};
|
|
1704
1756
|
|
|
1705
1757
|
function sleep(ms) {
|
|
1706
1758
|
if (ms === void 0) { ms = 1000; }
|
|
@@ -1709,7 +1761,7 @@
|
|
|
1709
1761
|
});
|
|
1710
1762
|
}
|
|
1711
1763
|
|
|
1712
|
-
function
|
|
1764
|
+
var times = function (n, iteratee) {
|
|
1713
1765
|
if (iteratee === void 0) { iteratee = identity; }
|
|
1714
1766
|
if (n < 1 || n > MAX_SAFE_INTEGER) {
|
|
1715
1767
|
return [];
|
|
@@ -1723,7 +1775,7 @@
|
|
|
1723
1775
|
index++;
|
|
1724
1776
|
}
|
|
1725
1777
|
return result;
|
|
1726
|
-
}
|
|
1778
|
+
};
|
|
1727
1779
|
|
|
1728
1780
|
function toSafeInteger(value) {
|
|
1729
1781
|
if (!value) {
|
|
@@ -1765,6 +1817,7 @@
|
|
|
1765
1817
|
exports.conformsTo = conformsTo;
|
|
1766
1818
|
exports.constant = constant;
|
|
1767
1819
|
exports.countBy = countBy;
|
|
1820
|
+
exports.curry = curry;
|
|
1768
1821
|
exports.debounce = debounce;
|
|
1769
1822
|
exports.defaultTo = defaultTo;
|
|
1770
1823
|
exports.delay = delay;
|
|
@@ -1785,11 +1838,13 @@
|
|
|
1785
1838
|
exports.identity = identity;
|
|
1786
1839
|
exports.inRange = inRange;
|
|
1787
1840
|
exports.intersection = intersection;
|
|
1841
|
+
exports.invert = invert;
|
|
1788
1842
|
exports.isArguments = isArguments;
|
|
1789
1843
|
exports.isArray = isArray;
|
|
1790
1844
|
exports.isArrayBuffer = isArrayBuffer;
|
|
1791
1845
|
exports.isArrayLike = isArrayLike;
|
|
1792
1846
|
exports.isArrayLikeObject = isArrayLikeObject;
|
|
1847
|
+
exports.isBigInt = isBigInt;
|
|
1793
1848
|
exports.isBlob = isBlob;
|
|
1794
1849
|
exports.isBoolean = isBoolean;
|
|
1795
1850
|
exports.isBuffer = isBuffer;
|
|
@@ -1844,6 +1899,7 @@
|
|
|
1844
1899
|
exports.orderBy = orderBy;
|
|
1845
1900
|
exports.partial = partial;
|
|
1846
1901
|
exports.partition = partition;
|
|
1902
|
+
exports.pascalCase = pascalCase;
|
|
1847
1903
|
exports.pick = pick;
|
|
1848
1904
|
exports.pickBy = pickBy;
|
|
1849
1905
|
exports.random = random;
|