si-funciona 2.6.1 → 2.6.2

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 (169) hide show
  1. package/README.md +40 -10
  2. package/browser/siFunciona.js +18 -11
  3. package/dist/helpers/arrays/BasicQueue.d.ts +64 -64
  4. package/dist/helpers/arrays/BasicQueue.js +61 -61
  5. package/dist/helpers/arrays/addUniqueToArray.d.ts +9 -9
  6. package/dist/helpers/arrays/addUniqueToArray.js +16 -16
  7. package/dist/helpers/arrays/buildArray.d.ts +10 -10
  8. package/dist/helpers/arrays/buildArray.js +25 -25
  9. package/dist/helpers/arrays/buildArrayOfReferences.d.ts +10 -10
  10. package/dist/helpers/arrays/buildArrayOfReferences.js +22 -22
  11. package/dist/helpers/arrays/compareArrays.d.ts +96 -96
  12. package/dist/helpers/arrays/compareArrays.js +96 -96
  13. package/dist/helpers/arrays/mergeArrays.d.ts +8 -8
  14. package/dist/helpers/arrays/mergeArrays.js +21 -21
  15. package/dist/helpers/arrays/uniqueArray.d.ts +8 -8
  16. package/dist/helpers/arrays/uniqueArray.js +16 -16
  17. package/dist/helpers/arrays.d.ts +27 -27
  18. package/dist/helpers/arrays.js +74 -74
  19. package/dist/helpers/descriptors/assignDescriptor.d.ts +13 -13
  20. package/dist/helpers/descriptors/assignDescriptor.js +57 -57
  21. package/dist/helpers/descriptors/assignDescriptorDetail.d.ts +13 -13
  22. package/dist/helpers/descriptors/assignDescriptorDetail.js +36 -36
  23. package/dist/helpers/descriptors/checkClearValues.d.ts +11 -11
  24. package/dist/helpers/descriptors/checkClearValues.js +20 -20
  25. package/dist/helpers/descriptors/checkDescriptorComplete.d.ts +10 -10
  26. package/dist/helpers/descriptors/checkDescriptorComplete.js +19 -19
  27. package/dist/helpers/descriptors/cloneDescriptor.d.ts +9 -9
  28. package/dist/helpers/descriptors/cloneDescriptor.js +35 -35
  29. package/dist/helpers/descriptors/cloneDescriptorDetail.d.ts +9 -9
  30. package/dist/helpers/descriptors/cloneDescriptorDetail.js +26 -26
  31. package/dist/helpers/descriptors/compareDescriptor.d.ts +12 -12
  32. package/dist/helpers/descriptors/compareDescriptor.js +32 -32
  33. package/dist/helpers/descriptors/describeObject.d.ts +14 -14
  34. package/dist/helpers/descriptors/describeObject.js +52 -52
  35. package/dist/helpers/descriptors/describeObjectDetail.d.ts +13 -13
  36. package/dist/helpers/descriptors/describeObjectDetail.js +37 -37
  37. package/dist/helpers/descriptors/describeObjectMap.d.ts +35 -35
  38. package/dist/helpers/descriptors/describeObjectMap.js +107 -107
  39. package/dist/helpers/descriptors/nextReference.d.ts +12 -12
  40. package/dist/helpers/descriptors/nextReference.js +30 -30
  41. package/dist/helpers/descriptors/sameDescriptor.d.ts +12 -12
  42. package/dist/helpers/descriptors/sameDescriptor.js +21 -21
  43. package/dist/helpers/descriptors/samples/descriptor.d.ts +34 -34
  44. package/dist/helpers/descriptors/samples/descriptor.js +22 -22
  45. package/dist/helpers/descriptors/samples/descriptorDetail.d.ts +42 -42
  46. package/dist/helpers/descriptors/samples/descriptorDetail.js +24 -24
  47. package/dist/helpers/descriptors/samples/descriptorMap.d.ts +16 -16
  48. package/dist/helpers/descriptors/samples/descriptorMap.js +14 -14
  49. package/dist/helpers/descriptors/samples/mappedDescriptorMap.d.ts +10 -10
  50. package/dist/helpers/descriptors/samples/mappedDescriptorMap.js +287 -287
  51. package/dist/helpers/descriptors.d.ts +56 -56
  52. package/dist/helpers/descriptors.js +129 -129
  53. package/dist/helpers/functions/callWithParams.d.ts +10 -10
  54. package/dist/helpers/functions/callWithParams.js +16 -16
  55. package/dist/helpers/functions/curry.d.ts +10 -10
  56. package/dist/helpers/functions/curry.js +16 -16
  57. package/dist/helpers/functions/delay.d.ts +20 -20
  58. package/dist/helpers/functions/delay.js +31 -31
  59. package/dist/helpers/functions/makeBasicQueue.d.ts +9 -9
  60. package/dist/helpers/functions/makeBasicQueue.js +18 -18
  61. package/dist/helpers/functions/onBodyLoad.d.ts +9 -9
  62. package/dist/helpers/functions/onBodyLoad.js +75 -75
  63. package/dist/helpers/functions/pipe.d.ts +9 -9
  64. package/dist/helpers/functions/pipe.js +17 -17
  65. package/dist/helpers/functions/preloadParams.d.ts +19 -19
  66. package/dist/helpers/functions/preloadParams.js +20 -20
  67. package/dist/helpers/functions/queueManager.d.ts +48 -48
  68. package/dist/helpers/functions/queueManager.js +123 -123
  69. package/dist/helpers/functions/queueTimeout.d.ts +20 -20
  70. package/dist/helpers/functions/queueTimeout.js +22 -22
  71. package/dist/helpers/functions/relevancyFilter.d.ts +34 -34
  72. package/dist/helpers/functions/relevancyFilter.js +33 -33
  73. package/dist/helpers/functions/trace.d.ts +13 -13
  74. package/dist/helpers/functions/trace.js +24 -24
  75. package/dist/helpers/functions.d.ts +40 -40
  76. package/dist/helpers/functions.js +105 -105
  77. package/dist/helpers/numbers/absoluteMax.d.ts +9 -9
  78. package/dist/helpers/numbers/absoluteMax.js +15 -15
  79. package/dist/helpers/numbers/absoluteMin.d.ts +9 -9
  80. package/dist/helpers/numbers/absoluteMin.js +15 -15
  81. package/dist/helpers/numbers/compare.d.ts +12 -12
  82. package/dist/helpers/numbers/compare.js +18 -18
  83. package/dist/helpers/numbers/greatestCommonDivisor.d.ts +9 -9
  84. package/dist/helpers/numbers/greatestCommonDivisor.js +15 -15
  85. package/dist/helpers/numbers/leastCommonMultiple.d.ts +9 -9
  86. package/dist/helpers/numbers/leastCommonMultiple.js +17 -17
  87. package/dist/helpers/numbers/lowestCommonDenominator.d.ts +9 -9
  88. package/dist/helpers/numbers/lowestCommonDenominator.js +19 -19
  89. package/dist/helpers/numbers/randomInteger.d.ts +11 -5
  90. package/dist/helpers/numbers/randomInteger.js +11 -5
  91. package/dist/helpers/numbers/randomNumber.d.ts +7 -6
  92. package/dist/helpers/numbers/randomNumber.js +7 -6
  93. package/dist/helpers/numbers/simplestRatio.d.ts +8 -8
  94. package/dist/helpers/numbers/simplestRatio.js +28 -28
  95. package/dist/helpers/numbers.d.ts +30 -30
  96. package/dist/helpers/numbers.js +89 -89
  97. package/dist/helpers/objects/cloneObject.d.ts +19 -19
  98. package/dist/helpers/objects/cloneObject.js +31 -31
  99. package/dist/helpers/objects/dotGet.d.ts +11 -11
  100. package/dist/helpers/objects/dotGet.js +59 -59
  101. package/dist/helpers/objects/dotNotate.d.ts +27 -27
  102. package/dist/helpers/objects/dotNotate.js +79 -79
  103. package/dist/helpers/objects/dotSet.d.ts +11 -11
  104. package/dist/helpers/objects/dotSet.js +53 -53
  105. package/dist/helpers/objects/dotUnset.d.ts +10 -10
  106. package/dist/helpers/objects/dotUnset.js +52 -52
  107. package/dist/helpers/objects/emptyObject.d.ts +8 -8
  108. package/dist/helpers/objects/emptyObject.js +17 -17
  109. package/dist/helpers/objects/filterObject.d.ts +26 -26
  110. package/dist/helpers/objects/filterObject.js +33 -33
  111. package/dist/helpers/objects/isCloneable.d.ts +8 -8
  112. package/dist/helpers/objects/isCloneable.js +16 -16
  113. package/dist/helpers/objects/isEqual.d.ts +16 -16
  114. package/dist/helpers/objects/isEqual.js +100 -100
  115. package/dist/helpers/objects/isInstanceObject.d.ts +8 -8
  116. package/dist/helpers/objects/isInstanceObject.js +26 -26
  117. package/dist/helpers/objects/isObject.d.ts +8 -8
  118. package/dist/helpers/objects/isObject.js +14 -14
  119. package/dist/helpers/objects/mapObject.d.ts +25 -25
  120. package/dist/helpers/objects/mapObject.js +25 -25
  121. package/dist/helpers/objects/mergeObjects.d.ts +12 -12
  122. package/dist/helpers/objects/mergeObjects.js +19 -19
  123. package/dist/helpers/objects/mergeObjectsBase.d.ts +35 -35
  124. package/dist/helpers/objects/mergeObjectsBase.js +91 -91
  125. package/dist/helpers/objects/mergeObjectsMutable.d.ts +12 -12
  126. package/dist/helpers/objects/mergeObjectsMutable.js +17 -17
  127. package/dist/helpers/objects/objectKeys.d.ts +13 -13
  128. package/dist/helpers/objects/objectKeys.js +39 -39
  129. package/dist/helpers/objects/objectValues.d.ts +13 -13
  130. package/dist/helpers/objects/objectValues.js +20 -20
  131. package/dist/helpers/objects/reduceObject.d.ts +30 -30
  132. package/dist/helpers/objects/reduceObject.js +25 -25
  133. package/dist/helpers/objects/setAndReturnValue.d.ts +13 -13
  134. package/dist/helpers/objects/setAndReturnValue.js +19 -19
  135. package/dist/helpers/objects/setValue.d.ts +14 -14
  136. package/dist/helpers/objects/setValue.js +21 -21
  137. package/dist/helpers/objects.d.ts +121 -121
  138. package/dist/helpers/objects.js +177 -177
  139. package/dist/helpers/strings/camelCase.d.ts +8 -8
  140. package/dist/helpers/strings/camelCase.js +19 -19
  141. package/dist/helpers/strings/kabobCase.d.ts +8 -8
  142. package/dist/helpers/strings/kabobCase.js +18 -18
  143. package/dist/helpers/strings/makeFilepath.d.ts +9 -9
  144. package/dist/helpers/strings/makeFilepath.js +49 -49
  145. package/dist/helpers/strings/makeRelativePath.d.ts +9 -9
  146. package/dist/helpers/strings/makeRelativePath.js +43 -43
  147. package/dist/helpers/strings/regexEscape.d.ts +8 -8
  148. package/dist/helpers/strings/regexEscape.js +15 -15
  149. package/dist/helpers/strings/snakeCase.d.ts +8 -8
  150. package/dist/helpers/strings/snakeCase.js +18 -18
  151. package/dist/helpers/strings/strAfter.d.ts +9 -9
  152. package/dist/helpers/strings/strAfter.js +18 -18
  153. package/dist/helpers/strings/strAfterLast.d.ts +9 -9
  154. package/dist/helpers/strings/strAfterLast.js +18 -18
  155. package/dist/helpers/strings/strBefore.d.ts +9 -9
  156. package/dist/helpers/strings/strBefore.js +18 -18
  157. package/dist/helpers/strings/strBeforeLast.d.ts +9 -9
  158. package/dist/helpers/strings/strBeforeLast.js +18 -18
  159. package/dist/helpers/strings/titleCase.d.ts +8 -8
  160. package/dist/helpers/strings/titleCase.js +19 -19
  161. package/dist/helpers/strings/ucFirst.d.ts +8 -8
  162. package/dist/helpers/strings/ucFirst.js +14 -14
  163. package/dist/helpers/strings/words.d.ts +9 -9
  164. package/dist/helpers/strings/words.js +15 -15
  165. package/dist/helpers/strings.d.ts +38 -38
  166. package/dist/helpers/strings.js +121 -121
  167. package/dist/main.d.ts +15 -15
  168. package/dist/main.js +103 -103
  169. package/package.json +4 -4
