@bbn/bbn 1.0.349 → 1.0.350
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/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/fn/object/search.d.ts +1 -1
- package/dist/fn/object/search.js +2 -2
- package/package.json +1 -1
|
@@ -94,7 +94,7 @@ import { Filter } from './filterToConditions.js';
|
|
|
94
94
|
* @param {(String|Object|Function)} prop A property's name or a filter object or function
|
|
95
95
|
* @param {*} val The value with which comparing the given property
|
|
96
96
|
* @param {String} operator The operator to use for comparison with the value as used in bbn.fn.compare
|
|
97
|
-
* @param {Number}
|
|
97
|
+
* @param {Number|false} startFrom The index from which the search should start
|
|
98
98
|
* @returns {Number} The index if found, otherwise -1
|
|
99
99
|
*/
|
|
100
100
|
export default function search(arr: any[], prop: Filter | object | string | ((a: any, i: string | number | symbol) => boolean), val?: any, operator?: number | false | string, startFrom?: number | false): number;
|
package/dist/fn/object/search.js
CHANGED
|
@@ -98,7 +98,7 @@ import numProperties from './numProperties.js';
|
|
|
98
98
|
* @param {(String|Object|Function)} prop A property's name or a filter object or function
|
|
99
99
|
* @param {*} val The value with which comparing the given property
|
|
100
100
|
* @param {String} operator The operator to use for comparison with the value as used in bbn.fn.compare
|
|
101
|
-
* @param {Number}
|
|
101
|
+
* @param {Number|false} startFrom The index from which the search should start
|
|
102
102
|
* @returns {Number} The index if found, otherwise -1
|
|
103
103
|
*/
|
|
104
104
|
export default function search(arr, prop, val, operator, startFrom) {
|
|
@@ -140,7 +140,7 @@ export default function search(arr, prop, val, operator, startFrom) {
|
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
|
-
startFrom = typeof
|
|
143
|
+
startFrom = (typeof operator === 'number') || (operator === false) ? operator : 0;
|
|
144
144
|
operator = val;
|
|
145
145
|
if (isObject(prop)) {
|
|
146
146
|
filter = prop;
|