@bbn/bbn 1.0.45 → 1.0.47

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 CHANGED
@@ -928,7 +928,7 @@
928
928
  };
929
929
  exports.abort = abort;
930
930
  });
931
- define("fn/filter", ["require", "exports", "fn/isArray", "fn/isFunction", "fn/each", "fn/filterToConditions", "fn/compareConditions"], function (require, exports, isArray_4, isFunction_2, each_3, filterToConditions_2, compareConditions_2) {
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;
@@ -939,7 +939,7 @@
939
939
  }
940
940
  let cfg = {};
941
941
  const res = [];
942
- const isFn = (0, isFunction_2.isFunction)(prop);
942
+ const isFn = typeof (prop) === 'function';
943
943
  if (!prop || !arr.length) {
944
944
  return arr;
945
945
  }
@@ -954,9 +954,9 @@
954
954
  else if (!isFn) {
955
955
  throw new Error('Search function error: The prop argument should be a string or an object');
956
956
  }
957
- if (isFn) {
957
+ if (typeof (prop) === 'function') {
958
958
  (0, each_3.each)(arr, (a, i) => {
959
- if (filter(a, prop)) {
959
+ if (prop(a, i)) {
960
960
  res.push(a);
961
961
  }
962
962
  });
@@ -965,7 +965,7 @@
965
965
  cfg = (0, filterToConditions_2.filterToConditions)(cfg, operator);
966
966
  if (cfg.conditions && cfg.logic) {
967
967
  (0, each_3.each)(arr, (a) => {
968
- if ((0, compareConditions_2.compareConditions)(a, filter)) {
968
+ if ((0, compareConditions_2.compareConditions)(a, cfg)) {
969
969
  res.push(a);
970
970
  }
971
971
  });
@@ -1413,7 +1413,7 @@
1413
1413
  };
1414
1414
  exports.defaultStartLoadingFunction = defaultStartLoadingFunction;
1415
1415
  });
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_3, defaultAjaxErrorFunction_1, defaultAjaxAbortFunction_1, _addLoader_1, defaultStartLoadingFunction_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) {
1417
1417
  "use strict";
1418
1418
  Object.defineProperty(exports, "__esModule", { value: true });
1419
1419
  exports.ajax = void 0;
@@ -1480,7 +1480,7 @@
1480
1480
  (0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, res);
1481
1481
  switch (res.status) {
1482
1482
  case 200:
1483
- if ((0, isFunction_3.isFunction)(success)) {
1483
+ if ((0, isFunction_2.isFunction)(success)) {
1484
1484
  success(res.data, res.headers);
1485
1485
  }
1486
1486
  break;
@@ -1495,7 +1495,7 @@
1495
1495
  (0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, err);
1496
1496
  if (isAbort) {
1497
1497
  let ok = 1;
1498
- if ((0, isFunction_3.isFunction)(abort)) {
1498
+ if ((0, isFunction_2.isFunction)(abort)) {
1499
1499
  ok = abort(err.message, url);
1500
1500
  }
1501
1501
  if (ok) {
@@ -1504,7 +1504,7 @@
1504
1504
  }
1505
1505
  else {
1506
1506
  let ok = 1;
1507
- if ((0, isFunction_3.isFunction)(failure)) {
1507
+ if ((0, isFunction_2.isFunction)(failure)) {
1508
1508
  ok = failure(err.request, err);
1509
1509
  }
1510
1510
  if (ok) {
@@ -1905,7 +1905,7 @@
1905
1905
  };
1906
1906
  exports.defaultAlertFunction = defaultAlertFunction;
1907
1907
  });
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_4, log_7, defaultPostLinkFunction_1, defaultAlertFunction_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) {
1909
1909
  "use strict";
1910
1910
  Object.defineProperty(exports, "__esModule", { value: true });
1911
1911
  exports.callback = void 0;
@@ -1952,13 +1952,13 @@
1952
1952
  let r = null;
1953
1953
  try {
1954
1954
  r = eval(res.script);
1955
- if ((0, isFunction_4.isFunction)(r)) {
1955
+ if ((0, isFunction_3.isFunction)(r)) {
1956
1956
  r = r(data, ele);
1957
1957
  }
1958
1958
  }
1959
1959
  catch (e) {
1960
1960
  (0, log_7.log)(e, res);
1961
- (0, error_1.error)((0, isFunction_4.isFunction)(e.getMessage) ? e.getMessage() : null);
1961
+ (0, error_1.error)((0, isFunction_3.isFunction)(e.getMessage) ? e.getMessage() : null);
1962
1962
  }
1963
1963
  return r;
1964
1964
  })(res.data ? res.data : {}, ele ? ele : false);
@@ -2137,7 +2137,7 @@
2137
2137
  };
2138
2138
  exports.correctCase = correctCase;
2139
2139
  });
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_5, isString_8, correctCase_1, error_2, log_8) {
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) {
2141
2141
  "use strict";
2142
2142
  Object.defineProperty(exports, "__esModule", { value: true });
2143
2143
  exports.checkType = void 0;
@@ -2166,14 +2166,14 @@
2166
2166
  else if (t === Function) {
2167
2167
  t = 'function';
2168
2168
  }
2169
- if ((0, isFunction_5.isFunction)(t)) {
2169
+ if ((0, isFunction_4.isFunction)(t)) {
2170
2170
  typesList.push(t.name || t.constructor?.name || t.toString());
2171
2171
  if (value instanceof t) {
2172
2172
  ok = true;
2173
2173
  return false;
2174
2174
  }
2175
2175
  }
2176
- else if (!(0, isString_8.isString)(t) || !(0, isFunction_5.isFunction)(bbn.fn['is' + (0, correctCase_1.correctCase)(t)])) {
2176
+ else if (!(0, isString_8.isString)(t) || !(0, isFunction_4.isFunction)(bbn.fn['is' + (0, correctCase_1.correctCase)(t)])) {
2177
2177
  (0, error_2.error)(`The type ${t} is not recognized`);
2178
2178
  }
2179
2179
  else if (bbn.fn['is' + (0, correctCase_1.correctCase)(t)](value)) {
@@ -2223,7 +2223,7 @@
2223
2223
  };
2224
2224
  exports.colorToHex = colorToHex;
2225
2225
  });
2226
- define("fn/copy", ["require", "exports", "fn/isObject", "fn/isFunction"], function (require, exports, isObject_11, isFunction_6) {
2226
+ define("fn/copy", ["require", "exports", "fn/isObject", "fn/isFunction"], function (require, exports, isObject_11, isFunction_5) {
2227
2227
  "use strict";
2228
2228
  Object.defineProperty(exports, "__esModule", { value: true });
2229
2229
  exports.copy = void 0;
@@ -2236,7 +2236,7 @@
2236
2236
  resolve(true);
2237
2237
  });
2238
2238
  }
2239
- else if ((0, isObject_11.isObject)(st) && (0, isFunction_6.isFunction)(st.toBlob)) {
2239
+ else if ((0, isObject_11.isObject)(st) && (0, isFunction_5.isFunction)(st.toBlob)) {
2240
2240
  st.toBlob((blob) => {
2241
2241
  navigator.clipboard.write([new ClipboardItem({ [blob.type.toString()]: blob })]).then(() => {
2242
2242
  resolve(true);
@@ -2391,19 +2391,19 @@
2391
2391
  };
2392
2392
  exports.deepPath = deepPath;
2393
2393
  });
2394
- define("fn/defaultConfirmFunction", ["require", "exports", "fn/isFunction"], function (require, exports, isFunction_7) {
2394
+ define("fn/defaultConfirmFunction", ["require", "exports", "fn/isFunction"], function (require, exports, isFunction_6) {
2395
2395
  "use strict";
2396
2396
  Object.defineProperty(exports, "__esModule", { value: true });
2397
2397
  exports.defaultConfirmFunction = void 0;
2398
2398
  const defaultConfirmFunction = function (text, yesFn, noFn) {
2399
2399
  let ok = 0;
2400
2400
  if (confirm(text)) {
2401
- if ((0, isFunction_7.isFunction)(yesFn)) {
2401
+ if ((0, isFunction_6.isFunction)(yesFn)) {
2402
2402
  yesFn();
2403
2403
  ok = 1;
2404
2404
  }
2405
2405
  }
2406
- if (!ok && (0, isFunction_7.isFunction)(noFn)) {
2406
+ if (!ok && (0, isFunction_6.isFunction)(noFn)) {
2407
2407
  noFn();
2408
2408
  }
2409
2409
  };
@@ -2472,7 +2472,7 @@
2472
2472
  };
2473
2473
  exports.isValue = isValue;
2474
2474
  });
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_8, isValue_1, isDom_4, numProperties_5) {
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) {
2476
2476
  "use strict";
2477
2477
  Object.defineProperty(exports, "__esModule", { value: true });
2478
2478
  exports.diffObj = void 0;
@@ -2500,7 +2500,7 @@
2500
2500
  notRoot = false;
2501
2501
  }
2502
2502
  let diff = (0, createObject_1.createObject)();
2503
- if (!(0, isFunction_8.isFunction)(obj1) && !(0, isFunction_8.isFunction)(obj2)) {
2503
+ if (!(0, isFunction_7.isFunction)(obj1) && !(0, isFunction_7.isFunction)(obj2)) {
2504
2504
  if ((0, isValue_1.isValue)(obj1) || (0, isValue_1.isValue)(obj2)) {
2505
2505
  let res = _compareValues(obj1, obj2);
2506
2506
  if (unchanged || res !== VALUE_UNCHANGED) {
@@ -2536,7 +2536,7 @@
2536
2536
  }
2537
2537
  diffObjProcessed.push(obj1, obj2);
2538
2538
  for (let key in obj1) {
2539
- if ((0, isFunction_8.isFunction)(obj1[key])) {
2539
+ if ((0, isFunction_7.isFunction)(obj1[key])) {
2540
2540
  continue;
2541
2541
  }
2542
2542
  let value2 = undefined;
@@ -2549,7 +2549,7 @@
2549
2549
  }
2550
2550
  }
2551
2551
  for (let key in obj2) {
2552
- if ((0, isFunction_8.isFunction)(obj2[key]) || 'undefined' != typeof obj1[key]) {
2552
+ if ((0, isFunction_7.isFunction)(obj2[key]) || 'undefined' != typeof obj1[key]) {
2553
2553
  continue;
2554
2554
  }
2555
2555
  let res = diffObj(undefined, obj2[key], unchanged, true);
@@ -3662,7 +3662,7 @@
3662
3662
  };
3663
3663
  exports.info = info;
3664
3664
  });
3665
- define("fn/treatAjaxArguments", ["require", "exports", "fn/isObject", "fn/isFunction", "fn/substr", "fn/numProperties"], function (require, exports, isObject_14, isFunction_9, substr_9, numProperties_6) {
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) {
3666
3666
  "use strict";
3667
3667
  Object.defineProperty(exports, "__esModule", { value: true });
3668
3668
  exports.treatAjaxArguments = void 0;
@@ -3677,7 +3677,7 @@
3677
3677
  t = typeof args[i];
3678
3678
  t = t.toLowerCase();
3679
3679
  /* Callbacks */
3680
- if ((0, isFunction_9.isFunction)(args[i])) {
3680
+ if ((0, isFunction_8.isFunction)(args[i])) {
3681
3681
  if (cfg.errorFn && !cfg.abortFn) {
3682
3682
  cfg.abortFn = args[i];
3683
3683
  }
@@ -4017,7 +4017,7 @@
4017
4017
  };
4018
4018
  exports.isMobile = isMobile;
4019
4019
  });
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_10, log_15) {
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) {
4021
4021
  "use strict";
4022
4022
  Object.defineProperty(exports, "__esModule", { value: true });
4023
4023
  exports.init = void 0;
@@ -4161,7 +4161,7 @@
4161
4161
  //link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
4162
4162
  (0, link_1.link)(state.url, (0, extend_6.extend)({ title: state.title || bbn.env.siteTitle }, state.data || {}));
4163
4163
  }
4164
- else if (state && state.data && (0, isFunction_10.isFunction)(state.data.script)) {
4164
+ else if (state && state.data && (0, isFunction_9.isFunction)(state.data.script)) {
4165
4165
  state.data.script();
4166
4166
  }
4167
4167
  }
@@ -4600,7 +4600,7 @@
4600
4600
  };
4601
4601
  exports.warning = warning;
4602
4602
  });
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_11, isSame_2) {
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) {
4604
4604
  "use strict";
4605
4605
  Object.defineProperty(exports, "__esModule", { value: true });
4606
4606
  exports.makeReactive = void 0;
@@ -4641,7 +4641,7 @@
4641
4641
  return res;
4642
4642
  };
4643
4643
  }
4644
- if ((0, isFunction_11.isFunction)(realValue)) {
4644
+ if ((0, isFunction_10.isFunction)(realValue)) {
4645
4645
  return realValue;
4646
4646
  }
4647
4647
  if (key === '__bbnRoot') {
@@ -5818,7 +5818,7 @@
5818
5818
  };
5819
5819
  exports.upload = upload;
5820
5820
  });
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_12, 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
+ 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) {
5822
5822
  "use strict";
5823
5823
  Object.defineProperty(exports, "__esModule", { value: true });
5824
5824
  exports.bbn = void 0;
@@ -6125,7 +6125,7 @@
6125
6125
  isEmpty: isEmpty_2.isEmpty,
6126
6126
  isEvent: isEvent_1.isEvent,
6127
6127
  isFocused: isFocused_1.isFocused,
6128
- isFunction: isFunction_12.isFunction,
6128
+ isFunction: isFunction_11.isFunction,
6129
6129
  isHostname: isHostname_1.isHostname,
6130
6130
  isInside: isInside_1.isInside,
6131
6131
  isInt: isInt_2.isInt,
package/dist/fn/filter.js CHANGED
@@ -1,5 +1,4 @@
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';
@@ -10,7 +9,7 @@ const filter = function (arr, prop, val = null, operator = '=') {
10
9
  }
11
10
  let cfg = {};
12
11
  const res = [];
13
- const isFn = isFunction(prop);
12
+ const isFn = typeof (prop) === 'function';
14
13
  if (!prop || !arr.length) {
15
14
  return arr;
16
15
  }
@@ -25,9 +24,9 @@ const filter = function (arr, prop, val = null, operator = '=') {
25
24
  else if (!isFn) {
26
25
  throw new Error('Search function error: The prop argument should be a string or an object');
27
26
  }
28
- if (isFn) {
27
+ if (typeof (prop) === 'function') {
29
28
  each(arr, (a, i) => {
30
- if (filter(a, prop)) {
29
+ if (prop(a, i)) {
31
30
  res.push(a);
32
31
  }
33
32
  });
@@ -36,7 +35,7 @@ const filter = function (arr, prop, val = null, operator = '=') {
36
35
  cfg = filterToConditions(cfg, operator);
37
36
  if (cfg.conditions && cfg.logic) {
38
37
  each(arr, (a) => {
39
- if (compareConditions(a, filter)) {
38
+ if (compareConditions(a, cfg)) {
40
39
  res.push(a);
41
40
  }
42
41
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",