@@ -1,17 +1,17 @@
1
- /**
2
- * Check whether two values are equal by value, however they are stored: two separately made arrays or objects with the
3
- * same contents are equal, while two references only need to be the same when the value is a function.
4
- * - Primitives are equal when they are the same value (and NaN equals NaN)
5
- * - Arrays are equal when they have the same elements in the same order
6
- * - Objects are equal when they have the same prototype (the same kind of object) and the same own properties with
7
- * equal values, the order of the properties does not matter
8
- * - Dates, regular expressions, Maps and Sets are compared by what they hold
9
- * - Circular references are handled: a pair of objects which is already being compared is taken to be equal
10
- * @memberOf module:objectHelpers
11
- * @param {*} first - The first value.
12
- * @param {*} second - The second value.
13
- * @returns {boolean} True when the values are equal.
14
- */
15
- declare const isEqual: (first: any, second: any) => boolean;
16
- export default isEqual;
1
+ /**
2
+ * Check whether two values are equal by value, however they are stored: two separately made arrays or objects with the
3
+ * same contents are equal, while two references only need to be the same when the value is a function.
4
+ * - Primitives are equal when they are the same value (and NaN equals NaN)
5
+ * - Arrays are equal when they have the same elements in the same order
6
+ * - Objects are equal when they have the same prototype (the same kind of object) and the same own properties with
7
+ * equal values, the order of the properties does not matter
8
+ * - Dates, regular expressions, Maps and Sets are compared by what they hold
9
+ * - Circular references are handled: a pair of objects which is already being compared is taken to be equal
10
+ * @memberOf module:objectHelpers
11
+ * @param {*} first - The first value.
12
+ * @param {*} second - The second value.
13
+ * @returns {boolean} True when the values are equal.
14
+ */
15
+ declare const isEqual: (first: any, second: any) => boolean;
16
+ export default isEqual;
17
17
  //# sourceMappingURL=isEqual.d.ts.map
