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.
Files changed (115) hide show
  1. package/README.md +138 -134
  2. package/dist/ut2.js +121 -65
  3. package/dist/ut2.js.map +1 -1
  4. package/dist/ut2.min.js +1 -1
  5. package/dist/ut2.min.js.map +1 -1
  6. package/es/clamp.js +4 -3
  7. package/es/conforms.js +4 -3
  8. package/es/conformsTo.js +4 -3
  9. package/es/countBy.js +4 -3
  10. package/es/curry.js +32 -0
  11. package/es/defaultTo.js +4 -3
  12. package/es/every.js +4 -3
  13. package/es/filter.js +4 -3
  14. package/es/find.js +4 -3
  15. package/es/fromPairs.js +4 -3
  16. package/es/groupBy.js +4 -3
  17. package/es/index.js +4 -0
  18. package/es/internals/baseDebounce.js +2 -8
  19. package/es/internals/createForEach.js +2 -2
  20. package/es/internals/createReduce.js +2 -2
  21. package/es/internals/helpers.js +3 -2
  22. package/es/internals/native.js +2 -1
  23. package/es/invert.js +22 -0
  24. package/es/isBigInt.js +8 -0
  25. package/es/keyBy.js +4 -3
  26. package/es/map.js +4 -3
  27. package/es/omit.js +4 -3
  28. package/es/orderBy.js +4 -3
  29. package/es/partial.js +16 -11
  30. package/es/partition.js +4 -3
  31. package/es/pascalCase.js +11 -0
  32. package/es/pick.js +4 -3
  33. package/es/range.js +4 -3
  34. package/es/some.js +4 -3
  35. package/es/times.js +4 -3
  36. package/lib/clamp.js +4 -3
  37. package/lib/conforms.js +4 -3
  38. package/lib/conformsTo.js +4 -3
  39. package/lib/countBy.js +4 -3
  40. package/lib/curry.js +34 -0
  41. package/lib/defaultTo.js +4 -3
  42. package/lib/every.js +4 -3
  43. package/lib/filter.js +4 -3
  44. package/lib/find.js +4 -3
  45. package/lib/fromPairs.js +4 -3
  46. package/lib/groupBy.js +4 -3
  47. package/lib/index.js +12 -4
  48. package/lib/internals/baseDebounce.js +2 -8
  49. package/lib/internals/createForEach.js +2 -2
  50. package/lib/internals/createReduce.js +2 -2
  51. package/lib/internals/helpers.js +2 -1
  52. package/lib/internals/native.js +1 -0
  53. package/lib/invert.js +24 -0
  54. package/lib/isBigInt.js +10 -0
  55. package/lib/keyBy.js +4 -3
  56. package/lib/map.js +4 -3
  57. package/lib/omit.js +4 -3
  58. package/lib/orderBy.js +4 -3
  59. package/lib/partial.js +16 -11
  60. package/lib/partition.js +4 -3
  61. package/lib/pascalCase.js +13 -0
  62. package/lib/pick.js +4 -3
  63. package/lib/range.js +4 -3
  64. package/lib/some.js +4 -3
  65. package/lib/times.js +4 -3
  66. package/package.json +26 -24
  67. package/types/after.d.ts +2 -1
  68. package/types/allKeys.d.ts +1 -1
  69. package/types/allKeysIn.d.ts +1 -1
  70. package/types/before.d.ts +2 -1
  71. package/types/clamp.d.ts +29 -2
  72. package/types/conforms.d.ts +7 -2
  73. package/types/conformsTo.d.ts +24 -3
  74. package/types/countBy.d.ts +28 -2
  75. package/types/curry.d.ts +123 -0
  76. package/types/debounce.d.ts +2 -1
  77. package/types/defaultTo.d.ts +6 -3
  78. package/types/delay.d.ts +2 -1
  79. package/types/every.d.ts +28 -4
  80. package/types/filter.d.ts +26 -4
  81. package/types/find.d.ts +26 -4
  82. package/types/forEach.d.ts +1 -6
  83. package/types/forEachRight.d.ts +1 -6
  84. package/types/fromPairs.d.ts +20 -2
  85. package/types/groupBy.d.ts +28 -2
  86. package/types/index.d.ts +4 -0
  87. package/types/internals/baseDebounce.d.ts +2 -1
  88. package/types/internals/createForEach.d.ts +7 -6
  89. package/types/internals/createReduce.d.ts +11 -10
  90. package/types/internals/helpers.d.ts +1 -0
  91. package/types/internals/native.d.ts +1 -0
  92. package/types/internals/types.d.ts +3 -0
  93. package/types/invert.d.ts +19 -0
  94. package/types/isBigInt.d.ts +22 -0
  95. package/types/isFunction.d.ts +2 -1
  96. package/types/keyBy.d.ts +28 -2
  97. package/types/keys.d.ts +1 -1
  98. package/types/keysIn.d.ts +1 -1
  99. package/types/map.d.ts +28 -4
  100. package/types/negate.d.ts +2 -1
  101. package/types/omit.d.ts +6 -1
  102. package/types/omitBy.d.ts +3 -2
  103. package/types/once.d.ts +2 -1
  104. package/types/orderBy.d.ts +43 -2
  105. package/types/partial.d.ts +63 -11
  106. package/types/partition.d.ts +38 -2
  107. package/types/pascalCase.d.ts +27 -0
  108. package/types/pick.d.ts +6 -1
  109. package/types/pickBy.d.ts +3 -2
  110. package/types/range.d.ts +28 -3
  111. package/types/reduce.d.ts +1 -10
  112. package/types/reduceRight.d.ts +1 -10
  113. package/types/some.d.ts +26 -4
  114. package/types/throttle.d.ts +2 -1
  115. package/types/times.d.ts +25 -2
