@bbn/bbn 1.0.42 → 1.0.44
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/bundle.d.ts +3 -2
- package/dist/bundle.js +2 -2
- package/dist/fn/filter.d.ts +2 -1
- package/dist/fn/filter.js +2 -2
- package/dist/fn/search.d.ts +1 -1
- package/package.json +1 -1
package/dist/bundle.d.ts
CHANGED
|
@@ -133,7 +133,7 @@ declare module "fn/filterToConditions" {
|
|
|
133
133
|
}
|
|
134
134
|
declare module "fn/search" {
|
|
135
135
|
import { Filter } from "fn/filterToConditions";
|
|
136
|
-
const search: (arr: any[], prop: Filter | string |
|
|
136
|
+
const search: (arr: any[], prop: string | object | Filter | ((a: any, i: string | number | symbol) => boolean), val?: any, operator?: number | string, startFrom?: number) => number;
|
|
137
137
|
export { search };
|
|
138
138
|
}
|
|
139
139
|
declare module "fn/getRow" {
|
|
@@ -153,7 +153,8 @@ declare module "fn/abort" {
|
|
|
153
153
|
export { abort };
|
|
154
154
|
}
|
|
155
155
|
declare module "fn/filter" {
|
|
156
|
-
|
|
156
|
+
import { Filter } from "fn/filterToConditions";
|
|
157
|
+
const filter: (arr: any[], prop: string | object | Filter | ((a: any, i: string | number | symbol) => boolean), val?: any, operator?: string) => any[];
|
|
157
158
|
export { filter };
|
|
158
159
|
}
|
|
159
160
|
declare module "fn/abortURL" {
|
package/dist/bundle.js
CHANGED
|
@@ -943,14 +943,14 @@
|
|
|
943
943
|
return arr;
|
|
944
944
|
}
|
|
945
945
|
if (arr.length) {
|
|
946
|
-
if (typeof
|
|
946
|
+
if (typeof prop === 'object') {
|
|
947
947
|
operator = val;
|
|
948
948
|
cfg = prop;
|
|
949
949
|
}
|
|
950
950
|
else if (typeof prop === 'string') {
|
|
951
951
|
cfg[prop] = val;
|
|
952
952
|
}
|
|
953
|
-
else {
|
|
953
|
+
else if (!isFn) {
|
|
954
954
|
throw new Error('Search function error: The prop argument should be a string or an object');
|
|
955
955
|
}
|
|
956
956
|
if (isFn) {
|
package/dist/fn/filter.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { Filter } from './filterToConditions';
|
|
2
|
+
declare const filter: (arr: any[], prop: string | object | Filter | ((a: any, i: string | number | symbol) => boolean), val?: any, operator?: string) => any[];
|
|
2
3
|
export { filter };
|
package/dist/fn/filter.js
CHANGED
|
@@ -14,14 +14,14 @@ const filter = function (arr, prop, val = null, operator = '=') {
|
|
|
14
14
|
return arr;
|
|
15
15
|
}
|
|
16
16
|
if (arr.length) {
|
|
17
|
-
if (typeof
|
|
17
|
+
if (typeof prop === 'object') {
|
|
18
18
|
operator = val;
|
|
19
19
|
cfg = prop;
|
|
20
20
|
}
|
|
21
21
|
else if (typeof prop === 'string') {
|
|
22
22
|
cfg[prop] = val;
|
|
23
23
|
}
|
|
24
|
-
else {
|
|
24
|
+
else if (!isFn) {
|
|
25
25
|
throw new Error('Search function error: The prop argument should be a string or an object');
|
|
26
26
|
}
|
|
27
27
|
if (isFn) {
|
package/dist/fn/search.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Filter } from './filterToConditions';
|
|
2
|
-
declare const search: (arr: any[], prop: Filter | string |
|
|
2
|
+
declare const search: (arr: any[], prop: string | object | Filter | ((a: any, i: string | number | symbol) => boolean), val?: any, operator?: number | string, startFrom?: number) => number;
|
|
3
3
|
export { search };
|