@@ -1,100 +1,100 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- require('core-js/modules/es.regexp.flags.js')
8
- require('core-js/modules/esnext.iterator.constructor.js')
9
- require('core-js/modules/esnext.iterator.every.js')
10
- require('core-js/modules/esnext.iterator.some.js')
11
- require('core-js/modules/esnext.map.delete-all.js')
12
- require('core-js/modules/esnext.map.every.js')
13
- require('core-js/modules/esnext.map.filter.js')
14
- require('core-js/modules/esnext.map.find.js')
15
- require('core-js/modules/esnext.map.find-key.js')
16
- require('core-js/modules/esnext.map.includes.js')
17
- require('core-js/modules/esnext.map.key-of.js')
18
- require('core-js/modules/esnext.map.map-keys.js')
19
- require('core-js/modules/esnext.map.map-values.js')
20
- require('core-js/modules/esnext.map.merge.js')
21
- require('core-js/modules/esnext.map.reduce.js')
22
- require('core-js/modules/esnext.map.some.js')
23
- require('core-js/modules/esnext.map.update.js')
24
- require('core-js/modules/esnext.set.add-all.js')
25
- require('core-js/modules/esnext.set.delete-all.js')
26
- require('core-js/modules/esnext.set.difference.js')
27
- require('core-js/modules/esnext.set.every.js')
28
- require('core-js/modules/esnext.set.filter.js')
29
- require('core-js/modules/esnext.set.find.js')
30
- require('core-js/modules/esnext.set.intersection.js')
31
- require('core-js/modules/esnext.set.is-disjoint-from.js')
32
- require('core-js/modules/esnext.set.is-subset-of.js')
33
- require('core-js/modules/esnext.set.is-superset-of.js')
34
- require('core-js/modules/esnext.set.join.js')
35
- require('core-js/modules/esnext.set.map.js')
36
- require('core-js/modules/esnext.set.reduce.js')
37
- require('core-js/modules/esnext.set.some.js')
38
- require('core-js/modules/esnext.set.symmetric-difference.js')
39
- require('core-js/modules/esnext.set.union.js')
40
- require('core-js/modules/esnext.weak-map.delete-all.js')
41
- require('core-js/modules/esnext.weak-set.add-all.js')
42
- require('core-js/modules/esnext.weak-set.delete-all.js')
43
- const sameValueZero = (first, second) => first === second || first !== first && second !== second
44
- const compare = (first, second, seen) => {
45
- if (sameValueZero(first, second)) {
46
- return true
47
- }
48
- if (typeof first !== 'object' || typeof second !== 'object' || first === null || second === null) {
49
- // Different primitives, or a function (which is only equal to itself), or an object against a primitive
50
- return false
51
- }
52
- if (Object.getPrototypeOf(first) !== Object.getPrototypeOf(second)) {
53
- return false
54
- }
55
- // A pair which is already being compared further up is not a difference (this is what makes circular references work)
56
- const comparing = seen.get(first)
57
- if (comparing && comparing.has(second)) {
58
- return true
59
- }
60
- if (comparing) {
61
- comparing.add(second)
62
- } else {
63
- seen.set(first, new WeakSet([second]))
64
- }
65
- if (first instanceof Date) {
66
- return first.getTime() === second.getTime()
67
- }
68
- if (first instanceof RegExp) {
69
- return first.source === second.source && first.flags === second.flags
70
- }
71
- if (first instanceof Map) {
72
- return first.size === second.size && Array.from(first.entries()).every(([key, value]) => second.has(key) && compare(value, second.get(key), seen))
73
- }
74
- if (first instanceof Set) {
75
- const others = Array.from(second.values())
76
- return first.size === second.size && Array.from(first.values()).every(value => others.some(other => compare(value, other, seen)))
77
- }
78
- if (Array.isArray(first) && first.length !== second.length) {
79
- return false
80
- }
81
- const firstKeys = Object.keys(first)
82
- const secondKeys = Object.keys(second)
83
- return firstKeys.length === secondKeys.length && firstKeys.every(key => Object.prototype.hasOwnProperty.call(second, key) && compare(first[key], second[key], seen))
84
- }
85
- /**
86
- * Check whether two values are equal by value, however they are stored: two separately made arrays or objects with the
87
- * same contents are equal, while two references only need to be the same when the value is a function.
88
- * - Primitives are equal when they are the same value (and NaN equals NaN)
89
- * - Arrays are equal when they have the same elements in the same order
90
- * - Objects are equal when they have the same prototype (the same kind of object) and the same own properties with
91
- * equal values, the order of the properties does not matter
92
- * - Dates, regular expressions, Maps and Sets are compared by what they hold
93
- * - Circular references are handled: a pair of objects which is already being compared is taken to be equal
94
- * @memberOf module:objectHelpers
95
- * @param {*} first - The first value.
96
- * @param {*} second - The second value.
97
- * @returns {boolean} True when the values are equal.
98
- */
99
- const isEqual = (first, second) => compare(first, second, new WeakMap())
100
- const _default = exports.default = isEqual
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ require('core-js/modules/es.regexp.flags.js')
8
+ require('core-js/modules/esnext.iterator.constructor.js')
9
+ require('core-js/modules/esnext.iterator.every.js')
10
+ require('core-js/modules/esnext.iterator.some.js')
11
+ require('core-js/modules/esnext.map.delete-all.js')
12
+ require('core-js/modules/esnext.map.every.js')
13
+ require('core-js/modules/esnext.map.filter.js')
14
+ require('core-js/modules/esnext.map.find.js')
15
+ require('core-js/modules/esnext.map.find-key.js')
16
+ require('core-js/modules/esnext.map.includes.js')
17
+ require('core-js/modules/esnext.map.key-of.js')
18
+ require('core-js/modules/esnext.map.map-keys.js')
19
+ require('core-js/modules/esnext.map.map-values.js')
20
+ require('core-js/modules/esnext.map.merge.js')
21
+ require('core-js/modules/esnext.map.reduce.js')
22
+ require('core-js/modules/esnext.map.some.js')
23
+ require('core-js/modules/esnext.map.update.js')
24
+ require('core-js/modules/esnext.set.add-all.js')
25
+ require('core-js/modules/esnext.set.delete-all.js')
26
+ require('core-js/modules/esnext.set.difference.js')
27
+ require('core-js/modules/esnext.set.every.js')
28
+ require('core-js/modules/esnext.set.filter.js')
29
+ require('core-js/modules/esnext.set.find.js')
30
+ require('core-js/modules/esnext.set.intersection.js')
31
+ require('core-js/modules/esnext.set.is-disjoint-from.js')
32
+ require('core-js/modules/esnext.set.is-subset-of.js')
33
+ require('core-js/modules/esnext.set.is-superset-of.js')
34
+ require('core-js/modules/esnext.set.join.js')
35
+ require('core-js/modules/esnext.set.map.js')
36
+ require('core-js/modules/esnext.set.reduce.js')
37
+ require('core-js/modules/esnext.set.some.js')
38
+ require('core-js/modules/esnext.set.symmetric-difference.js')
39
+ require('core-js/modules/esnext.set.union.js')
40
+ require('core-js/modules/esnext.weak-map.delete-all.js')
41
+ require('core-js/modules/esnext.weak-set.add-all.js')
42
+ require('core-js/modules/esnext.weak-set.delete-all.js')
43
+ const sameValueZero = (first, second) => first === second || first !== first && second !== second
44
+ const compare = (first, second, seen) => {
45
+ if (sameValueZero(first, second)) {
46
+ return true
47
+ }
48
+ if (typeof first !== 'object' || typeof second !== 'object' || first === null || second === null) {
49
+ // Different primitives, or a function (which is only equal to itself), or an object against a primitive
50
+ return false
51
+ }
52
+ if (Object.getPrototypeOf(first) !== Object.getPrototypeOf(second)) {
53
+ return false
54
+ }
55
+ // A pair which is already being compared further up is not a difference (this is what makes circular references work)
56
+ const comparing = seen.get(first)
57
+ if (comparing && comparing.has(second)) {
58
+ return true
59
+ }
60
+ if (comparing) {
61
+ comparing.add(second)
62
+ } else {
63
+ seen.set(first, new WeakSet([second]))
64
+ }
65
+ if (first instanceof Date) {
66
+ return first.getTime() === second.getTime()
67
+ }
68
+ if (first instanceof RegExp) {
69
+ return first.source === second.source && first.flags === second.flags
70
+ }
71
+ if (first instanceof Map) {
72
+ return first.size === second.size && Array.from(first.entries()).every(([key, value]) => second.has(key) && compare(value, second.get(key), seen))
73
+ }
74
+ if (first instanceof Set) {
75
+ const others = Array.from(second.values())
76
+ return first.size === second.size && Array.from(first.values()).every(value => others.some(other => compare(value, other, seen)))
77
+ }
78
+ if (Array.isArray(first) && first.length !== second.length) {
79
+ return false
80
+ }
81
+ const firstKeys = Object.keys(first)
82
+ const secondKeys = Object.keys(second)
83
+ return firstKeys.length === secondKeys.length && firstKeys.every(key => Object.prototype.hasOwnProperty.call(second, key) && compare(first[key], second[key], seen))
84
+ }
85
+ /**
86
+ * Check whether two values are equal by value, however they are stored: two separately made arrays or objects with the
87
+ * same contents are equal, while two references only need to be the same when the value is a function.
88
+ * - Primitives are equal when they are the same value (and NaN equals NaN)
89
+ * - Arrays are equal when they have the same elements in the same order
90
+ * - Objects are equal when they have the same prototype (the same kind of object) and the same own properties with
91
+ * equal values, the order of the properties does not matter
92
+ * - Dates, regular expressions, Maps and Sets are compared by what they hold
93
+ * - Circular references are handled: a pair of objects which is already being compared is taken to be equal
94
+ * @memberOf module:objectHelpers
95
+ * @param {*} first - The first value.
96
+ * @param {*} second - The second value.
97
+ * @returns {boolean} True when the values are equal.
98
+ */
99
+ const isEqual = (first, second) => compare(first, second, new WeakMap())
100
+ const _default = exports.default = isEqual
@@ -1,9 +1,9 @@
1
- /**
2
- * Check if the current object has inherited properties.
3
- * @memberOf module:objectHelpers
4
- * @param {Object|Array} object
5
- * @returns {boolean}
6
- */
7
- declare const isInstanceObject: (object: Array<any> | Object) => boolean;
8
- export default isInstanceObject;
1
+ /**
2
+ * Check if the current object has inherited properties.
3
+ * @memberOf module:objectHelpers
4
+ * @param {Object|Array} object
5
+ * @returns {boolean}
6
+ */
7
+ declare const isInstanceObject: (object: Array<any> | Object) => boolean;
8
+ export default isInstanceObject;
9
9
  //# sourceMappingURL=isInstanceObject.d.ts.map