package/es/clamp.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import defaultTo from './defaultTo.js';
2
2
  import toNumber from './toNumber.js';
3
3
 
4
- function clamp(number, lower, upper) {
4
+ var clamp = function (number, lower, upper) {
5
5
  if (upper === undefined) {
6
6
  upper = lower;
7
7
  lower = undefined;
@@ -22,6 +22,7 @@ function clamp(number, lower, upper) {
22
22
  }
23
23
  }
24
24
  return number;
25
- }
25
+ };
26
+ var clamp$1 = clamp;
26
27
 
27
- export { clamp as default };
28
+ export { clamp$1 as default };
package/es/conforms.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import conformsTo from './conformsTo.js';
2
2
 
3
- function conforms(source) {
3
+ var conforms = function (source) {
4
4
  return function (object) {
5
5
  return conformsTo(object, source);
6
6
  };
7
- }
7
+ };
8
+ var conforms$1 = conforms;
8
9
 
9
- export { conforms as default };
10
+ export { conforms$1 as default };
package/es/conformsTo.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import allKeys from './allKeys.js';
2
2
  import isNil from './isNil.js';
3
3
 
4
- function conformsTo(object, source) {
4
+ var conformsTo = function (object, source) {
5
5
  var props = allKeys(source);
6
6
  var length = props.length;
7
7
  if (isNil(object)) {
@@ -19,6 +19,7 @@ function conformsTo(object, source) {
19
19
  }
20
20
  }
21
21
  return true;
22
- }
22
+ };
23
+ var conformsTo$1 = conformsTo;
23
24
 
24
- export { conformsTo as default };
25
+ export { conformsTo$1 as default };
package/es/countBy.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import forEach from './forEach.js';
2
2
  import createIteratee from './internals/createIteratee.js';
3
3
 
4
- function countBy(collection, iteratee) {
4
+ var countBy = function (collection, iteratee) {
5
5
  var result = {};
6
6
  var internalIteratee = createIteratee(iteratee);
7
7
  forEach(collection, function (item) {
@@ -14,6 +14,7 @@ function countBy(collection, iteratee) {
14
14
  }
15
15
  });
16
16
  return result;
17
- }
17
+ };
18
+ var countBy$1 = countBy;
18
19
 
