@bbn/bbn 1.0.44 → 1.0.46
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.js +32 -31
- package/dist/fn/filter.js +4 -4
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -928,17 +928,18 @@
|
|
|
928
928
|
};
|
|
929
929
|
exports.abort = abort;
|
|
930
930
|
});
|
|
931
|
-
define("fn/filter", ["require", "exports", "fn/isArray", "fn/
|
|
931
|
+
define("fn/filter", ["require", "exports", "fn/isArray", "fn/each", "fn/filterToConditions", "fn/compareConditions"], function (require, exports, isArray_4, each_3, filterToConditions_2, compareConditions_2) {
|
|
932
932
|
"use strict";
|
|
933
933
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
934
934
|
exports.filter = void 0;
|
|
935
935
|
const filter = function (arr, prop, val = null, operator = '=') {
|
|
936
936
|
if (!(0, isArray_4.isArray)(arr)) {
|
|
937
|
+
bbn.fn.log("NOT ARRAY", arr);
|
|
937
938
|
throw new Error('Error in filter: The first argument must be an array');
|
|
938
939
|
}
|
|
939
940
|
let cfg = {};
|
|
940
941
|
const res = [];
|
|
941
|
-
const isFn =
|
|
942
|
+
const isFn = typeof (prop) === 'function';
|
|
942
943
|
if (!prop || !arr.length) {
|
|
943
944
|
return arr;
|
|
944
945
|
}
|
|
@@ -953,9 +954,9 @@
|
|
|
953
954
|
else if (!isFn) {
|
|
954
955
|
throw new Error('Search function error: The prop argument should be a string or an object');
|
|
955
956
|
}
|
|
956
|
-
if (
|
|
957
|
+
if (typeof (prop) === 'function') {
|
|
957
958
|
(0, each_3.each)(arr, (a, i) => {
|
|
958
|
-
if (
|
|
959
|
+
if (prop(a, i)) {
|
|
959
960
|
res.push(a);
|
|
960
961
|
}
|
|
961
962
|
});
|
|
@@ -1412,7 +1413,7 @@
|
|
|
1412
1413
|
};
|
|
1413
1414
|
exports.defaultStartLoadingFunction = defaultStartLoadingFunction;
|
|
1414
1415
|
});
|
|
1415
|
-
define("fn/ajax", ["require", "exports", "fn/isObject", "fn/replaceAll", "fn/getRequestId", "fn/getLoader", "fn/extend", "fn/numProperties", "fn/_deleteLoader", "fn/defaultEndLoadingFunction", "fn/isFunction", "fn/defaultAjaxErrorFunction", "fn/defaultAjaxAbortFunction", "fn/_addLoader", "fn/defaultStartLoadingFunction"], function (require, exports, isObject_8, replaceAll_1, getRequestId_1, getLoader_2, extend_1, numProperties_4, _deleteLoader_1, defaultEndLoadingFunction_1,
|
|
1416
|
+
define("fn/ajax", ["require", "exports", "fn/isObject", "fn/replaceAll", "fn/getRequestId", "fn/getLoader", "fn/extend", "fn/numProperties", "fn/_deleteLoader", "fn/defaultEndLoadingFunction", "fn/isFunction", "fn/defaultAjaxErrorFunction", "fn/defaultAjaxAbortFunction", "fn/_addLoader", "fn/defaultStartLoadingFunction"], function (require, exports, isObject_8, replaceAll_1, getRequestId_1, getLoader_2, extend_1, numProperties_4, _deleteLoader_1, defaultEndLoadingFunction_1, isFunction_2, defaultAjaxErrorFunction_1, defaultAjaxAbortFunction_1, _addLoader_1, defaultStartLoadingFunction_1) {
|
|
1416
1417
|
"use strict";
|
|
1417
1418
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1418
1419
|
exports.ajax = void 0;
|
|
@@ -1479,7 +1480,7 @@
|
|
|
1479
1480
|
(0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, res);
|
|
1480
1481
|
switch (res.status) {
|
|
1481
1482
|
case 200:
|
|
1482
|
-
if ((0,
|
|
1483
|
+
if ((0, isFunction_2.isFunction)(success)) {
|
|
1483
1484
|
success(res.data, res.headers);
|
|
1484
1485
|
}
|
|
1485
1486
|
break;
|
|
@@ -1494,7 +1495,7 @@
|
|
|
1494
1495
|
(0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, err);
|
|
1495
1496
|
if (isAbort) {
|
|
1496
1497
|
let ok = 1;
|
|
1497
|
-
if ((0,
|
|
1498
|
+
if ((0, isFunction_2.isFunction)(abort)) {
|
|
1498
1499
|
ok = abort(err.message, url);
|
|
1499
1500
|
}
|
|
1500
1501
|
if (ok) {
|
|
@@ -1503,7 +1504,7 @@
|
|
|
1503
1504
|
}
|
|
1504
1505
|
else {
|
|
1505
1506
|
let ok = 1;
|
|
1506
|
-
if ((0,
|
|
1507
|
+
if ((0, isFunction_2.isFunction)(failure)) {
|
|
1507
1508
|
ok = failure(err.request, err);
|
|
1508
1509
|
}
|
|
1509
1510
|
if (ok) {
|
|
@@ -1904,7 +1905,7 @@
|
|
|
1904
1905
|
};
|
|
1905
1906
|
exports.defaultAlertFunction = defaultAlertFunction;
|
|
1906
1907
|
});
|
|
1907
|
-
define("fn/callback", ["require", "exports", "fn/error", "fn/defaultLinkFunction", "fn/isFunction", "fn/log", "fn/defaultPostLinkFunction", "fn/defaultAlertFunction"], function (require, exports, error_1, defaultLinkFunction_1,
|
|
1908
|
+
define("fn/callback", ["require", "exports", "fn/error", "fn/defaultLinkFunction", "fn/isFunction", "fn/log", "fn/defaultPostLinkFunction", "fn/defaultAlertFunction"], function (require, exports, error_1, defaultLinkFunction_1, isFunction_3, log_7, defaultPostLinkFunction_1, defaultAlertFunction_1) {
|
|
1908
1909
|
"use strict";
|
|
1909
1910
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1910
1911
|
exports.callback = void 0;
|
|
@@ -1951,13 +1952,13 @@
|
|
|
1951
1952
|
let r = null;
|
|
1952
1953
|
try {
|
|
1953
1954
|
r = eval(res.script);
|
|
1954
|
-
if ((0,
|
|
1955
|
+
if ((0, isFunction_3.isFunction)(r)) {
|
|
1955
1956
|
r = r(data, ele);
|
|
1956
1957
|
}
|
|
1957
1958
|
}
|
|
1958
1959
|
catch (e) {
|
|
1959
1960
|
(0, log_7.log)(e, res);
|
|
1960
|
-
(0, error_1.error)((0,
|
|
1961
|
+
(0, error_1.error)((0, isFunction_3.isFunction)(e.getMessage) ? e.getMessage() : null);
|
|
1961
1962
|
}
|
|
1962
1963
|
return r;
|
|
1963
1964
|
})(res.data ? res.data : {}, ele ? ele : false);
|
|
@@ -2136,7 +2137,7 @@
|
|
|
2136
2137
|
};
|
|
2137
2138
|
exports.correctCase = correctCase;
|
|
2138
2139
|
});
|
|
2139
|
-
define("fn/checkType", ["require", "exports", "fn/isArray", "fn/each", "fn/isFunction", "fn/isString", "fn/correctCase", "fn/error", "fn/log"], function (require, exports, isArray_7, each_9,
|
|
2140
|
+
define("fn/checkType", ["require", "exports", "fn/isArray", "fn/each", "fn/isFunction", "fn/isString", "fn/correctCase", "fn/error", "fn/log"], function (require, exports, isArray_7, each_9, isFunction_4, isString_8, correctCase_1, error_2, log_8) {
|
|
2140
2141
|
"use strict";
|
|
2141
2142
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2142
2143
|
exports.checkType = void 0;
|
|
@@ -2165,14 +2166,14 @@
|
|
|
2165
2166
|
else if (t === Function) {
|
|
2166
2167
|
t = 'function';
|
|
2167
2168
|
}
|
|
2168
|
-
if ((0,
|
|
2169
|
+
if ((0, isFunction_4.isFunction)(t)) {
|
|
2169
2170
|
typesList.push(t.name || t.constructor?.name || t.toString());
|
|
2170
2171
|
if (value instanceof t) {
|
|
2171
2172
|
ok = true;
|
|
2172
2173
|
return false;
|
|
2173
2174
|
}
|
|
2174
2175
|
}
|
|
2175
|
-
else if (!(0, isString_8.isString)(t) || !(0,
|
|
2176
|
+
else if (!(0, isString_8.isString)(t) || !(0, isFunction_4.isFunction)(bbn.fn['is' + (0, correctCase_1.correctCase)(t)])) {
|
|
2176
2177
|
(0, error_2.error)(`The type ${t} is not recognized`);
|
|
2177
2178
|
}
|
|
2178
2179
|
else if (bbn.fn['is' + (0, correctCase_1.correctCase)(t)](value)) {
|
|
@@ -2222,7 +2223,7 @@
|
|
|
2222
2223
|
};
|
|
2223
2224
|
exports.colorToHex = colorToHex;
|
|
2224
2225
|
});
|
|
2225
|
-
define("fn/copy", ["require", "exports", "fn/isObject", "fn/isFunction"], function (require, exports, isObject_11,
|
|
2226
|
+
define("fn/copy", ["require", "exports", "fn/isObject", "fn/isFunction"], function (require, exports, isObject_11, isFunction_5) {
|
|
2226
2227
|
"use strict";
|
|
2227
2228
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2228
2229
|
exports.copy = void 0;
|
|
@@ -2235,7 +2236,7 @@
|
|
|
2235
2236
|
resolve(true);
|
|
2236
2237
|
});
|
|
2237
2238
|
}
|
|
2238
|
-
else if ((0, isObject_11.isObject)(st) && (0,
|
|
2239
|
+
else if ((0, isObject_11.isObject)(st) && (0, isFunction_5.isFunction)(st.toBlob)) {
|
|
2239
2240
|
st.toBlob((blob) => {
|
|
2240
2241
|
navigator.clipboard.write([new ClipboardItem({ [blob.type.toString()]: blob })]).then(() => {
|
|
2241
2242
|
resolve(true);
|
|
@@ -2390,19 +2391,19 @@
|
|
|
2390
2391
|
};
|
|
2391
2392
|
exports.deepPath = deepPath;
|
|
2392
2393
|
});
|
|
2393
|
-
define("fn/defaultConfirmFunction", ["require", "exports", "fn/isFunction"], function (require, exports,
|
|
2394
|
+
define("fn/defaultConfirmFunction", ["require", "exports", "fn/isFunction"], function (require, exports, isFunction_6) {
|
|
2394
2395
|
"use strict";
|
|
2395
2396
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2396
2397
|
exports.defaultConfirmFunction = void 0;
|
|
2397
2398
|
const defaultConfirmFunction = function (text, yesFn, noFn) {
|
|
2398
2399
|
let ok = 0;
|
|
2399
2400
|
if (confirm(text)) {
|
|
2400
|
-
if ((0,
|
|
2401
|
+
if ((0, isFunction_6.isFunction)(yesFn)) {
|
|
2401
2402
|
yesFn();
|
|
2402
2403
|
ok = 1;
|
|
2403
2404
|
}
|
|
2404
2405
|
}
|
|
2405
|
-
if (!ok && (0,
|
|
2406
|
+
if (!ok && (0, isFunction_6.isFunction)(noFn)) {
|
|
2406
2407
|
noFn();
|
|
2407
2408
|
}
|
|
2408
2409
|
};
|
|
@@ -2471,7 +2472,7 @@
|
|
|
2471
2472
|
};
|
|
2472
2473
|
exports.isValue = isValue;
|
|
2473
2474
|
});
|
|
2474
|
-
define("fn/diffObj", ["require", "exports", "fn/isDate", "fn/createObject", "fn/isFunction", "fn/isValue", "fn/isDom", "fn/numProperties"], function (require, exports, isDate_6, createObject_1,
|
|
2475
|
+
define("fn/diffObj", ["require", "exports", "fn/isDate", "fn/createObject", "fn/isFunction", "fn/isValue", "fn/isDom", "fn/numProperties"], function (require, exports, isDate_6, createObject_1, isFunction_7, isValue_1, isDom_4, numProperties_5) {
|
|
2475
2476
|
"use strict";
|
|
2476
2477
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2477
2478
|
exports.diffObj = void 0;
|
|
@@ -2499,7 +2500,7 @@
|
|
|
2499
2500
|
notRoot = false;
|
|
2500
2501
|
}
|
|
2501
2502
|
let diff = (0, createObject_1.createObject)();
|
|
2502
|
-
if (!(0,
|
|
2503
|
+
if (!(0, isFunction_7.isFunction)(obj1) && !(0, isFunction_7.isFunction)(obj2)) {
|
|
2503
2504
|
if ((0, isValue_1.isValue)(obj1) || (0, isValue_1.isValue)(obj2)) {
|
|
2504
2505
|
let res = _compareValues(obj1, obj2);
|
|
2505
2506
|
if (unchanged || res !== VALUE_UNCHANGED) {
|
|
@@ -2535,7 +2536,7 @@
|
|
|
2535
2536
|
}
|
|
2536
2537
|
diffObjProcessed.push(obj1, obj2);
|
|
2537
2538
|
for (let key in obj1) {
|
|
2538
|
-
if ((0,
|
|
2539
|
+
if ((0, isFunction_7.isFunction)(obj1[key])) {
|
|
2539
2540
|
continue;
|
|
2540
2541
|
}
|
|
2541
2542
|
let value2 = undefined;
|
|
@@ -2548,7 +2549,7 @@
|
|
|
2548
2549
|
}
|
|
2549
2550
|
}
|
|
2550
2551
|
for (let key in obj2) {
|
|
2551
|
-
if ((0,
|
|
2552
|
+
if ((0, isFunction_7.isFunction)(obj2[key]) || 'undefined' != typeof obj1[key]) {
|
|
2552
2553
|
continue;
|
|
2553
2554
|
}
|
|
2554
2555
|
let res = diffObj(undefined, obj2[key], unchanged, true);
|
|
@@ -3661,7 +3662,7 @@
|
|
|
3661
3662
|
};
|
|
3662
3663
|
exports.info = info;
|
|
3663
3664
|
});
|
|
3664
|
-
define("fn/treatAjaxArguments", ["require", "exports", "fn/isObject", "fn/isFunction", "fn/substr", "fn/numProperties"], function (require, exports, isObject_14,
|
|
3665
|
+
define("fn/treatAjaxArguments", ["require", "exports", "fn/isObject", "fn/isFunction", "fn/substr", "fn/numProperties"], function (require, exports, isObject_14, isFunction_8, substr_9, numProperties_6) {
|
|
3665
3666
|
"use strict";
|
|
3666
3667
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3667
3668
|
exports.treatAjaxArguments = void 0;
|
|
@@ -3676,7 +3677,7 @@
|
|
|
3676
3677
|
t = typeof args[i];
|
|
3677
3678
|
t = t.toLowerCase();
|
|
3678
3679
|
/* Callbacks */
|
|
3679
|
-
if ((0,
|
|
3680
|
+
if ((0, isFunction_8.isFunction)(args[i])) {
|
|
3680
3681
|
if (cfg.errorFn && !cfg.abortFn) {
|
|
3681
3682
|
cfg.abortFn = args[i];
|
|
3682
3683
|
}
|
|
@@ -4016,7 +4017,7 @@
|
|
|
4016
4017
|
};
|
|
4017
4018
|
exports.isMobile = isMobile;
|
|
4018
4019
|
});
|
|
4019
|
-
define("fn/init", ["require", "exports", "fn/substr", "fn/each", "fn/extend", "fn/addColors", "fn/link", "fn/submit", "fn/resize", "fn/isMobile", "fn/isTabletDevice", "fn/defaultHistoryFunction", "fn/isFunction", "fn/log"], function (require, exports, substr_11, each_17, extend_6, addColors_1, link_1, submit_1, resize_1, isMobile_1, isTabletDevice_2, defaultHistoryFunction_1,
|
|
4020
|
+
define("fn/init", ["require", "exports", "fn/substr", "fn/each", "fn/extend", "fn/addColors", "fn/link", "fn/submit", "fn/resize", "fn/isMobile", "fn/isTabletDevice", "fn/defaultHistoryFunction", "fn/isFunction", "fn/log"], function (require, exports, substr_11, each_17, extend_6, addColors_1, link_1, submit_1, resize_1, isMobile_1, isTabletDevice_2, defaultHistoryFunction_1, isFunction_9, log_15) {
|
|
4020
4021
|
"use strict";
|
|
4021
4022
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4022
4023
|
exports.init = void 0;
|
|
@@ -4160,7 +4161,7 @@
|
|
|
4160
4161
|
//link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
|
|
4161
4162
|
(0, link_1.link)(state.url, (0, extend_6.extend)({ title: state.title || bbn.env.siteTitle }, state.data || {}));
|
|
4162
4163
|
}
|
|
4163
|
-
else if (state && state.data && (0,
|
|
4164
|
+
else if (state && state.data && (0, isFunction_9.isFunction)(state.data.script)) {
|
|
4164
4165
|
state.data.script();
|
|
4165
4166
|
}
|
|
4166
4167
|
}
|
|
@@ -4599,7 +4600,7 @@
|
|
|
4599
4600
|
};
|
|
4600
4601
|
exports.warning = warning;
|
|
4601
4602
|
});
|
|
4602
|
-
define("fn/makeReactive", ["require", "exports", "fn/log", "fn/createObject", "fn/isSymbol", "fn/isNumber", "fn/isArray", "fn/warning", "fn/isFunction", "fn/isSame"], function (require, exports, log_17, createObject_2, isSymbol_1, isNumber_8, isArray_13, warning_1,
|
|
4603
|
+
define("fn/makeReactive", ["require", "exports", "fn/log", "fn/createObject", "fn/isSymbol", "fn/isNumber", "fn/isArray", "fn/warning", "fn/isFunction", "fn/isSame"], function (require, exports, log_17, createObject_2, isSymbol_1, isNumber_8, isArray_13, warning_1, isFunction_10, isSame_2) {
|
|
4603
4604
|
"use strict";
|
|
4604
4605
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4605
4606
|
exports.makeReactive = void 0;
|
|
@@ -4640,7 +4641,7 @@
|
|
|
4640
4641
|
return res;
|
|
4641
4642
|
};
|
|
4642
4643
|
}
|
|
4643
|
-
if ((0,
|
|
4644
|
+
if ((0, isFunction_10.isFunction)(realValue)) {
|
|
4644
4645
|
return realValue;
|
|
4645
4646
|
}
|
|
4646
4647
|
if (key === '__bbnRoot') {
|
|
@@ -5817,7 +5818,7 @@
|
|
|
5817
5818
|
};
|
|
5818
5819
|
exports.upload = upload;
|
|
5819
5820
|
});
|
|
5820
|
-
define("index", ["require", "exports", "fn/_addLoader", "fn/_compareValues", "fn/_deleteLoader", "fn/abort", "fn/abortURL", "fn/addColors", "fn/addInputs", "fn/addStyle", "fn/adjustHeight", "fn/adjustSize", "fn/adjustWidth", "fn/ajax", "fn/analyzeFunction", "fn/animateCss", "fn/arrayBuffer2String", "fn/arrayFromProp", "fn/autoExtend", "fn/baseName", "fn/br2nl", "fn/calendar", "fn/callback", "fn/camelize", "fn/camelToCss", "fn/canvasToImage", "fn/center", "fn/checkProps", "fn/checkPropsDetails", "fn/checkPropsOrDie", "fn/checkType", "fn/circularReplacer", "fn/clone", "fn/colorToHex", "fn/compare", "fn/compareConditions", "fn/copy", "fn/correctCase", "fn/count", "fn/crc32", "fn/createObject", "fn/cssExists", "fn/date", "fn/dateSQL", "fn/daysInMonth", "fn/deepPath", "fn/defaultAjaxAbortFunction", "fn/defaultAjaxErrorFunction", "fn/defaultAlertFunction", "fn/defaultConfirmFunction", "fn/defaultEndLoadingFunction", "fn/defaultErrorFunction", "fn/defaultHistoryFunction", "fn/defaultLinkFunction", "fn/defaultPostLinkFunction", "fn/defaultPreLinkFunction", "fn/defaultResizeFunction", "fn/defaultStartLoadingFunction", "fn/deleteProp", "fn/diffObj", "fn/dirName", "fn/download", "fn/downloadContent", "fn/each", "fn/eraseCookie", "fn/error", "fn/escapeDquotes", "fn/escapeRegExp", "fn/escapeSquotes", "fn/escapeTicks", "fn/escapeUrl", "fn/extend", "fn/extendOut", "fn/fdate", "fn/fdatetime", "fn/fieldValue", "fn/fileExt", "fn/filter", "fn/filterToConditions", "fn/findAll", "fn/fori", "fn/forir", "fn/format", "fn/formatBytes", "fn/formatDate", "fn/formatSize", "fn/formdata", "fn/fromXml", "fn/ftime", "fn/getAllTags", "fn/getAncestors", "fn/getAttributes", "fn/getBrowserName", "fn/getBrowserVersion", "fn/getCookie", "fn/getCssVar", "fn/getDay", "fn/getDeviceType", "fn/getEventData", "fn/getField", "fn/getFieldValues", "fn/getHtml", "fn/getHTMLOfSelection", "fn/getLoader", "fn/getPath", "fn/getProp", "fn/getProperty", "fn/getRequestId", "fn/getRow", "fn/getScrollBarSize", "fn/getText", "fn/getTimeoff", "fn/happy", "fn/hash", "fn/hex2rgb", "fn/history", "fn/html2text", "fn/imageToCanvas", "fn/imgToBase64", "fn/info", "fn/init", "fn/isActiveInterface", "fn/isArray", "fn/isBlob", "fn/isBoolean", "fn/isCanvas", "fn/isColor", "fn/isComment", "fn/isCp", "fn/isDate", "fn/isDesktopDevice", "fn/isDimension", "fn/isDom", "fn/isEmail", "fn/isEmpty", "fn/isEvent", "fn/isFocused", "fn/isFunction", "fn/isHostname", "fn/isInside", "fn/isInt", "fn/isIP", "fn/isIterable", "fn/isMobile", "fn/isMobileDevice", "fn/isNull", "fn/isNumber", "fn/isObject", "fn/isPercent", "fn/isPrimitive", "fn/isPromise", "fn/isPropSize", "fn/isSame", "fn/isSQLDate", "fn/isString", "fn/isSymbol", "fn/isTabletDevice", "fn/isURL", "fn/isValidDimension", "fn/isValidName", "fn/isValue", "fn/isVue", "fn/iterate", "fn/lightenDarkenHex", "fn/link", "fn/log", "fn/makeReactive", "fn/map", "fn/md5", "fn/money", "fn/move", "fn/multiorder", "fn/nl2br", "fn/numProperties", "fn/objectToFormData", "fn/order", "fn/outerHeight", "fn/outerWidth", "fn/percent", "fn/pickValue", "fn/post", "fn/postOut", "fn/printf", "fn/quotes2html", "fn/randomInt", "fn/randomString", "fn/removeAccents", "fn/removeEmpty", "fn/removeExtraSpaces", "fn/removeHtmlComments", "fn/removePrivateProp", "fn/removeTrailingChars", "fn/repeat", "fn/replaceAll", "fn/replaceSelection", "fn/resize", "fn/rgb2hex", "fn/riterate", "fn/roundDecimal", "fn/sanitize", "fn/search", "fn/selectElementText", "fn/selector", "fn/setCookie", "fn/setCssVar", "fn/setNavigationVars", "fn/setProp", "fn/setProperty", "fn/shorten", "fn/shortenObj", "fn/shuffle", "fn/simpleHash", "fn/simpleHash1", "fn/simpleHash2", "fn/chrono", "fn/stat", "fn/string2ArrayBuffer", "fn/submit", "fn/substr", "fn/sum", "fn/timestamp", "fn/toCSV", "fn/toggleFullScreen", "fn/translate", "fn/treatAjaxArguments", "fn/trim", "fn/uniqString", "fn/unique", "fn/upload", "fn/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_5, circularReplacer_2, clone_2, colorToHex_1, compare_2, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_2, defaultAjaxErrorFunction_3, defaultAlertFunction_2, defaultConfirmFunction_1, defaultEndLoadingFunction_2, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_2, defaultPostLinkFunction_2, defaultPreLinkFunction_2, defaultResizeFunction_2, defaultStartLoadingFunction_2, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_27, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_7, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_4, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1, history_1, html2text_2, imageToCanvas_2, imgToBase64_1, info_1, init_1, isActiveInterface_1, isArray_19, isBlob_2, isBoolean_1, isCanvas_2, isColor_1, isComment_1, isCp_3, isDate_8, isDesktopDevice_1, isDimension_1, isDom_5, isEmail_1, isEmpty_2, isEvent_1, isFocused_1,
|
|
5821
|
+
define("index", ["require", "exports", "fn/_addLoader", "fn/_compareValues", "fn/_deleteLoader", "fn/abort", "fn/abortURL", "fn/addColors", "fn/addInputs", "fn/addStyle", "fn/adjustHeight", "fn/adjustSize", "fn/adjustWidth", "fn/ajax", "fn/analyzeFunction", "fn/animateCss", "fn/arrayBuffer2String", "fn/arrayFromProp", "fn/autoExtend", "fn/baseName", "fn/br2nl", "fn/calendar", "fn/callback", "fn/camelize", "fn/camelToCss", "fn/canvasToImage", "fn/center", "fn/checkProps", "fn/checkPropsDetails", "fn/checkPropsOrDie", "fn/checkType", "fn/circularReplacer", "fn/clone", "fn/colorToHex", "fn/compare", "fn/compareConditions", "fn/copy", "fn/correctCase", "fn/count", "fn/crc32", "fn/createObject", "fn/cssExists", "fn/date", "fn/dateSQL", "fn/daysInMonth", "fn/deepPath", "fn/defaultAjaxAbortFunction", "fn/defaultAjaxErrorFunction", "fn/defaultAlertFunction", "fn/defaultConfirmFunction", "fn/defaultEndLoadingFunction", "fn/defaultErrorFunction", "fn/defaultHistoryFunction", "fn/defaultLinkFunction", "fn/defaultPostLinkFunction", "fn/defaultPreLinkFunction", "fn/defaultResizeFunction", "fn/defaultStartLoadingFunction", "fn/deleteProp", "fn/diffObj", "fn/dirName", "fn/download", "fn/downloadContent", "fn/each", "fn/eraseCookie", "fn/error", "fn/escapeDquotes", "fn/escapeRegExp", "fn/escapeSquotes", "fn/escapeTicks", "fn/escapeUrl", "fn/extend", "fn/extendOut", "fn/fdate", "fn/fdatetime", "fn/fieldValue", "fn/fileExt", "fn/filter", "fn/filterToConditions", "fn/findAll", "fn/fori", "fn/forir", "fn/format", "fn/formatBytes", "fn/formatDate", "fn/formatSize", "fn/formdata", "fn/fromXml", "fn/ftime", "fn/getAllTags", "fn/getAncestors", "fn/getAttributes", "fn/getBrowserName", "fn/getBrowserVersion", "fn/getCookie", "fn/getCssVar", "fn/getDay", "fn/getDeviceType", "fn/getEventData", "fn/getField", "fn/getFieldValues", "fn/getHtml", "fn/getHTMLOfSelection", "fn/getLoader", "fn/getPath", "fn/getProp", "fn/getProperty", "fn/getRequestId", "fn/getRow", "fn/getScrollBarSize", "fn/getText", "fn/getTimeoff", "fn/happy", "fn/hash", "fn/hex2rgb", "fn/history", "fn/html2text", "fn/imageToCanvas", "fn/imgToBase64", "fn/info", "fn/init", "fn/isActiveInterface", "fn/isArray", "fn/isBlob", "fn/isBoolean", "fn/isCanvas", "fn/isColor", "fn/isComment", "fn/isCp", "fn/isDate", "fn/isDesktopDevice", "fn/isDimension", "fn/isDom", "fn/isEmail", "fn/isEmpty", "fn/isEvent", "fn/isFocused", "fn/isFunction", "fn/isHostname", "fn/isInside", "fn/isInt", "fn/isIP", "fn/isIterable", "fn/isMobile", "fn/isMobileDevice", "fn/isNull", "fn/isNumber", "fn/isObject", "fn/isPercent", "fn/isPrimitive", "fn/isPromise", "fn/isPropSize", "fn/isSame", "fn/isSQLDate", "fn/isString", "fn/isSymbol", "fn/isTabletDevice", "fn/isURL", "fn/isValidDimension", "fn/isValidName", "fn/isValue", "fn/isVue", "fn/iterate", "fn/lightenDarkenHex", "fn/link", "fn/log", "fn/makeReactive", "fn/map", "fn/md5", "fn/money", "fn/move", "fn/multiorder", "fn/nl2br", "fn/numProperties", "fn/objectToFormData", "fn/order", "fn/outerHeight", "fn/outerWidth", "fn/percent", "fn/pickValue", "fn/post", "fn/postOut", "fn/printf", "fn/quotes2html", "fn/randomInt", "fn/randomString", "fn/removeAccents", "fn/removeEmpty", "fn/removeExtraSpaces", "fn/removeHtmlComments", "fn/removePrivateProp", "fn/removeTrailingChars", "fn/repeat", "fn/replaceAll", "fn/replaceSelection", "fn/resize", "fn/rgb2hex", "fn/riterate", "fn/roundDecimal", "fn/sanitize", "fn/search", "fn/selectElementText", "fn/selector", "fn/setCookie", "fn/setCssVar", "fn/setNavigationVars", "fn/setProp", "fn/setProperty", "fn/shorten", "fn/shortenObj", "fn/shuffle", "fn/simpleHash", "fn/simpleHash1", "fn/simpleHash2", "fn/chrono", "fn/stat", "fn/string2ArrayBuffer", "fn/submit", "fn/substr", "fn/sum", "fn/timestamp", "fn/toCSV", "fn/toggleFullScreen", "fn/translate", "fn/treatAjaxArguments", "fn/trim", "fn/uniqString", "fn/unique", "fn/upload", "fn/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_5, circularReplacer_2, clone_2, colorToHex_1, compare_2, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_2, defaultAjaxErrorFunction_3, defaultAlertFunction_2, defaultConfirmFunction_1, defaultEndLoadingFunction_2, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_2, defaultPostLinkFunction_2, defaultPreLinkFunction_2, defaultResizeFunction_2, defaultStartLoadingFunction_2, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_27, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_7, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_4, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1, history_1, html2text_2, imageToCanvas_2, imgToBase64_1, info_1, init_1, isActiveInterface_1, isArray_19, isBlob_2, isBoolean_1, isCanvas_2, isColor_1, isComment_1, isCp_3, isDate_8, isDesktopDevice_1, isDimension_1, isDom_5, isEmail_1, isEmpty_2, isEvent_1, isFocused_1, isFunction_11, isHostname_1, isInside_1, isInt_2, isIP_2, isIterable_5, isMobile_2, isMobileDevice_2, isNull_4, isNumber_10, isObject_18, isPercent_1, isPrimitive_1, isPromise_1, isPropSize_1, isSame_3, isSQLDate_1, isString_27, isSymbol_2, isTabletDevice_3, isURL_1, isValidDimension_2, isValidName_1, isValue_2, isVue_1, iterate_11, lightenDarkenHex_1, link_2, log_19, makeReactive_1, map_1, md5_4, money_1, move_1, multiorder_1, nl2br_1, numProperties_8, objectToFormData_2, order_1, outerHeight_1, outerWidth_1, percent_1, pickValue_1, post_2, postOut_1, printf_1, quotes2html_1, randomInt_2, randomString_1, removeAccents_4, removeEmpty_1, removeExtraSpaces_1, removeHtmlComments_2, removePrivateProp_2, removeTrailingChars_1, repeat_1, replaceAll_8, replaceSelection_1, resize_3, rgb2hex_1, riterate_1, roundDecimal_1, sanitize_1, search_6, selectElementText_1, selector_3, setCookie_1, setCssVar_1, setNavigationVars_2, setProp_1, setProperty_1, shorten_2, shortenObj_1, shuffle_1, simpleHash_2, simpleHash1_2, simpleHash2_2, chrono_1, stat_1, string2ArrayBuffer_1, submit_2, substr_16, sum_1, timestamp_1, toCSV_1, toggleFullScreen_1, translate_1, treatAjaxArguments_3, trim_2, uniqString_1, unique_2, upload_1, warning_2) {
|
|
5821
5822
|
"use strict";
|
|
5822
5823
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5823
5824
|
exports.bbn = void 0;
|
|
@@ -6124,7 +6125,7 @@
|
|
|
6124
6125
|
isEmpty: isEmpty_2.isEmpty,
|
|
6125
6126
|
isEvent: isEvent_1.isEvent,
|
|
6126
6127
|
isFocused: isFocused_1.isFocused,
|
|
6127
|
-
isFunction:
|
|
6128
|
+
isFunction: isFunction_11.isFunction,
|
|
6128
6129
|
isHostname: isHostname_1.isHostname,
|
|
6129
6130
|
isInside: isInside_1.isInside,
|
|
6130
6131
|
isInt: isInt_2.isInt,
|
package/dist/fn/filter.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { isArray } from './isArray';
|
|
2
|
-
import { isFunction } from './isFunction';
|
|
3
2
|
import { each } from './each';
|
|
4
3
|
import { filterToConditions } from './filterToConditions';
|
|
5
4
|
import { compareConditions } from './compareConditions';
|
|
6
5
|
const filter = function (arr, prop, val = null, operator = '=') {
|
|
7
6
|
if (!isArray(arr)) {
|
|
7
|
+
bbn.fn.log("NOT ARRAY", arr);
|
|
8
8
|
throw new Error('Error in filter: The first argument must be an array');
|
|
9
9
|
}
|
|
10
10
|
let cfg = {};
|
|
11
11
|
const res = [];
|
|
12
|
-
const isFn =
|
|
12
|
+
const isFn = typeof (prop) === 'function';
|
|
13
13
|
if (!prop || !arr.length) {
|
|
14
14
|
return arr;
|
|
15
15
|
}
|
|
@@ -24,9 +24,9 @@ const filter = function (arr, prop, val = null, operator = '=') {
|
|
|
24
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
|
-
if (
|
|
27
|
+
if (typeof (prop) === 'function') {
|
|
28
28
|
each(arr, (a, i) => {
|
|
29
|
-
if (
|
|
29
|
+
if (prop(a, i)) {
|
|
30
30
|
res.push(a);
|
|
31
31
|
}
|
|
32
32
|
});
|