@@ -1,26 +1,26 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- require('core-js/modules/es.array.includes.js')
8
- const _isObject = _interopRequireDefault(require('./isObject'))
9
- const _objectKeys = _interopRequireDefault(require('./objectKeys'))
10
- function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
11
- /**
12
- * Check if the current object has inherited properties.
13
- * @memberOf module:objectHelpers
14
- * @param {Object|Array} object
15
- * @returns {boolean}
16
- */
17
- const isInstanceObject = object => {
18
- if (typeof object !== 'function' && !(0, _isObject.default)(object)) {
19
- return false
20
- }
21
- if (!['Array', 'Function', 'Object'].includes(object.constructor.name)) {
22
- return true
23
- }
24
- return object.constructor.name !== 'Array' && (0, _objectKeys.default)(object, true).length > (0, _objectKeys.default)(object).length
25
- }
26
- const _default = exports.default = isInstanceObject
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ require('core-js/modules/es.array.includes.js')
8
+ const _isObject = _interopRequireDefault(require('./isObject'))
9
+ const _objectKeys = _interopRequireDefault(require('./objectKeys'))
10
+ function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
11
+ /**
12
+ * Check if the current object has inherited properties.
13
+ * @memberOf module:objectHelpers
14
+ * @param {Object|Array} object
15
+ * @returns {boolean}
16
+ */
17
+ const isInstanceObject = object => {
18
+ if (typeof object !== 'function' && !(0, _isObject.default)(object)) {
19
+ return false
20
+ }
21
+ if (!['Array', 'Function', 'Object'].includes(object.constructor.name)) {
22
+ return true
23
+ }
24
+ return object.constructor.name !== 'Array' && (0, _objectKeys.default)(object, true).length > (0, _objectKeys.default)(object).length
25
+ }
26
+ const _default = exports.default = isInstanceObject
@@ -1,9 +1,9 @@
1
- /**
2
- * Check if the provided thing is an object / array.
3
- * @memberOf module:objectHelpers
4
- * @param {*} object
5
- * @returns {boolean}
6
- */
7
- declare const isObject: (object: any) => boolean;
8
- export default isObject;
1
+ /**
2
+ * Check if the provided thing is an object / array.
3
+ * @memberOf module:objectHelpers
4
+ * @param {*} object
5
+ * @returns {boolean}
6
+ */
7
+ declare const isObject: (object: any) => boolean;
8
+ export default isObject;
9
9
  //# sourceMappingURL=isObject.d.ts.map