19
- export { countBy as default };
20
+ export { countBy$1 as default };
package/es/curry.js ADDED
@@ -0,0 +1,32 @@
1
+ import { mathMax, arrayProtoSlice } from './internals/native.js';
2
+ import isUndefined from './isUndefined.js';
3
+ import toInteger from './toInteger.js';
4
+
5
+ var PLACEHOLDER = {
6
+ __ut2_curry_ph__: null
7
+ };
8
+ var curry = function (func, arity) {
9
+ arity = isUndefined(arity) ? func.length : mathMax(toInteger(arity), 0);
10
+ function wrap() {
11
+ var args = arrayProtoSlice.call(arguments);
12
+ var context = this;
13
+ function inner() {
14
+ var argsInner = arrayProtoSlice.call(arguments);
15
+ for (var i = 0; i < args.length; i++) {
16
+ args[i] = args[i] === PLACEHOLDER && argsInner.length > 0 ? argsInner.shift() : args[i];
17
+ }
18
+ args = args.concat(argsInner);
19
+ var realArgsLength = args.filter(function (arg) { return arg !== PLACEHOLDER; }).length;
20
+ if (realArgsLength >= arity) {
21
+ return func.apply(context, args);
22
+ }
23
+ return inner;
24
+ }
25
+ return inner();
26
+ }
27
+ return wrap;
28
+ };
29
+ curry.placeholder = curry._ = PLACEHOLDER;
30
+ var curry$1 = curry;
31
+
32
+ export { curry$1 as default };
package/es/defaultTo.js CHANGED
@@ -1,5 +1,6 @@
1
- function defaultTo(value, defaultValue) {
1
+ var defaultTo = function (value, defaultValue) {
2
2
  return value == null || value !== value ? defaultValue : value;
3
- }
3
+ };
4
+ var defaultTo$1 = defaultTo;
4
5
 
5
- export { defaultTo as default };
6
+ export { defaultTo$1 as default };
package/es/every.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
 
4
- function every(collection, predicate) {
4
+ var every = function (collection, predicate) {
5
5
  if (predicate === void 0) { predicate = identity; }
6
6
  var result = true;
7
7
  forEach(collection, function (item, index, arr) {
@@ -11,6 +11,7 @@ function every(collection, predicate) {
11
11
  }
12
12
  });
13
13
  return result;
14
- }
14
+ };
15
+ var every$1 = every;
15
16
 
16
- export { every as default };
17
+ export { every$1 as default };
package/es/filter.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
 
4
- function filter(array, predicate) {
4
+ var filter = function (array, predicate) {
5
5
  if (predicate === void 0) { predicate = identity; }
6
6
  var results = [];
7
7
  forEach(array, function (item, index) {
@@ -10,6 +10,7 @@ function filter(array, predicate) {
10
10
  }
11
11
  });
12
12
  return results;
13
- }
13
+ };
14
+ var filter$1 = filter;
14
15
 
15
- export { filter as default };
16
+ export { filter$1 as default };
package/es/find.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
 
4
- function find(collection, predicate) {
4
+ var find = function (collection, predicate) {
5
5
  if (predicate === void 0) { predicate = identity; }
6
6
  var result;
7
7
  forEach(collection, function (item, index, arr) {
@@ -11,6 +11,7 @@ function find(collection, predicate) {
11
11
  }
12
12
  });
13
13
  return result;
14
- }
14
+ };
15
+ var find$1 = find;
15
16
 
16
- export { find as default };
17
+ export { find$1 as default };
package/es/fromPairs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import isArray from './isArray.js';
2
2
 
3
- function fromPairs(array) {
3
+ var fromPairs = function (array) {
4
4
  var result = {};
5
5
  if (!isArray(array)) {
6
6
  return result;
@@ -9,6 +9,7 @@ function fromPairs(array) {
9
9
  result[item[0]] = item[1];
10
10
  });
11
11
  return result;
12
- }
12
+ };
13
+ var fromPairs$1 = fromPairs;
13
14
 
