si-funciona 2.3.4 → 2.4.1
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/dist/helpers/arrays/addUniqueToArray.d.ts +10 -10
- package/dist/helpers/arrays/addUniqueToArray.js +17 -17
- package/dist/helpers/arrays/buildArray.d.ts +11 -11
- package/dist/helpers/arrays/buildArray.js +26 -26
- package/dist/helpers/arrays/buildArrayOfReferences.d.ts +11 -11
- package/dist/helpers/arrays/buildArrayOfReferences.js +23 -23
- package/dist/helpers/arrays/compareArrays.d.ts +97 -97
- package/dist/helpers/arrays/compareArrays.js +97 -97
- package/dist/helpers/arrays/mergeArrays.d.ts +9 -9
- package/dist/helpers/arrays/mergeArrays.js +22 -22
- package/dist/helpers/arrays/uniqueArray.d.ts +9 -9
- package/dist/helpers/arrays/uniqueArray.js +17 -17
- package/dist/helpers/descriptors/samples/descriptor.js +22 -22
- package/dist/helpers/descriptors/samples/descriptorDetail.js +24 -24
- package/dist/helpers/descriptors/samples/descriptorMap.js +14 -14
- package/dist/helpers/functions/callWithParams.d.ts +11 -11
- package/dist/helpers/functions/callWithParams.js +17 -17
- package/dist/helpers/functions/curry.d.ts +11 -11
- package/dist/helpers/functions/curry.js +17 -17
- package/dist/helpers/functions/delay.d.ts +21 -21
- package/dist/helpers/functions/delay.js +32 -32
- package/dist/helpers/functions/onBodyLoad.d.ts +10 -10
- package/dist/helpers/functions/onBodyLoad.js +74 -74
- package/dist/helpers/functions/pipe.d.ts +10 -10
- package/dist/helpers/functions/pipe.js +18 -18
- package/dist/helpers/functions/preloadParams.d.ts +20 -20
- package/dist/helpers/functions/preloadParams.js +21 -21
- package/dist/helpers/functions/queueTimeout.d.ts +21 -21
- package/dist/helpers/functions/queueTimeout.js +23 -23
- package/dist/helpers/functions.d.ts +29 -29
- package/dist/helpers/functions.js +40 -40
- package/dist/helpers/numbers/absoluteMax.d.ts +10 -10
- package/dist/helpers/numbers/absoluteMax.js +16 -16
- package/dist/helpers/numbers/absoluteMin.d.ts +10 -10
- package/dist/helpers/numbers/absoluteMin.js +16 -16
- package/dist/helpers/numbers/compare.d.ts +13 -13
- package/dist/helpers/numbers/compare.js +19 -19
- package/dist/helpers/numbers/greatestCommonDivisor.d.ts +10 -10
- package/dist/helpers/numbers/greatestCommonDivisor.js +16 -16
- package/dist/helpers/numbers/leastCommonMultiple.d.ts +10 -10
- package/dist/helpers/numbers/leastCommonMultiple.js +18 -18
- package/dist/helpers/numbers/randomInteger.d.ts +13 -13
- package/dist/helpers/numbers/randomInteger.js +19 -19
- package/dist/helpers/numbers/randomNumber.d.ts +13 -13
- package/dist/helpers/numbers/randomNumber.js +19 -19
- package/dist/helpers/numbers/simplestRatio.d.ts +9 -9
- package/dist/helpers/numbers/simplestRatio.js +29 -29
- package/dist/helpers/numbers.d.ts +21 -21
- package/dist/helpers/numbers.js +36 -36
- package/dist/helpers/objects/cloneObject.d.ts +20 -20
- package/dist/helpers/objects/cloneObject.js +32 -32
- package/dist/helpers/objects/dotGet.d.ts +12 -12
- package/dist/helpers/objects/dotGet.js +60 -60
- package/dist/helpers/objects/dotNotate.d.ts +28 -28
- package/dist/helpers/objects/dotNotate.js +80 -80
- package/dist/helpers/objects/dotSet.d.ts +12 -12
- package/dist/helpers/objects/dotSet.js +54 -54
- package/dist/helpers/objects/dotUnset.d.ts +11 -11
- package/dist/helpers/objects/dotUnset.js +53 -53
- package/dist/helpers/objects/emptyObject.d.ts +9 -9
- package/dist/helpers/objects/emptyObject.js +18 -18
- package/dist/helpers/objects/filterObject.d.ts +27 -27
- package/dist/helpers/objects/filterObject.js +32 -32
- package/dist/helpers/objects/isCloneable.d.ts +9 -9
- package/dist/helpers/objects/isCloneable.js +17 -17
- package/dist/helpers/objects/isInstanceObject.d.ts +9 -9
- package/dist/helpers/objects/isInstanceObject.js +27 -27
- package/dist/helpers/objects/isObject.d.ts +9 -9
- package/dist/helpers/objects/isObject.js +15 -15
- package/dist/helpers/objects/mapObject.d.ts +26 -26
- package/dist/helpers/objects/mapObject.js +26 -26
- package/dist/helpers/objects/mergeObjects.d.ts +13 -13
- package/dist/helpers/objects/mergeObjects.js +20 -20
- package/dist/helpers/objects/mergeObjectsBase.d.ts +36 -36
- package/dist/helpers/objects/mergeObjectsBase.js +92 -92
- package/dist/helpers/objects/mergeObjectsMutable.d.ts +13 -13
- package/dist/helpers/objects/mergeObjectsMutable.js +18 -18
- package/dist/helpers/objects/objectKeys.d.ts +14 -14
- package/dist/helpers/objects/objectKeys.js +40 -40
- package/dist/helpers/objects/objectValues.d.ts +14 -14
- package/dist/helpers/objects/objectValues.js +21 -21
- package/dist/helpers/objects/reduceObject.d.ts +31 -31
- package/dist/helpers/objects/reduceObject.js +26 -26
- package/dist/helpers/objects/setAndReturnValue.d.ts +14 -14
- package/dist/helpers/objects/setAndReturnValue.js +20 -20
- package/dist/helpers/objects/setValue.d.ts +15 -15
- package/dist/helpers/objects/setValue.js +22 -22
- package/dist/helpers/objects.d.ts +100 -100
- package/dist/helpers/objects.js +56 -56
- package/dist/helpers/strings.d.ts +25 -25
- package/dist/helpers/strings.js +44 -44
- package/dist/main.d.ts +9 -9
- package/dist/main.js +30 -30
- package/package.json +6 -5
|
@@ -1,32 +1,32 @@
|
|
|
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.filter.js')
|
|
9
|
-
require('core-js/modules/esnext.iterator.reduce.js')
|
|
10
|
-
require('core-js/stable')
|
|
11
|
-
var _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
|
|
12
|
-
var _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
13
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
14
|
-
/**
|
|
15
|
-
* This function is intended to replicate behaviour of the Array.filter() function but for Objects.
|
|
16
|
-
* If an array is passed in instead then it will perform standard filter(). It is recommended to
|
|
17
|
-
* always use the standard filter() 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 filtered
|
|
20
|
-
* @param {module:objectHelpers~filterCallback|Function} fn - The function to be processed for each filtered property
|
|
21
|
-
* @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
|
|
22
|
-
* @returns {Object|Array}
|
|
23
|
-
*/
|
|
24
|
-
const filterObject = (obj, fn, thisArg = undefined) => Array.isArray(obj) ? obj.filter(fn, thisArg) : (0, _objectKeys.default)(obj, true).reduce((newObj, curr) => {
|
|
25
|
-
if ((0, _callWithParams.default)(fn.bind(thisArg), [obj[curr], curr, obj], 2)) {
|
|
26
|
-
newObj[curr] = obj[curr]
|
|
27
|
-
} else {
|
|
28
|
-
delete newObj[curr]
|
|
29
|
-
}
|
|
30
|
-
return newObj
|
|
31
|
-
}, {})
|
|
32
|
-
var _default = exports.default = filterObject
|
|
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.filter.js')
|
|
9
|
+
require('core-js/modules/esnext.iterator.reduce.js')
|
|
10
|
+
require('core-js/stable')
|
|
11
|
+
var _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
|
|
12
|
+
var _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
13
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
14
|
+
/**
|
|
15
|
+
* This function is intended to replicate behaviour of the Array.filter() function but for Objects.
|
|
16
|
+
* If an array is passed in instead then it will perform standard filter(). It is recommended to
|
|
17
|
+
* always use the standard filter() 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 filtered
|
|
20
|
+
* @param {module:objectHelpers~filterCallback|Function} fn - The function to be processed for each filtered property
|
|
21
|
+
* @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
|
|
22
|
+
* @returns {Object|Array}
|
|
23
|
+
*/
|
|
24
|
+
const filterObject = (obj, fn, thisArg = undefined) => Array.isArray(obj) ? obj.filter(fn, thisArg) : (0, _objectKeys.default)(obj, true).reduce((newObj, curr) => {
|
|
25
|
+
if ((0, _callWithParams.default)(fn.bind(thisArg), [obj[curr], curr, obj], 2)) {
|
|
26
|
+
newObj[curr] = obj[curr]
|
|
27
|
+
} else {
|
|
28
|
+
delete newObj[curr]
|
|
29
|
+
}
|
|
30
|
+
return newObj
|
|
31
|
+
}, {})
|
|
32
|
+
var _default = exports.default = filterObject
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import 'core-js/stable';
|
|
2
|
-
/**
|
|
3
|
-
* Determine if the value is a reference instance
|
|
4
|
-
* @memberOf module:objectHelpers
|
|
5
|
-
* @param {Array|Object|*} value
|
|
6
|
-
* @returns {boolean}
|
|
7
|
-
*/
|
|
8
|
-
declare const isCloneable: (value: Array<any> | Object | any) => boolean;
|
|
9
|
-
export default isCloneable;
|
|
1
|
+
import 'core-js/stable';
|
|
2
|
+
/**
|
|
3
|
+
* Determine if the value is a reference instance
|
|
4
|
+
* @memberOf module:objectHelpers
|
|
5
|
+
* @param {Array|Object|*} value
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
declare const isCloneable: (value: Array<any> | Object | any) => boolean;
|
|
9
|
+
export default isCloneable;
|
|
10
10
|
//# sourceMappingURL=isCloneable.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
require('core-js/stable')
|
|
8
|
-
var _isInstanceObject = _interopRequireDefault(require('./isInstanceObject'))
|
|
9
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
10
|
-
/**
|
|
11
|
-
* Determine if the value is a reference instance
|
|
12
|
-
* @memberOf module:objectHelpers
|
|
13
|
-
* @param {Array|Object|*} value
|
|
14
|
-
* @returns {boolean}
|
|
15
|
-
*/
|
|
16
|
-
const isCloneable = value => typeof value === 'object' && value !== null && !(0, _isInstanceObject.default)(value)
|
|
17
|
-
var _default = exports.default = isCloneable
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
require('core-js/stable')
|
|
8
|
+
var _isInstanceObject = _interopRequireDefault(require('./isInstanceObject'))
|
|
9
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
10
|
+
/**
|
|
11
|
+
* Determine if the value is a reference instance
|
|
12
|
+
* @memberOf module:objectHelpers
|
|
13
|
+
* @param {Array|Object|*} value
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
const isCloneable = value => typeof value === 'object' && value !== null && !(0, _isInstanceObject.default)(value)
|
|
17
|
+
var _default = exports.default = isCloneable
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import 'core-js/stable';
|
|
2
|
-
/**
|
|
3
|
-
* Check if the current object has inherited properties.
|
|
4
|
-
* @memberOf module:objectHelpers
|
|
5
|
-
* @param {Object|Array} object
|
|
6
|
-
* @returns {boolean}
|
|
7
|
-
*/
|
|
8
|
-
declare const isInstanceObject: (object: Array<any> | Object) => boolean;
|
|
9
|
-
export default isInstanceObject;
|
|
1
|
+
import 'core-js/stable';
|
|
2
|
+
/**
|
|
3
|
+
* Check if the current object has inherited properties.
|
|
4
|
+
* @memberOf module:objectHelpers
|
|
5
|
+
* @param {Object|Array} object
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
declare const isInstanceObject: (object: Array<any> | Object) => boolean;
|
|
9
|
+
export default isInstanceObject;
|
|
10
10
|
//# sourceMappingURL=isInstanceObject.d.ts.map
|
|
@@ -1,27 +1,27 @@
|
|
|
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
|
-
require('core-js/stable')
|
|
9
|
-
var _isObject = _interopRequireDefault(require('./isObject'))
|
|
10
|
-
var _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
11
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
12
|
-
/**
|
|
13
|
-
* Check if the current object has inherited properties.
|
|
14
|
-
* @memberOf module:objectHelpers
|
|
15
|
-
* @param {Object|Array} object
|
|
16
|
-
* @returns {boolean}
|
|
17
|
-
*/
|
|
18
|
-
const isInstanceObject = object => {
|
|
19
|
-
if (typeof object !== 'function' && !(0, _isObject.default)(object)) {
|
|
20
|
-
return false
|
|
21
|
-
}
|
|
22
|
-
if (!['Array', 'Function', 'Object'].includes(object.constructor.name)) {
|
|
23
|
-
return true
|
|
24
|
-
}
|
|
25
|
-
return object.constructor.name !== 'Array' && (0, _objectKeys.default)(object, true).length > (0, _objectKeys.default)(object).length
|
|
26
|
-
}
|
|
27
|
-
var _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
|
+
require('core-js/stable')
|
|
9
|
+
var _isObject = _interopRequireDefault(require('./isObject'))
|
|
10
|
+
var _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
11
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
12
|
+
/**
|
|
13
|
+
* Check if the current object has inherited properties.
|
|
14
|
+
* @memberOf module:objectHelpers
|
|
15
|
+
* @param {Object|Array} object
|
|
16
|
+
* @returns {boolean}
|
|
17
|
+
*/
|
|
18
|
+
const isInstanceObject = object => {
|
|
19
|
+
if (typeof object !== 'function' && !(0, _isObject.default)(object)) {
|
|
20
|
+
return false
|
|
21
|
+
}
|
|
22
|
+
if (!['Array', 'Function', 'Object'].includes(object.constructor.name)) {
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
return object.constructor.name !== 'Array' && (0, _objectKeys.default)(object, true).length > (0, _objectKeys.default)(object).length
|
|
26
|
+
}
|
|
27
|
+
var _default = exports.default = isInstanceObject
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import 'core-js/stable';
|
|
2
|
-
/**
|
|
3
|
-
* Check if the provided thing is an object / array.
|
|
4
|
-
* @memberOf module:objectHelpers
|
|
5
|
-
* @param {*} object
|
|
6
|
-
* @returns {boolean}
|
|
7
|
-
*/
|
|
8
|
-
declare const isObject: (object: any) => boolean;
|
|
9
|
-
export default isObject;
|
|
1
|
+
import 'core-js/stable';
|
|
2
|
+
/**
|
|
3
|
+
* Check if the provided thing is an object / array.
|
|
4
|
+
* @memberOf module:objectHelpers
|
|
5
|
+
* @param {*} object
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
declare const isObject: (object: any) => boolean;
|
|
9
|
+
export default isObject;
|
|
10
10
|
//# sourceMappingURL=isObject.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
require('core-js/stable')
|
|
8
|
-
/**
|
|
9
|
-
* Check if the provided thing is an object / array.
|
|
10
|
-
* @memberOf module:objectHelpers
|
|
11
|
-
* @param {*} object
|
|
12
|
-
* @returns {boolean}
|
|
13
|
-
*/
|
|
14
|
-
const isObject = object => typeof object === 'object' && object !== null
|
|
15
|
-
var _default = exports.default = isObject
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
require('core-js/stable')
|
|
8
|
+
/**
|
|
9
|
+
* Check if the provided thing is an object / array.
|
|
10
|
+
* @memberOf module:objectHelpers
|
|
11
|
+
* @param {*} object
|
|
12
|
+
* @returns {boolean}
|
|
13
|
+
*/
|
|
14
|
+
const isObject = object => typeof object === 'object' && object !== null
|
|
15
|
+
var _default = exports.default = isObject
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import 'core-js/stable';
|
|
2
|
-
type mappableItem = Array<any> | {
|
|
3
|
-
[k: number | string]: any;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Function that produces a property of the new Object, taking three arguments
|
|
7
|
-
* @callback module:objectHelpers~mapCallback
|
|
8
|
-
* @memberOf module:objectHelpers
|
|
9
|
-
* @param {*} currentProperty - The current property being processed in the object.
|
|
10
|
-
* @param {string} [currentIndex] - The property name of the current property being processed in the object.
|
|
11
|
-
* @param {Object|Array} [object] - The object map was called upon.
|
|
12
|
-
* @returns {*}
|
|
13
|
-
*/
|
|
14
|
-
type mapCallback = (currentProperty: any, currentIndex: keyof mappableItem, object: mappableItem) => any;
|
|
15
|
-
/**
|
|
16
|
-
* This function is intended to replicate behaviour of the Array.map() function but for Objects.
|
|
17
|
-
* If an array is passed in instead then it will perform standard map(). It is recommended to
|
|
18
|
-
* always use the standard map() function when it is known that the object is actually an array.
|
|
19
|
-
* @memberOf module:objectHelpers
|
|
20
|
-
* @param {Object|Array} obj - The Object (or Array) to be mapped
|
|
21
|
-
* @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
|
|
22
|
-
* @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
|
|
23
|
-
* @returns {Object|Array}
|
|
24
|
-
*/
|
|
25
|
-
declare const mapObject: (obj: mappableItem, fn: mapCallback, thisArg?: mappableItem) => mappableItem;
|
|
26
|
-
export default mapObject;
|
|
1
|
+
import 'core-js/stable';
|
|
2
|
+
type mappableItem = Array<any> | {
|
|
3
|
+
[k: number | string]: any;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Function that produces a property of the new Object, taking three arguments
|
|
7
|
+
* @callback module:objectHelpers~mapCallback
|
|
8
|
+
* @memberOf module:objectHelpers
|
|
9
|
+
* @param {*} currentProperty - The current property being processed in the object.
|
|
10
|
+
* @param {string} [currentIndex] - The property name of the current property being processed in the object.
|
|
11
|
+
* @param {Object|Array} [object] - The object map was called upon.
|
|
12
|
+
* @returns {*}
|
|
13
|
+
*/
|
|
14
|
+
type mapCallback = (currentProperty: any, currentIndex: keyof mappableItem, object: mappableItem) => any;
|
|
15
|
+
/**
|
|
16
|
+
* This function is intended to replicate behaviour of the Array.map() function but for Objects.
|
|
17
|
+
* If an array is passed in instead then it will perform standard map(). It is recommended to
|
|
18
|
+
* always use the standard map() function when it is known that the object is actually an array.
|
|
19
|
+
* @memberOf module:objectHelpers
|
|
20
|
+
* @param {Object|Array} obj - The Object (or Array) to be mapped
|
|
21
|
+
* @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
|
|
22
|
+
* @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
|
|
23
|
+
* @returns {Object|Array}
|
|
24
|
+
*/
|
|
25
|
+
declare const mapObject: (obj: mappableItem, fn: mapCallback, thisArg?: mappableItem) => mappableItem;
|
|
26
|
+
export default mapObject;
|
|
27
27
|
//# sourceMappingURL=mapObject.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/esnext.iterator.constructor.js')
|
|
8
|
-
require('core-js/modules/esnext.iterator.map.js')
|
|
9
|
-
require('core-js/modules/esnext.iterator.reduce.js')
|
|
10
|
-
require('core-js/stable')
|
|
11
|
-
var _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
|
|
12
|
-
var _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
13
|
-
var _setValue = _interopRequireDefault(require('./setValue'))
|
|
14
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
15
|
-
/**
|
|
16
|
-
* This function is intended to replicate behaviour of the Array.map() function but for Objects.
|
|
17
|
-
* If an array is passed in instead then it will perform standard map(). It is recommended to
|
|
18
|
-
* always use the standard map() function when it is known that the object is actually an array.
|
|
19
|
-
* @memberOf module:objectHelpers
|
|
20
|
-
* @param {Object|Array} obj - The Object (or Array) to be mapped
|
|
21
|
-
* @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
|
|
22
|
-
* @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
|
|
23
|
-
* @returns {Object|Array}
|
|
24
|
-
*/
|
|
25
|
-
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), {})
|
|
26
|
-
var _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
|
+
require('core-js/stable')
|
|
11
|
+
var _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
|
|
12
|
+
var _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
13
|
+
var _setValue = _interopRequireDefault(require('./setValue'))
|
|
14
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
15
|
+
/**
|
|
16
|
+
* This function is intended to replicate behaviour of the Array.map() function but for Objects.
|
|
17
|
+
* If an array is passed in instead then it will perform standard map(). It is recommended to
|
|
18
|
+
* always use the standard map() function when it is known that the object is actually an array.
|
|
19
|
+
* @memberOf module:objectHelpers
|
|
20
|
+
* @param {Object|Array} obj - The Object (or Array) to be mapped
|
|
21
|
+
* @param {module:objectHelpers~mapCallback|Function} fn - The function to be processed for each mapped property
|
|
22
|
+
* @param {Object|Array} [thisArg] - Optional. Value to use as this when executing callback.
|
|
23
|
+
* @returns {Object|Array}
|
|
24
|
+
*/
|
|
25
|
+
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), {})
|
|
26
|
+
var _default = exports.default = mapObject
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import 'core-js/stable';
|
|
2
|
-
/**
|
|
3
|
-
* Uses mergeObjectsBase deep merge objects and arrays, merge by value.
|
|
4
|
-
* @memberOf module:objectHelpers
|
|
5
|
-
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
6
|
-
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
7
|
-
* @returns {*}
|
|
8
|
-
*/
|
|
9
|
-
declare const mergeObjects: (...objects: Array<Object>) => any[] | {
|
|
10
|
-
[k: string]: any;
|
|
11
|
-
[k: number]: any;
|
|
12
|
-
};
|
|
13
|
-
export default mergeObjects;
|
|
1
|
+
import 'core-js/stable';
|
|
2
|
+
/**
|
|
3
|
+
* Uses mergeObjectsBase deep merge objects and arrays, merge by value.
|
|
4
|
+
* @memberOf module:objectHelpers
|
|
5
|
+
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
6
|
+
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
7
|
+
* @returns {*}
|
|
8
|
+
*/
|
|
9
|
+
declare const mergeObjects: (...objects: Array<Object>) => any[] | {
|
|
10
|
+
[k: string]: any;
|
|
11
|
+
[k: number]: any;
|
|
12
|
+
};
|
|
13
|
+
export default mergeObjects;
|
|
14
14
|
//# sourceMappingURL=mergeObjects.d.ts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
require('core-js/stable')
|
|
8
|
-
var _mergeObjectsBase = _interopRequireDefault(require('./mergeObjectsBase'))
|
|
9
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
10
|
-
/**
|
|
11
|
-
* Uses mergeObjectsBase deep merge objects and arrays, merge by value.
|
|
12
|
-
* @memberOf module:objectHelpers
|
|
13
|
-
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
14
|
-
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
15
|
-
* @returns {*}
|
|
16
|
-
*/
|
|
17
|
-
const mergeObjects = (0, _mergeObjectsBase.default)({
|
|
18
|
-
useClone: true
|
|
19
|
-
})
|
|
20
|
-
var _default = exports.default = mergeObjects
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
require('core-js/stable')
|
|
8
|
+
var _mergeObjectsBase = _interopRequireDefault(require('./mergeObjectsBase'))
|
|
9
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
10
|
+
/**
|
|
11
|
+
* Uses mergeObjectsBase deep merge objects and arrays, merge by value.
|
|
12
|
+
* @memberOf module:objectHelpers
|
|
13
|
+
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
14
|
+
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
15
|
+
* @returns {*}
|
|
16
|
+
*/
|
|
17
|
+
const mergeObjects = (0, _mergeObjectsBase.default)({
|
|
18
|
+
useClone: true
|
|
19
|
+
})
|
|
20
|
+
var _default = exports.default = mergeObjects
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import 'core-js/stable';
|
|
2
|
-
import { relevanceMap } from '../functions/relevancyFilter';
|
|
3
|
-
type mergeableItem = Array<any> | {
|
|
4
|
-
[k: number | string]: any;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Function that takes one or more objects and combines them into one.
|
|
8
|
-
* @typedef {Function} module:objectHelpers~mergeObjectsCallback
|
|
9
|
-
* @memberOf module:objectHelpers
|
|
10
|
-
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
11
|
-
* @returns {*}
|
|
12
|
-
*/
|
|
13
|
-
type mergeObjectsCallback = (...objects: Array<Object>) => mergeableItem;
|
|
14
|
-
type mergeObjectsBaseOptions = {
|
|
15
|
-
mapLimit?: number;
|
|
16
|
-
depthLimit?: number;
|
|
17
|
-
relevancyRange?: number;
|
|
18
|
-
map?: relevanceMap;
|
|
19
|
-
useClone?: boolean;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
|
|
23
|
-
* Objects having the same attributes will overwrite from last object to first.
|
|
24
|
-
* NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
|
|
25
|
-
* have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
|
|
26
|
-
* @memberOf module:objectHelpers
|
|
27
|
-
* @param {Object} [options={}]
|
|
28
|
-
* @param {number} [options.mapLimit=100] - Size of temporary reference array used in memory before assessing relevancy.
|
|
29
|
-
* @param {number} [options.depthLimit=-1] - Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited.
|
|
30
|
-
* @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.
|
|
31
|
-
* @param {Iterable|array} [options.map=[]] - A predetermined list of references gathered (to be passed to itself during recursion).
|
|
32
|
-
* @param {boolean} [options.useClone=false]
|
|
33
|
-
* @returns {module:objectHelpers~mergeObjectsCallback|mergeObjectsCallback}
|
|
34
|
-
*/
|
|
35
|
-
declare const mergeObjectsBase: ({ mapLimit, depthLimit, relevancyRange, map, useClone, }?: mergeObjectsBaseOptions) => mergeObjectsCallback;
|
|
36
|
-
export default mergeObjectsBase;
|
|
1
|
+
import 'core-js/stable';
|
|
2
|
+
import { relevanceMap } from '../functions/relevancyFilter';
|
|
3
|
+
type mergeableItem = Array<any> | {
|
|
4
|
+
[k: number | string]: any;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Function that takes one or more objects and combines them into one.
|
|
8
|
+
* @typedef {Function} module:objectHelpers~mergeObjectsCallback
|
|
9
|
+
* @memberOf module:objectHelpers
|
|
10
|
+
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
11
|
+
* @returns {*}
|
|
12
|
+
*/
|
|
13
|
+
type mergeObjectsCallback = (...objects: Array<Object>) => mergeableItem;
|
|
14
|
+
type mergeObjectsBaseOptions = {
|
|
15
|
+
mapLimit?: number;
|
|
16
|
+
depthLimit?: number;
|
|
17
|
+
relevancyRange?: number;
|
|
18
|
+
map?: relevanceMap;
|
|
19
|
+
useClone?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
|
|
23
|
+
* Objects having the same attributes will overwrite from last object to first.
|
|
24
|
+
* NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
|
|
25
|
+
* have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
|
|
26
|
+
* @memberOf module:objectHelpers
|
|
27
|
+
* @param {Object} [options={}]
|
|
28
|
+
* @param {number} [options.mapLimit=100] - Size of temporary reference array used in memory before assessing relevancy.
|
|
29
|
+
* @param {number} [options.depthLimit=-1] - Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited.
|
|
30
|
+
* @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.
|
|
31
|
+
* @param {Iterable|array} [options.map=[]] - A predetermined list of references gathered (to be passed to itself during recursion).
|
|
32
|
+
* @param {boolean} [options.useClone=false]
|
|
33
|
+
* @returns {module:objectHelpers~mergeObjectsCallback|mergeObjectsCallback}
|
|
34
|
+
*/
|
|
35
|
+
declare const mergeObjectsBase: ({ mapLimit, depthLimit, relevancyRange, map, useClone, }?: mergeObjectsBaseOptions) => mergeObjectsCallback;
|
|
36
|
+
export default mergeObjectsBase;
|
|
37
37
|
//# sourceMappingURL=mergeObjectsBase.d.ts.map
|