@@ -1,14 +1,14 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- /**
8
- * Check if the provided thing is an object / array.
9
- * @memberOf module:objectHelpers
10
- * @param {*} object
11
- * @returns {boolean}
12
- */
13
- const isObject = object => typeof object === 'object' && object !== null
14
- const _default = exports.default = isObject
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ /**
8
+ * Check if the provided thing is an object / array.
9
+ * @memberOf module:objectHelpers
10
+ * @param {*} object
11
+ * @returns {boolean}
12
+ */
13
+ const isObject = object => typeof object === 'object' && object !== null
14
+ const _default = exports.default = isObject
@@ -1,26 +1,26 @@
1
- type mappableItem = Array<any> | {
2
- [k: number | string]: any;
3
- };
4
- /**
5
- * Function that produces a property of the new Object, taking three arguments
6
- * @callback module:objectHelpers~mapCallback
7
- * @memberOf module:objectHelpers
8
- * @param {*} currentProperty - The current property being processed in the object.
9
- * @param {string} [currentIndex] - The property name of the current property being processed in the object.
10
- * @param {Object|Array} [object] - The object map was called upon.
11
- * @returns {*}
12
- */
13
- type mapCallback = (currentProperty: any, currentIndex: keyof mappableItem, object: mappableItem) => any;
14
- /**
15
- * This function is intended to replicate behaviour of the Array.map() function but for Objects.
16
- * If an array is passed in instead then it will perform standard map(). It is recommended to
17
- * always use the standard map() function when it is known that the object is actually an array.
18
- * @memberOf module:objectHelpers
19
- * @param {Object|Array} obj - The Object (or Array) to be mapped
20
- * @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
21
- * @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
22
- * @returns {Object|Array}
23
- */
24
- declare const mapObject: (obj: mappableItem, fn: mapCallback, thisArg?: mappableItem) => mappableItem;
25
- export default mapObject;
1
+ type mappableItem = Array<any> | {
2
+ [k: number | string]: any;
3
+ };
4
+ /**
5
+ * Function that produces a property of the new Object, taking three arguments
6
+ * @callback module:objectHelpers~mapCallback
7
+ * @memberOf module:objectHelpers
8
+ * @param {*} currentProperty - The current property being processed in the object.
9
+ * @param {string} [currentIndex] - The property name of the current property being processed in the object.
10
+ * @param {Object|Array} [object] - The object map was called upon.
11
+ * @returns {*}
12
+ */
13
+ type mapCallback = (currentProperty: any, currentIndex: keyof mappableItem, object: mappableItem) => any;
14
+ /**
15
+ * This function is intended to replicate behaviour of the Array.map() function but for Objects.
16
+ * If an array is passed in instead then it will perform standard map(). It is recommended to
17
+ * always use the standard map() function when it is known that the object is actually an array.
18
+ * @memberOf module:objectHelpers
19
+ * @param {Object|Array} obj - The Object (or Array) to be mapped
20
+ * @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
21
+ * @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
22
+ * @returns {Object|Array}
23
+ */
24
+ declare const mapObject: (obj: mappableItem, fn: mapCallback, thisArg?: mappableItem) => mappableItem;
25
+ export default mapObject;
26
26
  //# sourceMappingURL=mapObject.d.ts.map