14
- export { fromPairs as default };
15
+ export { fromPairs$1 as default };
package/es/groupBy.js CHANGED
@@ -2,7 +2,7 @@ import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
  import createIteratee from './internals/createIteratee.js';
4
4
 
5
- function groupBy(collection, iteratee) {
5
+ var groupBy = function (collection, iteratee) {
6
6
  if (iteratee === void 0) { iteratee = identity; }
7
7
  var result = {};
8
8
  var internalIteratee = createIteratee(iteratee);
@@ -16,6 +16,7 @@ function groupBy(collection, iteratee) {
16
16
  }
17
17
  });
18
18
  return result;
19
- }
19
+ };
20
+ var groupBy$1 = groupBy;
20
21
 
21
- export { groupBy as default };
22
+ export { groupBy$1 as default };
package/es/index.js CHANGED
@@ -26,6 +26,7 @@ export { default as reduceRight } from './reduceRight.js';
26
26
  export { default as some } from './some.js';
27
27
  export { default as after } from './after.js';
28
28
  export { default as before } from './before.js';
29
+ export { default as curry } from './curry.js';
29
30
  export { default as debounce } from './debounce.js';
30
31
  export { default as delay } from './delay.js';
31
32
  export { default as negate } from './negate.js';
@@ -37,6 +38,7 @@ export { default as isArray } from './isArray.js';
37
38
  export { default as isArrayBuffer } from './isArrayBuffer.js';
38
39
  export { default as isArrayLike } from './isArrayLike.js';
39
40
  export { default as isArrayLikeObject } from './isArrayLikeObject.js';
41
+ export { default as isBigInt } from './isBigInt.js';
40
42
  export { default as isBlob } from './isBlob.js';
41
43
  export { default as isBoolean } from './isBoolean.js';
42
44
  export { default as isBuffer } from './isBuffer.js';
@@ -80,6 +82,7 @@ export { default as random } from './random.js';
80
82
  export { default as randomInt } from './randomInt.js';
81
83
  export { default as allKeys } from './allKeys.js';
82
84
  export { default as allKeysIn } from './allKeysIn.js';
85
+ export { default as invert } from './invert.js';
83
86
  export { default as keys } from './keys.js';
84
87
  export { default as keysIn } from './keysIn.js';
85
88
  export { default as merge } from './merge.js';
@@ -94,6 +97,7 @@ export { default as escapeRegExp } from './escapeRegExp.js';
94
97
  export { default as kebabCase } from './kebabCase.js';
95
98
  export { default as lowerCase } from './lowerCase.js';
96
99
  export { default as lowerFirst } from './lowerFirst.js';
100
+ export { default as pascalCase } from './pascalCase.js';
97
101
  export { default as snakeCase } from './snakeCase.js';
98
102
  export { default as unescape } from './unescape.js';
99
103
  export { default as upperCase } from './upperCase.js';
@@ -15,9 +15,7 @@ function baseDebounce(func, wait, immediate, __throttle__) {
15
15
  }
16
16
  var timeSinceLastCall = time - lastCallTime;
17
17
  var timeSinceLastInvoke = time - lastInvokeTime;
18
- return (timeSinceLastCall >= wait ||
19
- timeSinceLastCall < 0 ||
20
- (__throttle__ && timeSinceLastInvoke >= wait));
18
+ return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (__throttle__ && timeSinceLastInvoke >= wait);
21
19
  }
22
20
  function invokeFunc(time) {
23
21
  lastInvokeTime = time;
@@ -34,11 +32,7 @@ function baseDebounce(func, wait, immediate, __throttle__) {
34
32
  lastArgs = args;
35
33
  var time = Date.now();
36
34
  var isInvoke = shouldInvoke(time);
37
- var waitTime = !__throttle__
38
- ? wait
39
- : !isInvoke && lastCallTime !== undefined && timer === undefined
40
- ? wait - (time - lastCallTime)
41
- : wait;
35
+ var waitTime = !__throttle__ ? wait : !isInvoke && lastCallTime !== undefined && timer === undefined ? wait - (time - lastCallTime) : wait;
42
36
  lastCallTime = time;
43
37
  if (isInvoke) {
44
38
  if (immediate && timer === undefined) {
@@ -3,7 +3,7 @@ import isArrayLike from '../isArrayLike.js';
3
3
  import keys from '../keys.js';
4
4
 
5
5
  function createForEach(dir) {
6
- function forEach(collection, iteratee) {
6
+ var forEach = function (collection, iteratee) {
7
7
  if (iteratee === void 0) { iteratee = identity; }
8
8
  var _keys = !isArrayLike(collection) && keys(collection);
9
9
  var len = (_keys || collection).length;
@@ -16,7 +16,7 @@ function createForEach(dir) {
16
16
  i += dir;
17
17
  }
18
18
  return collection;
19
- }
19
+ };
20
20
  return forEach;
21
21
  }
22
22
 
@@ -18,11 +18,11 @@ function createReduce(dir) {
18
18
  }
19
19
  return memo;
20
20
  }
21
- function reduce(collection, iteratee, initialValue) {
21
+ var reduce = function (collection, iteratee, initialValue) {
22
22
  if (iteratee === void 0) { iteratee = identity; }
23
23
  var initial = arguments.length >= 3;
24
24
  return reducer(collection, iteratee, initialValue, initial);
25
- }
25
+ };
26
26
  return reduce;
27
27
  }
28
28
 
@@ -1,7 +1,7 @@
1
1
  import getTag from './getTag.js';
2
2
  import { argumentsTag, functionProtoToString } from './native.js';
3
3
 
4
- var VERSION = "1.7.1";
4
+ var VERSION = "1.8.0";
5
5
  var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
6
6
  var FUNC_ERROR_TEXT = 'Expected a function';
7
7
  function toSource(func) {
@@ -20,5 +20,6 @@ function toSource(func) {
20
20
  return '';
21
21
  }
22
22
  var stubFlase = function () { return false; };
23
+ var stubTrue = function () { return true; };
23
24
 
24
- export { FUNC_ERROR_TEXT, VERSION, stubFlase, supportedArgumentsType, toSource };
25
+ export { FUNC_ERROR_TEXT, VERSION, stubFlase, stubTrue, supportedArgumentsType, toSource };
@@ -26,6 +26,7 @@ var selfExisted = typeof self === 'object' && self;
26
26
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
27
27
  var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
28
28
  var MAX_ARRAY_LENGTH = 4294967295;
29
+ var bigIntTag = '[object BigInt]';
29
30
  var numberTag = '[object Number]';
30
31
  var booleanTag = '[object Boolean]';
31
32
  var stringTag = '[object String]';
@@ -48,4 +49,4 @@ var promiseTag = '[object Promise]';
48
49
  var setTag = '[object Set]';
49
50
  var weakMapTag = '[object WeakMap]';
50
51
 
51
- export { MAX_ARRAY_LENGTH, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, argumentsTag, arrayBufferTag, arrayProto, arrayProtoSlice, arrayTag, blobTag, booleanTag, dataViewTag, dateTag, domExceptionTag, errorTag, functionProto, functionProtoToString, functionTags, globalExisted, globalThisExisted, mapTag, mathAbs, mathCeil, mathFloor, mathMax, mathMin, mathRandom, numberIsFinite, numberIsInteger, numberIsSafeInteger, numberTag, objectGetOwnPropertySymbols, objectGetPrototypeOf, objectKeys, objectProto, objectProtoHasOwnProperty, objectProtoPropertyIsEnumerable, objectProtoToString, objectTag, promiseTag, regExpTag, selfExisted, setTag, stringTag, symbolProto, symbolTag, typedArrayTags, weakMapTag, weakSetTag };
52
+ export { MAX_ARRAY_LENGTH, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, argumentsTag, arrayBufferTag, arrayProto, arrayProtoSlice, arrayTag, bigIntTag, blobTag, booleanTag, dataViewTag, dateTag, domExceptionTag, errorTag, functionProto, functionProtoToString, functionTags, globalExisted, globalThisExisted, mapTag, mathAbs, mathCeil, mathFloor, mathMax, mathMin, mathRandom, numberIsFinite, numberIsInteger, numberIsSafeInteger, numberTag, objectGetOwnPropertySymbols, objectGetPrototypeOf, objectKeys, objectProto, objectProtoHasOwnProperty, objectProtoPropertyIsEnumerable, objectProtoToString, objectTag, promiseTag, regExpTag, selfExisted, setTag, stringTag, symbolProto, symbolTag, typedArrayTags, weakMapTag, weakSetTag };
package/es/invert.js ADDED
@@ -0,0 +1,22 @@
1
+ import { stubTrue } from './internals/helpers.js';
2
+ import { objectProtoToString } from './internals/native.js';
3
+ import keys from './keys.js';
4
+
5
+ function invert(object, predicate) {
6
+ if (predicate === void 0) { predicate = stubTrue; }
7
+ var _keys = keys(object);
8
+ var result = {};
9
+ _keys.forEach(function (key) {
10
+ var value = object[key];
11
+ if (predicate(value, key)) {
12
+ var valueStr = value != null && typeof value.toString != 'function' ? objectProtoToString.call(value) : value;
13
+ result[valueStr] = key;
14
+ }
15
+ else {
16
+ result[key] = value;
17
+ }
18
+ });
19
+ return result;
20
+ }
21
+
22
+ export { invert as default };
package/es/isBigInt.js ADDED
@@ -0,0 +1,8 @@
1
+ import getTag from './internals/getTag.js';
2
+ import { bigIntTag } from './internals/native.js';
3
+
4
+ function isBigInt(value) {
5
+ return typeof value === 'bigint' || getTag(value) === bigIntTag;
6
+ }
7
+
8
+ export { isBigInt as default };
package/es/keyBy.js CHANGED
@@ -2,7 +2,7 @@ import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
  import createIteratee from './internals/createIteratee.js';
4
4
 
5
- function keyBy(collection, iteratee) {
5
+ var keyBy = function (collection, iteratee) {
6
6
  if (iteratee === void 0) { iteratee = identity; }
7
7
  var result = {};
8
8
  var internalIteratee = createIteratee(iteratee);
@@ -11,6 +11,7 @@ function keyBy(collection, iteratee) {
11
11
  result[key] = item;
12
12
  });
13
13
  return result;
14
- }
14
+ };
15
+ var keyBy$1 = keyBy;
15
16
 
16
- export { keyBy as default };
17
+ export { keyBy$1 as default };
package/es/map.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
 
4
- function map(collection, iteratee) {
4
+ var map = function (collection, iteratee) {
5
5
  if (iteratee === void 0) { iteratee = identity; }
6
6
  var result = [];
7
7
  forEach(collection, function (item, index, arr) {
8
8
  result.push(iteratee(item, index, arr));
9
9
  });
10
10
  return result;
11
- }
11
+ };
12
+ var map$1 = map;
12
13
 
13
- export { map as default };
14
+ export { map$1 as default };
package/es/omit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import allKeysIn from './allKeysIn.js';
2
2
  import castArray from './castArray.js';
3
3
 
4
- function omit(object, fields) {
4
+ var omit = function (object, fields) {
5
5
  if (fields === void 0) { fields = []; }
6
6
  var keys = allKeysIn(object);
7
7
  var fieldArr = castArray(fields);
@@ -12,6 +12,7 @@ function omit(object, fields) {
12
12
  }
13
13
  });
14
14
  return result;
15
- }
15
+ };
16
+ var omit$1 = omit;
16
17
 