@@ -1,25 +1,25 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- require('core-js/modules/esnext.iterator.constructor.js')
8
- require('core-js/modules/esnext.iterator.map.js')
9
- require('core-js/modules/esnext.iterator.reduce.js')
10
- const _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
11
- const _objectKeys = _interopRequireDefault(require('./objectKeys'))
12
- const _setValue = _interopRequireDefault(require('./setValue'))
13
- function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
14
- /**
15
- * This function is intended to replicate behaviour of the Array.map() function but for Objects.
16
- * If an array is passed in instead then it will perform standard map(). It is recommended to
17
- * always use the standard map() function when it is known that the object is actually an array.
18
- * @memberOf module:objectHelpers
19
- * @param {Object|Array} obj - The Object (or Array) to be mapped
20
- * @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
21
- * @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
22
- * @returns {Object|Array}
23
- */
24
- const mapObject = (obj, fn, thisArg = undefined) => Array.isArray(obj) ? obj.map(fn, thisArg) : (0, _objectKeys.default)(obj, true).reduce((newObj, curr) => (0, _setValue.default)(curr, (0, _callWithParams.default)(fn.bind(thisArg), [obj[curr], curr, obj], 2), newObj), {})
25
- const _default = exports.default = mapObject
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ require('core-js/modules/esnext.iterator.constructor.js')
8
+ require('core-js/modules/esnext.iterator.map.js')
9
+ require('core-js/modules/esnext.iterator.reduce.js')
10
+ const _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
11
+ const _objectKeys = _interopRequireDefault(require('./objectKeys'))
12
+ const _setValue = _interopRequireDefault(require('./setValue'))
13
+ function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
14
+ /**
15
+ * This function is intended to replicate behaviour of the Array.map() function but for Objects.
16
+ * If an array is passed in instead then it will perform standard map(). It is recommended to
17
+ * always use the standard map() function when it is known that the object is actually an array.
18
+ * @memberOf module:objectHelpers
19
+ * @param {Object|Array} obj - The Object (or Array) to be mapped
20
+ * @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
21
+ * @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
22
+ * @returns {Object|Array}
23
+ */
24
+ const mapObject = (obj, fn, thisArg = undefined) => Array.isArray(obj) ? obj.map(fn, thisArg) : (0, _objectKeys.default)(obj, true).reduce((newObj, curr) => (0, _setValue.default)(curr, (0, _callWithParams.default)(fn.bind(thisArg), [obj[curr], curr, obj], 2), newObj), {})
25
+ const _default = exports.default = mapObject
@@ -1,13 +1,13 @@
1
- /**
2
- * Uses mergeObjectsBase deep merge objects and arrays, merge by value.
3
- * @memberOf module:objectHelpers
4
- * @see {@link module:objectHelpers~mergeObjectsCallback}
5
- * @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
6
- * @returns {*}
7
- */
8
- declare const mergeObjects: (...objects: Array<Object>) => any[] | {
9
- [k: string]: any;
10
- [k: number]: any;
11
- };
12
- export default mergeObjects;
1
+ /**
2
+ * Uses mergeObjectsBase deep merge objects and arrays, merge by value.
3
+ * @memberOf module:objectHelpers
4
+ * @see {@link module:objectHelpers~mergeObjectsCallback}
5
+ * @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
6
+ * @returns {*}
7
+ */
8
+ declare const mergeObjects: (...objects: Array<Object>) => any[] | {
9
+ [k: string]: any;
10
+ [k: number]: any;
11
+ };
12
+ export default mergeObjects;
13
13
  //# sourceMappingURL=mergeObjects.d.ts.map