17
- export { omit as default };
18
+ export { omit$1 as default };
package/es/orderBy.js CHANGED
@@ -4,7 +4,7 @@ import { compareMultiple } from './internals/compare.js';
4
4
  import isArray from './isArray.js';
5
5
  import forEach from './forEach.js';
6
6
 
7
- function orderBy(collection, iteratees, orders) {
7
+ var orderBy = function (collection, iteratees, orders) {
8
8
  var result = [];
9
9
  iteratees = (isArray(iteratees) ? iteratees : iteratees !== undefined ? [iteratees] : [identity]);
10
10
  orders = (isArray(orders) ? orders : orders !== undefined ? [orders] : []);
@@ -18,6 +18,7 @@ function orderBy(collection, iteratees, orders) {
18
18
  });
19
19
  });
20
20
  return result.sort(function (a, b) { return compareMultiple(a, b, orders); }).map(function (item) { return item.value; });
21
- }
21
+ };
22
+ var orderBy$1 = orderBy;
22
23
 
23
- export { orderBy as default };
24
+ export { orderBy$1 as default };
package/es/partial.js CHANGED
@@ -1,15 +1,20 @@
1
- function partial(func) {
2
- var args = [];
3
- for (var _i = 1; _i < arguments.length; _i++) {
4
- args[_i - 1] = arguments[_i];
5
- }
1
+ import { arrayProtoSlice } from './internals/native.js';
2
+
3
+ var PLACEHOLDER = {
4
+ __ut2_partial_ph__: null
5
+ };
6
+ var partial = function (func) {
7
+ var argsOrig = arrayProtoSlice.call(arguments, 1);
6
8
  return function () {
7
- var remainingArgs = [];
8
- for (var _i = 0; _i < arguments.length; _i++) {
9
- remainingArgs[_i] = arguments[_i];
9
+ var args = [];
10
+ var argsPartial = arrayProtoSlice.call(arguments);
11
+ for (var i = 0; i < argsOrig.length; i++) {
12
+ args[i] = argsOrig[i] === PLACEHOLDER ? argsPartial.shift() : argsOrig[i];
10
13
  }
11
- return func.apply(this, args.concat(remainingArgs));
14
+ return func.apply(this, args.concat(argsPartial));
12
15
  };
13
- }
16
+ };
17
+ partial.placeholder = partial._ = PLACEHOLDER;
18
+ var partial$1 = partial;
14
19
 
15
- export { partial as default };
20
+ export { partial$1 as default };
package/es/partition.js CHANGED
@@ -2,7 +2,7 @@ import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
  import createIteratee from './internals/createIteratee.js';
4
4
 
5
- function partition(collection, predicate) {
5
+ var partition = function (collection, predicate) {
6
6
  if (predicate === void 0) { predicate = identity; }
7
7
  var result = [[], []];
8
8
  var internalIteratee = createIteratee(predicate);
@@ -10,6 +10,7 @@ function partition(collection, predicate) {
10
10
  result[internalIteratee(item) ? 0 : 1].push(item);
11
11
  });
12
12
  return result;
13
- }
13
+ };
14
+ var partition$1 = partition;
14
15
 
15
- export { partition as default };
16
+ export { partition$1 as default };
@@ -0,0 +1,11 @@
1
+ import splitCaseWords from './internals/splitCaseWords.js';
2
+ import upperFirst from './upperFirst.js';
3
+
4
+ function pascalCase(string, pattern) {
5
+ return splitCaseWords(string, pattern).reduce(function (prev, cur) {
6
+ cur = cur.toLowerCase();
7
+ return prev + upperFirst(cur);
8
+ }, '');
9
+ }
10
+
11
+ export { pascalCase as default };
package/es/pick.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import castArray from './castArray.js';
2
2
 
3
- function pick(object, fields) {
3
+ var pick = function (object, fields) {
4
4
  if (fields === void 0) { fields = []; }
5
5
  var result = {};
6
6
  var fieldArr = castArray(fields);
@@ -10,6 +10,7 @@ function pick(object, fields) {
10
10
  }
11
11
  });
12
12
  return result;
13
- }
13
+ };
14
+ var pick$1 = pick;
14
15
 
15
- export { pick as default };
16
+ export { pick$1 as default };
package/es/range.js CHANGED
@@ -2,7 +2,7 @@ import { mathMax, mathCeil } from './internals/native.js';
2
2
  import isNil from './isNil.js';
3
3
  import toFinite from './toFinite.js';