@@ -1,19 +1,19 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- const _mergeObjectsBase = _interopRequireDefault(require('./mergeObjectsBase'))
8
- function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
9
- /**
10
- * Uses mergeObjectsBase deep merge objects and arrays, merge by value.
11
- * @memberOf module:objectHelpers
12
- * @see {@link module:objectHelpers~mergeObjectsCallback}
13
- * @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
14
- * @returns {*}
15
- */
16
- const mergeObjects = (0, _mergeObjectsBase.default)({
17
- useClone: true
18
- })
19
- const _default = exports.default = mergeObjects
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ const _mergeObjectsBase = _interopRequireDefault(require('./mergeObjectsBase'))
8
+ function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
9
+ /**
10
+ * Uses mergeObjectsBase deep merge objects and arrays, merge by value.
11
+ * @memberOf module:objectHelpers
12
+ * @see {@link module:objectHelpers~mergeObjectsCallback}
13
+ * @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
14
+ * @returns {*}
15
+ */
16
+ const mergeObjects = (0, _mergeObjectsBase.default)({
17
+ useClone: true
18
+ })
19
+ const _default = exports.default = mergeObjects
@@ -1,36 +1,36 @@
1
- import { relevanceMap } from '../functions/relevancyFilter';
2
- type mergeableItem = Array<any> | {
3
- [k: number | string]: any;
4
- };
5
- /**
6
- * Function that takes one or more objects and combines them into one.
7
- * @typedef {Function} module:objectHelpers~mergeObjectsCallback
8
- * @memberOf module:objectHelpers
9
- * @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
10
- * @returns {*}
11
- */
12
- type mergeObjectsCallback = (...objects: Array<Object>) => mergeableItem;
13
- type mergeObjectsBaseOptions = {
14
- mapLimit?: number;
15
- depthLimit?: number;
16
- relevancyRange?: number;
17
- map?: relevanceMap;
18
- useClone?: boolean;
19
- };
20
- /**
21
- * Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
22
- * Objects having the same attributes will overwrite from last object to first.
23
- * NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
24
- * have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
25
- * @memberOf module:objectHelpers
26
- * @param {Object} [options={}]
27
- * @param {number} [options.mapLimit=100] - Size of temporary reference array used in memory before assessing relevancy.
28
- * @param {number} [options.depthLimit=-1] - Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited.
29
- * @param {number} [options.relevancyRange=1000] - Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed.
30
- * @param {Iterable|array} [options.map=[]] - A predetermined list of references gathered (to be passed to itself during recursion).
31
- * @param {boolean} [options.useClone=false]
32
- * @returns {module:objectHelpers~mergeObjectsCallback|mergeObjectsCallback}
33
- */
34
- declare const mergeObjectsBase: ({ mapLimit, depthLimit, relevancyRange, map, useClone, }?: mergeObjectsBaseOptions) => mergeObjectsCallback;
35
- export default mergeObjectsBase;
1
+ import { relevanceMap } from '../functions/relevancyFilter';
2
+ type mergeableItem = Array<any> | {
3
+ [k: number | string]: any;
4
+ };
5
+ /**
6
+ * Function that takes one or more objects and combines them into one.
7
+ * @typedef {Function} module:objectHelpers~mergeObjectsCallback
8
+ * @memberOf module:objectHelpers
9
+ * @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
10
+ * @returns {*}
11
+ */
12
+ type mergeObjectsCallback = (...objects: Array<Object>) => mergeableItem;
13
+ type mergeObjectsBaseOptions = {
14
+ mapLimit?: number;
15
+ depthLimit?: number;
16
+ relevancyRange?: number;
17
+ map?: relevanceMap;
18
+ useClone?: boolean;
19
+ };
20
+ /**
21
+ * Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
22
+ * Objects having the same attributes will overwrite from last object to first.
23
+ * NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
24
+ * have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
25
+ * @memberOf module:objectHelpers
26
+ * @param {Object} [options={}]
27
+ * @param {number} [options.mapLimit=100] - Size of temporary reference array used in memory before assessing relevancy.
28
+ * @param {number} [options.depthLimit=-1] - Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited.
29
+ * @param {number} [options.relevancyRange=1000] - Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed.
30
+ * @param {Iterable|array} [options.map=[]] - A predetermined list of references gathered (to be passed to itself during recursion).
31
+ * @param {boolean} [options.useClone=false]
32
+ * @returns {module:objectHelpers~mergeObjectsCallback|mergeObjectsCallback}
33
+ */
34
+ declare const mergeObjectsBase: ({ mapLimit, depthLimit, relevancyRange, map, useClone, }?: mergeObjectsBaseOptions) => mergeObjectsCallback;
35
+ export default mergeObjectsBase;
36
36
  //# sourceMappingURL=mergeObjectsBase.d.ts.map