4
4
 
5
- function range(start, end, step) {
5
+ var range = function (start, end, step) {
6
6
  start = toFinite(start);
7
7
  if (isNil(end)) {
8
8
  end = start;
@@ -23,6 +23,7 @@ function range(start, end, step) {
23
23
  start += step;
24
24
  }
25
25
  return result;
26
- }
26
+ };
27
+ var range$1 = range;
27
28
 
28
- export { range as default };
29
+ export { range$1 as default };
package/es/some.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import forEach from './forEach.js';
2
2
  import identity from './identity.js';
3
3
 
4
- function some(collection, predicate) {
4
+ var some = function (collection, predicate) {
5
5
  if (predicate === void 0) { predicate = identity; }
6
6
  var result = false;
7
7
  forEach(collection, function (item, index, arr) {
@@ -11,6 +11,7 @@ function some(collection, predicate) {
11
11
  }
12
12
  });
13
13
  return result;
14
- }
14
+ };
15
+ var some$1 = some;
15
16
 
16
- export { some as default };
17
+ export { some$1 as default };
package/es/times.js CHANGED
@@ -3,7 +3,7 @@ import { MAX_SAFE_INTEGER, mathMin, mathFloor, MAX_ARRAY_LENGTH } from './intern
3
3
  import isInteger from './isInteger.js';
4
4
  import isFinite from './isFinite.js';
5
5
 
6
- function times(n, iteratee) {
6
+ var times = function (n, iteratee) {
7
7
  if (iteratee === void 0) { iteratee = identity; }
8
8
  if (n < 1 || n > MAX_SAFE_INTEGER) {
9
9
  return [];
@@ -17,6 +17,7 @@ function times(n, iteratee) {
17
17
  index++;
18
18
  }
19
19
  return result;
20
- }
20
+ };
21
+ var times$1 = times;
21
22
 
22
- export { times as default };
23
+ export { times$1 as default };
package/lib/clamp.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var defaultTo = require('./defaultTo.js');
4
4
  var toNumber = require('./toNumber.js');
5
5
 
6
- function clamp(number, lower, upper) {
6
+ var clamp = function (number, lower, upper) {
7
7
  if (upper === undefined) {
8
8
  upper = lower;
9
9
  lower = undefined;
@@ -24,6 +24,7 @@ function clamp(number, lower, upper) {
24
24
  }
25
25
  }
26
26
  return number;
27
- }
27
+ };
28
+ var clamp$1 = clamp;
28
29
 
29
- module.exports = clamp;
30
+ module.exports = clamp$1;
package/lib/conforms.js CHANGED
@@ -2,10 +2,11 @@
2
2
 
3
3
  var conformsTo = require('./conformsTo.js');
4
4
 
5
- function conforms(source) {
5
+ var conforms = function (source) {
6
6
  return function (object) {
7
7
  return conformsTo(object, source);
8
8
  };
9
- }
9
+ };
10
+ var conforms$1 = conforms;
10
11
 
11
- module.exports = conforms;
12
+ module.exports = conforms$1;
package/lib/conformsTo.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var allKeys = require('./allKeys.js');
4
4
  var isNil = require('./isNil.js');
5
5
 
6
- function conformsTo(object, source) {
6
+ var conformsTo = function (object, source) {
7
7
  var props = allKeys(source);
8
8
  var length = props.length;
9
9
  if (isNil(object)) {
@@ -21,6 +21,7 @@ function conformsTo(object, source) {
21
21
  }
22
22
  }
23
23
  return true;
24
- }
24
+ };
25
+ var conformsTo$1 = conformsTo;
25
26
 
26
- module.exports = conformsTo;
27
+ module.exports = conformsTo$1;