@bbn/bbn 1.0.28 → 1.0.29

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.
Files changed (231) hide show
  1. package/dist/bundle.d.ts +6 -6
  2. package/dist/fn/_addLoader.js +3 -6
  3. package/dist/fn/_compareValues.js +11 -14
  4. package/dist/fn/_deleteLoader.js +7 -10
  5. package/dist/fn/abort.js +3 -6
  6. package/dist/fn/abortURL.js +4 -7
  7. package/dist/fn/addColors.js +5 -8
  8. package/dist/fn/addInputs.js +3 -6
  9. package/dist/fn/addStyle.js +5 -8
  10. package/dist/fn/adjustHeight.js +5 -8
  11. package/dist/fn/adjustSize.js +5 -8
  12. package/dist/fn/adjustWidth.js +5 -8
  13. package/dist/fn/ajax.js +31 -34
  14. package/dist/fn/analyzeFunction.js +3 -6
  15. package/dist/fn/animateCss.js +1 -4
  16. package/dist/fn/arrayBuffer2String.js +1 -4
  17. package/dist/fn/arrayFromProp.js +5 -8
  18. package/dist/fn/autoExtend.js +4 -7
  19. package/dist/fn/baseName.js +6 -9
  20. package/dist/fn/br2nl.js +3 -6
  21. package/dist/fn/calendar.js +14 -20
  22. package/dist/fn/callback.js +16 -19
  23. package/dist/fn/camelToCss.js +1 -4
  24. package/dist/fn/camelize.js +1 -4
  25. package/dist/fn/canvasToImage.js +1 -4
  26. package/dist/fn/center.js +1 -4
  27. package/dist/fn/checkProps.js +3 -6
  28. package/dist/fn/checkPropsDetails.js +9 -12
  29. package/dist/fn/checkPropsOrDie.js +3 -6
  30. package/dist/fn/checkType.js +16 -19
  31. package/dist/fn/chrono.js +3 -7
  32. package/dist/fn/circularReplacer.js +7 -10
  33. package/dist/fn/clone.js +7 -10
  34. package/dist/fn/colorToHex.js +1 -4
  35. package/dist/fn/compare.js +18 -21
  36. package/dist/fn/compareConditions.js +10 -13
  37. package/dist/fn/copy.js +4 -7
  38. package/dist/fn/correctCase.js +1 -4
  39. package/dist/fn/count.js +3 -6
  40. package/dist/fn/crc32.js +1 -4
  41. package/dist/fn/createObject.js +3 -6
  42. package/dist/fn/cssExists.js +3 -6
  43. package/dist/fn/date.js +8 -11
  44. package/dist/fn/dateSQL.js +5 -11
  45. package/dist/fn/daysInMonth.js +5 -11
  46. package/dist/fn/deepPath.js +7 -10
  47. package/dist/fn/defaultAjaxAbortFunction.js +3 -6
  48. package/dist/fn/defaultAjaxErrorFunction.js +1 -4
  49. package/dist/fn/defaultAlertFunction.js +1 -4
  50. package/dist/fn/defaultConfirmFunction.js +4 -7
  51. package/dist/fn/defaultEndLoadingFunction.js +1 -4
  52. package/dist/fn/defaultErrorFunction.js +3 -6
  53. package/dist/fn/defaultHistoryFunction.js +1 -4
  54. package/dist/fn/defaultLinkFunction.js +1 -4
  55. package/dist/fn/defaultPostLinkFunction.js +1 -4
  56. package/dist/fn/defaultPreLinkFunction.js +1 -4
  57. package/dist/fn/defaultResizeFunction.js +1 -4
  58. package/dist/fn/defaultStartLoadingFunction.js +1 -4
  59. package/dist/fn/deleteProp.js +4 -7
  60. package/dist/fn/diffObj.js +16 -19
  61. package/dist/fn/dirName.js +7 -10
  62. package/dist/fn/download.js +15 -18
  63. package/dist/fn/downloadContent.js +9 -12
  64. package/dist/fn/each.js +7 -10
  65. package/dist/fn/eraseCookie.js +1 -4
  66. package/dist/fn/error.js +3 -6
  67. package/dist/fn/escapeDquotes.js +3 -6
  68. package/dist/fn/escapeRegExp.js +1 -4
  69. package/dist/fn/escapeSquotes.js +3 -6
  70. package/dist/fn/escapeTicks.js +3 -6
  71. package/dist/fn/escapeUrl.js +8 -11
  72. package/dist/fn/extend.js +13 -16
  73. package/dist/fn/extendOut.js +4 -7
  74. package/dist/fn/fdate.js +12 -18
  75. package/dist/fn/fdatetime.js +10 -16
  76. package/dist/fn/fieldValue.js +1 -4
  77. package/dist/fn/fileExt.js +3 -6
  78. package/dist/fn/filter.js +12 -15
  79. package/dist/fn/filterToConditions.js +8 -11
  80. package/dist/fn/findAll.js +7 -10
  81. package/dist/fn/fori.js +6 -9
  82. package/dist/fn/forir.js +6 -9
  83. package/dist/fn/format.js +3 -6
  84. package/dist/fn/formatBytes.js +1 -4
  85. package/dist/fn/formatDate.js +3 -9
  86. package/dist/fn/formatSize.js +5 -8
  87. package/dist/fn/formdata.js +11 -14
  88. package/dist/fn/fromXml.js +1 -4
  89. package/dist/fn/ftime.js +12 -18
  90. package/dist/fn/getAllTags.js +3 -6
  91. package/dist/fn/getAncestors.js +1 -4
  92. package/dist/fn/getAttributes.js +3 -6
  93. package/dist/fn/getBrowserName.js +1 -4
  94. package/dist/fn/getBrowserVersion.js +1 -4
  95. package/dist/fn/getCookie.js +1 -4
  96. package/dist/fn/getCssVar.js +1 -4
  97. package/dist/fn/getDay.js +3 -6
  98. package/dist/fn/getDeviceType.js +1 -4
  99. package/dist/fn/getEventData.js +7 -10
  100. package/dist/fn/getField.js +3 -6
  101. package/dist/fn/getFieldValues.js +7 -10
  102. package/dist/fn/getHTMLOfSelection.js +4 -7
  103. package/dist/fn/getHtml.js +3 -6
  104. package/dist/fn/getLoader.js +3 -6
  105. package/dist/fn/getPath.js +3 -6
  106. package/dist/fn/getProp.js +4 -7
  107. package/dist/fn/getProperty.js +1 -4
  108. package/dist/fn/getRequestId.js +5 -8
  109. package/dist/fn/getRow.js +3 -6
  110. package/dist/fn/getScrollBarSize.js +1 -4
  111. package/dist/fn/getText.js +1 -4
  112. package/dist/fn/getTimeoff.js +1 -4
  113. package/dist/fn/happy.js +3 -6
  114. package/dist/fn/hash.js +11 -14
  115. package/dist/fn/hex2rgb.js +1 -4
  116. package/dist/fn/history.js +1 -4
  117. package/dist/fn/html2text.js +1 -4
  118. package/dist/fn/imageToCanvas.js +1 -4
  119. package/dist/fn/imgToBase64.js +3 -6
  120. package/dist/fn/info.js +3 -6
  121. package/dist/fn/init.js +32 -58
  122. package/dist/fn/isActiveInterface.js +1 -4
  123. package/dist/fn/isArray.js +1 -4
  124. package/dist/fn/isBlob.js +1 -4
  125. package/dist/fn/isBoolean.js +1 -4
  126. package/dist/fn/isCanvas.js +1 -4
  127. package/dist/fn/isColor.js +3 -6
  128. package/dist/fn/isComment.js +1 -4
  129. package/dist/fn/isCp.js +3 -6
  130. package/dist/fn/isDate.js +1 -4
  131. package/dist/fn/isDesktopDevice.js +1 -4
  132. package/dist/fn/isDimension.js +3 -6
  133. package/dist/fn/isDom.js +1 -4
  134. package/dist/fn/isEmail.js +3 -6
  135. package/dist/fn/isEmpty.js +5 -8
  136. package/dist/fn/isEvent.js +1 -4
  137. package/dist/fn/isFocused.js +1 -4
  138. package/dist/fn/isFunction.js +1 -4
  139. package/dist/fn/isHostname.js +5 -8
  140. package/dist/fn/isIP.js +3 -6
  141. package/dist/fn/isInside.js +7 -10
  142. package/dist/fn/isInt.js +1 -4
  143. package/dist/fn/isIterable.js +1 -4
  144. package/dist/fn/isMobile.js +4 -7
  145. package/dist/fn/isMobileDevice.js +1 -4
  146. package/dist/fn/isNull.js +1 -4
  147. package/dist/fn/isNumber.js +1 -4
  148. package/dist/fn/isObject.js +1 -4
  149. package/dist/fn/isPercent.js +1 -4
  150. package/dist/fn/isPrimitive.js +1 -4
  151. package/dist/fn/isPromise.js +1 -4
  152. package/dist/fn/isPropSize.js +3 -6
  153. package/dist/fn/isSQLDate.js +1 -4
  154. package/dist/fn/isSame.js +5 -8
  155. package/dist/fn/isString.js +1 -4
  156. package/dist/fn/isSymbol.js +1 -4
  157. package/dist/fn/isTabletDevice.js +1 -4
  158. package/dist/fn/isURL.js +1 -4
  159. package/dist/fn/isValidDimension.js +4 -7
  160. package/dist/fn/isValidName.js +3 -6
  161. package/dist/fn/isValue.js +3 -6
  162. package/dist/fn/isVue.js +1 -4
  163. package/dist/fn/iterate.js +5 -8
  164. package/dist/fn/lightenDarkenHex.js +1 -4
  165. package/dist/fn/link.js +19 -22
  166. package/dist/fn/log.js +3 -6
  167. package/dist/fn/makeReactive.js +28 -31
  168. package/dist/fn/map.js +3 -6
  169. package/dist/fn/md5.js +1 -4
  170. package/dist/fn/money.js +3 -6
  171. package/dist/fn/move.js +1 -4
  172. package/dist/fn/multiorder.js +3 -6
  173. package/dist/fn/nl2br.js +3 -6
  174. package/dist/fn/numProperties.js +1 -4
  175. package/dist/fn/objectToFormData.js +12 -15
  176. package/dist/fn/order.js +3 -6
  177. package/dist/fn/outerHeight.js +3 -6
  178. package/dist/fn/outerWidth.js +3 -6
  179. package/dist/fn/percent.js +1 -4
  180. package/dist/fn/pickValue.js +1 -4
  181. package/dist/fn/post.js +7 -10
  182. package/dist/fn/postOut.js +5 -8
  183. package/dist/fn/printf.js +1 -4
  184. package/dist/fn/quotes2html.js +4 -7
  185. package/dist/fn/randomInt.js +1 -4
  186. package/dist/fn/randomString.js +4 -7
  187. package/dist/fn/removeAccents.js +5 -8
  188. package/dist/fn/removeEmpty.js +8 -11
  189. package/dist/fn/removeExtraSpaces.js +1 -4
  190. package/dist/fn/removeHtmlComments.js +3 -6
  191. package/dist/fn/removePrivateProp.js +3 -6
  192. package/dist/fn/removeTrailingChars.js +6 -9
  193. package/dist/fn/repeat.js +1 -4
  194. package/dist/fn/replaceAll.js +4 -7
  195. package/dist/fn/replaceSelection.js +1 -4
  196. package/dist/fn/resize.js +7 -10
  197. package/dist/fn/rgb2hex.js +1 -4
  198. package/dist/fn/riterate.js +3 -6
  199. package/dist/fn/roundDecimal.js +1 -4
  200. package/dist/fn/sanitize.js +5 -8
  201. package/dist/fn/search.js +15 -18
  202. package/dist/fn/selectElementText.js +1 -4
  203. package/dist/fn/selector.js +1 -4
  204. package/dist/fn/setCookie.js +1 -4
  205. package/dist/fn/setCssVar.js +1 -4
  206. package/dist/fn/setNavigationVars.js +10 -13
  207. package/dist/fn/setProp.js +1 -4
  208. package/dist/fn/setProperty.js +3 -6
  209. package/dist/fn/shorten.js +5 -8
  210. package/dist/fn/shortenObj.js +9 -12
  211. package/dist/fn/shuffle.js +1 -4
  212. package/dist/fn/simpleHash.js +5 -8
  213. package/dist/fn/simpleHash1.js +1 -4
  214. package/dist/fn/simpleHash2.js +1 -4
  215. package/dist/fn/stat.js +1 -4
  216. package/dist/fn/string2ArrayBuffer.js +1 -4
  217. package/dist/fn/submit.js +6 -9
  218. package/dist/fn/substr.js +7 -10
  219. package/dist/fn/sum.js +4 -7
  220. package/dist/fn/timestamp.js +1 -4
  221. package/dist/fn/toCSV.js +8 -11
  222. package/dist/fn/toggleFullScreen.js +3 -6
  223. package/dist/fn/translate.js +3 -6
  224. package/dist/fn/treatAjaxArguments.js +10 -13
  225. package/dist/fn/trim.js +4 -7
  226. package/dist/fn/uniqString.js +7 -10
  227. package/dist/fn/unique.js +1 -4
  228. package/dist/fn/upload.js +7 -33
  229. package/dist/fn/warning.js +3 -6
  230. package/dist/index.js +459 -471
  231. package/package.json +1 -1
package/dist/fn/date.js CHANGED
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.date = void 0;
4
- const isNumber_1 = require("./isNumber");
5
- const substr_1 = require("./substr");
6
- const isDate_1 = require("./isDate");
1
+ import { isNumber } from './isNumber';
2
+ import { substr } from './substr';
3
+ import { isDate } from './isDate';
7
4
  const date = function (v) {
8
5
  let d = false, t = typeof v;
9
6
  if (v === undefined) {
10
7
  return new Date();
11
8
  }
12
- if (t === 'number' || ((0, isNumber_1.isNumber)(v) && v !== '')) {
9
+ if (t === 'number' || (isNumber(v) && v !== '')) {
13
10
  if (v < 10000000000) {
14
11
  v = v * 1000;
15
12
  }
@@ -17,15 +14,15 @@ const date = function (v) {
17
14
  }
18
15
  if (t === 'string') {
19
16
  if (v.length === 10) {
20
- return new Date(parseInt((0, substr_1.substr)(v, 0, 4)), parseInt((0, substr_1.substr)(v, 5, 2)) - 1, parseInt((0, substr_1.substr)(v, 8, 2)), 12);
17
+ return new Date(parseInt(substr(v, 0, 4)), parseInt(substr(v, 5, 2)) - 1, parseInt(substr(v, 8, 2)), 12);
21
18
  }
22
19
  else if (v.length === 19) {
23
- return new Date(parseInt((0, substr_1.substr)(v, 0, 4)), parseInt((0, substr_1.substr)(v, 5, 2)) - 1, parseInt((0, substr_1.substr)(v, 8, 2)), parseInt((0, substr_1.substr)(v, 11, 2)), parseInt((0, substr_1.substr)(v, 14, 2)), parseInt((0, substr_1.substr)(v, 17, 2)));
20
+ return new Date(parseInt(substr(v, 0, 4)), parseInt(substr(v, 5, 2)) - 1, parseInt(substr(v, 8, 2)), parseInt(substr(v, 11, 2)), parseInt(substr(v, 14, 2)), parseInt(substr(v, 17, 2)));
24
21
  }
25
22
  }
26
- else if ((0, isDate_1.isDate)(v)) {
23
+ else if (isDate(v)) {
27
24
  return v;
28
25
  }
29
26
  return d;
30
27
  };
31
- exports.date = date;
28
+ export { date };
@@ -1,15 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.dateSQL = void 0;
7
- const date_1 = require("./date");
8
- const dayjs_1 = __importDefault(require("dayjs"));
1
+ import { date } from './date';
2
+ import * as dayjs from 'dayjs';
9
3
  const dateSQL = function (v, dayOnly) {
10
- let value = (0, date_1.date)(v);
4
+ let value = date(v);
11
5
  if (value) {
12
- return (0, dayjs_1.default)(value).format('YYYY-MM-DD' + (dayOnly ? '' : ' HH:mm:ss'));
6
+ return dayjs(value).format('YYYY-MM-DD' + (dayOnly ? '' : ' HH:mm:ss'));
13
7
  }
14
8
  };
15
- exports.dateSQL = dateSQL;
9
+ export { dateSQL };
@@ -1,16 +1,10 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.daysInMonth = void 0;
7
- const date_1 = require("./date");
8
- const dayjs_1 = __importDefault(require("dayjs"));
1
+ import { date } from './date';
2
+ import * as dayjs from 'dayjs';
9
3
  const daysInMonth = function (v) {
10
- let d = (0, date_1.date)(v);
4
+ let d = date(v);
11
5
  if (d) {
12
- return (0, dayjs_1.default)(d).daysInMonth();
6
+ return dayjs(d).daysInMonth();
13
7
  }
14
8
  return false;
15
9
  };
16
- exports.daysInMonth = daysInMonth;
10
+ export { daysInMonth };
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deepPath = void 0;
4
- const search_1 = require("./search");
5
- const each_1 = require("./each");
6
- const isArray_1 = require("./isArray");
1
+ import { search } from './search';
2
+ import { each } from './each';
3
+ import { isArray } from './isArray';
7
4
  const deepPath = function (arr, filter, deepProperty, res = []) {
8
5
  let idx;
9
6
  let start = 0;
10
- if ((idx = (0, search_1.search)(arr, filter, start)) > -1) {
7
+ if ((idx = search(arr, filter, start)) > -1) {
11
8
  res.push(idx);
12
9
  return res;
13
10
  }
14
- (0, each_1.each)(arr, (it, i) => {
15
- if ((0, isArray_1.isArray)(it[deepProperty])) {
11
+ each(arr, (it, i) => {
12
+ if (isArray(it[deepProperty])) {
16
13
  let r = res.slice();
17
14
  r.push(i);
18
15
  let tmp = deepPath(it[deepProperty], filter, deepProperty, r);
@@ -23,4 +20,4 @@ const deepPath = function (arr, filter, deepProperty, res = []) {
23
20
  });
24
21
  return false;
25
22
  };
26
- exports.deepPath = deepPath;
23
+ export { deepPath };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultAjaxAbortFunction = void 0;
4
- const log_1 = require("./log");
1
+ import { log } from './log';
5
2
  const defaultAjaxAbortFunction = function (message, url = '') {
6
- (0, log_1.log)(message);
3
+ log(message);
7
4
  };
8
- exports.defaultAjaxAbortFunction = defaultAjaxAbortFunction;
5
+ export { defaultAjaxAbortFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultAjaxErrorFunction = void 0;
4
1
  const defaultAjaxErrorFunction = function (jqXHR, textStatus, errorThrown) {
5
2
  return false;
6
3
  };
7
- exports.defaultAjaxErrorFunction = defaultAjaxErrorFunction;
4
+ export { defaultAjaxErrorFunction };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultAlertFunction = void 0;
4
1
  const defaultAlertFunction = function (msg, title) {
5
2
  /** @todo */
6
3
  alert(msg);
7
4
  };
8
- exports.defaultAlertFunction = defaultAlertFunction;
5
+ export { defaultAlertFunction };
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultConfirmFunction = void 0;
4
- const isFunction_1 = require("./isFunction");
1
+ import { isFunction } from './isFunction';
5
2
  const defaultConfirmFunction = function (text, yesFn, noFn) {
6
3
  let ok = 0;
7
4
  if (confirm(text)) {
8
- if ((0, isFunction_1.isFunction)(yesFn)) {
5
+ if (isFunction(yesFn)) {
9
6
  yesFn();
10
7
  ok = 1;
11
8
  }
12
9
  }
13
- if (!ok && (0, isFunction_1.isFunction)(noFn)) {
10
+ if (!ok && isFunction(noFn)) {
14
11
  noFn();
15
12
  }
16
13
  };
17
- exports.defaultConfirmFunction = defaultConfirmFunction;
14
+ export { defaultConfirmFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultEndLoadingFunction = void 0;
4
1
  const defaultEndLoadingFunction = function (url, timestamp, data, res) {
5
2
  return true;
6
3
  };
7
- exports.defaultEndLoadingFunction = defaultEndLoadingFunction;
4
+ export { defaultEndLoadingFunction };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultErrorFunction = void 0;
4
- const log_1 = require("./log");
1
+ import { log } from './log';
5
2
  const defaultErrorFunction = function (message) {
6
- (0, log_1.log)(message);
3
+ log(message);
7
4
  };
8
- exports.defaultErrorFunction = defaultErrorFunction;
5
+ export { defaultErrorFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultHistoryFunction = void 0;
4
1
  const defaultHistoryFunction = function (obj) {
5
2
  return true;
6
3
  };
7
- exports.defaultHistoryFunction = defaultHistoryFunction;
4
+ export { defaultHistoryFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultLinkFunction = void 0;
4
1
  const defaultLinkFunction = function (responseObj, ele) {
5
2
  return true;
6
3
  };
7
- exports.defaultLinkFunction = defaultLinkFunction;
4
+ export { defaultLinkFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultPostLinkFunction = void 0;
4
1
  const defaultPostLinkFunction = function (r, ele) {
5
2
  return true;
6
3
  };
7
- exports.defaultPostLinkFunction = defaultPostLinkFunction;
4
+ export { defaultPostLinkFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultPreLinkFunction = void 0;
4
1
  const defaultPreLinkFunction = function (url, force, ele) {
5
2
  return url;
6
3
  };
7
- exports.defaultPreLinkFunction = defaultPreLinkFunction;
4
+ export { defaultPreLinkFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultResizeFunction = void 0;
4
1
  const defaultResizeFunction = function () {
5
2
  return true;
6
3
  };
7
- exports.defaultResizeFunction = defaultResizeFunction;
4
+ export { defaultResizeFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultStartLoadingFunction = void 0;
4
1
  const defaultStartLoadingFunction = function (url, tst, data, requestId = null) {
5
2
  return true;
6
3
  };
7
- exports.defaultStartLoadingFunction = defaultStartLoadingFunction;
4
+ export { defaultStartLoadingFunction };
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteProp = void 0;
4
- const checkType_1 = require("./checkType");
1
+ import { checkType } from './checkType';
5
2
  const deleteProp = function (obj, prop) {
6
- (0, checkType_1.checkType)(obj, 'object', bbn._('The obj must be an object in setProp'));
7
- (0, checkType_1.checkType)(prop, 'string', bbn._('The prop must be a string in setProp'));
3
+ checkType(obj, 'object', bbn._('The obj must be an object in setProp'));
4
+ checkType(prop, 'string', bbn._('The prop must be a string in setProp'));
8
5
  delete obj[prop];
9
6
  };
10
- exports.deleteProp = deleteProp;
7
+ export { deleteProp };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.diffObj = void 0;
4
- const isDate_1 = require("./isDate");
5
- const createObject_1 = require("./createObject");
6
- const isFunction_1 = require("./isFunction");
7
- const isValue_1 = require("./isValue");
8
- const isDom_1 = require("./isDom");
9
- const numProperties_1 = require("./numProperties");
1
+ import { isDate } from './isDate';
2
+ import { createObject } from './createObject';
3
+ import { isFunction } from './isFunction';
4
+ import { isValue } from './isValue';
5
+ import { isDom } from './isDom';
6
+ import { numProperties } from './numProperties';
10
7
  let diffObjProcessed = [];
11
8
  const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
12
9
  if (!notRoot) {
@@ -16,7 +13,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
16
13
  if (value1 === value2) {
17
14
  return VALUE_UNCHANGED;
18
15
  }
19
- if ((0, isDate_1.isDate)(value1) && (0, isDate_1.isDate)(value2) && value1.getTime() === value2.getTime()) {
16
+ if (isDate(value1) && isDate(value2) && value1.getTime() === value2.getTime()) {
20
17
  return VALUE_UNCHANGED;
21
18
  }
22
19
  if ('undefined' == typeof value1) {
@@ -30,12 +27,12 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
30
27
  if (notRoot === undefined) {
31
28
  notRoot = false;
32
29
  }
33
- let diff = (0, createObject_1.createObject)();
34
- if (!(0, isFunction_1.isFunction)(obj1) && !(0, isFunction_1.isFunction)(obj2)) {
35
- if ((0, isValue_1.isValue)(obj1) || (0, isValue_1.isValue)(obj2)) {
30
+ let diff = createObject();
31
+ if (!isFunction(obj1) && !isFunction(obj2)) {
32
+ if (isValue(obj1) || isValue(obj2)) {
36
33
  let res = _compareValues(obj1, obj2);
37
34
  if (unchanged || res !== VALUE_UNCHANGED) {
38
- let ret = (0, createObject_1.createObject)();
35
+ let ret = createObject();
39
36
  Object.defineProperty(ret, 'type', {
40
37
  value: res,
41
38
  enumerable: false,
@@ -58,7 +55,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
58
55
  }
59
56
  return false;
60
57
  }
61
- if ((0, isDom_1.isDom)(obj1) || (0, isDom_1.isDom)(obj2)) {
58
+ if (isDom(obj1) || isDom(obj2)) {
62
59
  return false;
63
60
  }
64
61
  if (diffObjProcessed.includes(obj1) || diffObjProcessed.includes(obj2)) {
@@ -67,7 +64,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
67
64
  }
68
65
  diffObjProcessed.push(obj1, obj2);
69
66
  for (let key in obj1) {
70
- if ((0, isFunction_1.isFunction)(obj1[key])) {
67
+ if (isFunction(obj1[key])) {
71
68
  continue;
72
69
  }
73
70
  let value2 = undefined;
@@ -80,7 +77,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
80
77
  }
81
78
  }
82
79
  for (let key in obj2) {
83
- if ((0, isFunction_1.isFunction)(obj2[key]) || 'undefined' != typeof obj1[key]) {
80
+ if (isFunction(obj2[key]) || 'undefined' != typeof obj1[key]) {
84
81
  continue;
85
82
  }
86
83
  let res = diffObj(undefined, obj2[key], unchanged, true);
@@ -89,6 +86,6 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
89
86
  }
90
87
  }
91
88
  }
92
- return !notRoot || unchanged || (0, numProperties_1.numProperties)(diff) ? diff : false;
89
+ return !notRoot || unchanged || numProperties(diff) ? diff : false;
93
90
  };
94
- exports.diffObj = diffObj;
91
+ export { diffObj };
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dirName = void 0;
4
- const isString_1 = require("./isString");
5
- const substr_1 = require("./substr");
1
+ import { isString } from './isString';
2
+ import { substr } from './substr';
6
3
  const dirName = function (path) {
7
- if ((0, isString_1.isString)(path) && path) {
8
- while ((0, substr_1.substr)(path, path.length - 1) === '/') {
9
- path = (0, substr_1.substr)(path, 0, path.length - 1);
4
+ if (isString(path) && path) {
5
+ while (substr(path, path.length - 1) === '/') {
6
+ path = substr(path, 0, path.length - 1);
10
7
  }
11
8
  let pos = path.lastIndexOf('/');
12
9
  if (pos > 0) {
13
- return (0, substr_1.substr)(path, 0, pos);
10
+ return substr(path, 0, pos);
14
11
  }
15
12
  if (pos === 0) {
16
13
  return '/';
@@ -18,4 +15,4 @@ const dirName = function (path) {
18
15
  }
19
16
  return '';
20
17
  };
21
- exports.dirName = dirName;
18
+ export { dirName };
@@ -1,39 +1,36 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.download = void 0;
4
- const ajax_1 = require("./ajax");
5
- const substr_1 = require("./substr");
6
- const baseName_1 = require("./baseName");
7
- const isBlob_1 = require("./isBlob");
8
- const fileExt_1 = require("./fileExt");
9
- const downloadContent_1 = require("./downloadContent");
10
- const defaultAjaxErrorFunction_1 = require("./defaultAjaxErrorFunction");
1
+ import { ajax } from './ajax';
2
+ import { substr } from './substr';
3
+ import { baseName } from './baseName';
4
+ import { isBlob } from './isBlob';
5
+ import { fileExt } from './fileExt';
6
+ import { downloadContent } from './downloadContent';
7
+ import { defaultAjaxErrorFunction } from './defaultAjaxErrorFunction';
11
8
  const download = function (url, filename, params) {
12
9
  // We can intervert the arguments
13
10
  if (filename && (typeof (filename) === 'object')) {
14
11
  params = filename;
15
12
  filename = null;
16
13
  }
17
- return (0, ajax_1.ajax)(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
14
+ return ajax(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
18
15
  if (!filename) {
19
16
  let cd = 'attachment; filename=';
20
17
  if (headers && headers['content-disposition'] && headers['content-disposition'].indexOf(cd) === 0) {
21
- filename = (0, substr_1.substr)(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
18
+ filename = substr(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
22
19
  }
23
20
  else {
24
- filename = (0, baseName_1.baseName)(url);
21
+ filename = baseName(url);
25
22
  }
26
23
  }
27
- if ((0, isBlob_1.isBlob)(d)) {
28
- let extension = (0, fileExt_1.fileExt)(filename);
24
+ if (isBlob(d)) {
25
+ let extension = fileExt(filename);
29
26
  let htmlExtensions = ['php', 'html'];
30
27
  if ((typeof filename === 'string') && ((('type' in d) && (d.type !== 'text/html')) || htmlExtensions.includes(extension))) {
31
- (0, downloadContent_1.downloadContent)(filename, d);
28
+ downloadContent(filename, d);
32
29
  return;
33
30
  }
34
31
  }
35
32
  }, e => {
36
- (0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(e);
33
+ defaultAjaxErrorFunction(e);
37
34
  });
38
35
  };
39
- exports.download = download;
36
+ export { download };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.downloadContent = void 0;
4
- const isCanvas_1 = require("./isCanvas");
5
- const isObject_1 = require("./isObject");
6
- const isString_1 = require("./isString");
7
- const log_1 = require("./log");
1
+ import { isCanvas } from './isCanvas';
2
+ import { isObject } from './isObject';
3
+ import { isString } from './isString';
4
+ import { log } from './log';
8
5
  const downloadContent = function (filename, content, type) {
9
- if ((0, isCanvas_1.isCanvas)(content)) {
6
+ if (isCanvas(content)) {
10
7
  content.toBlob((blob) => {
11
8
  // blob ready, download it
12
9
  let a = document.createElement('a');
@@ -20,7 +17,7 @@ const downloadContent = function (filename, content, type) {
20
17
  return;
21
18
  }
22
19
  if (!type) {
23
- type = (0, isObject_1.isObject)(content) && content.type ? content.type : 'octet/stream';
20
+ type = isObject(content) && content.type ? content.type : 'octet/stream';
24
21
  }
25
22
  else if (type.indexOf('/') === -1) {
26
23
  type = 'text/' + type;
@@ -28,7 +25,7 @@ const downloadContent = function (filename, content, type) {
28
25
  let a = window.document.createElement('a');
29
26
  a.className = 'bbn-no';
30
27
  let src = null;
31
- if ((0, isString_1.isString)(content)) {
28
+ if (isString(content)) {
32
29
  src = new Blob([content], { type: type });
33
30
  }
34
31
  else {
@@ -36,7 +33,7 @@ const downloadContent = function (filename, content, type) {
36
33
  src = content;
37
34
  }
38
35
  catch (e) {
39
- (0, log_1.log)(e);
36
+ log(e);
40
37
  }
41
38
  }
42
39
  a.href = window.URL.createObjectURL(src);
@@ -48,4 +45,4 @@ const downloadContent = function (filename, content, type) {
48
45
  // Remove anchor from body
49
46
  document.body.removeChild(a);
50
47
  };
51
- exports.downloadContent = downloadContent;
48
+ export { downloadContent };
package/dist/fn/each.js CHANGED
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.each = void 0;
4
- const isNumber_1 = require("./isNumber");
5
- const isIterable_1 = require("./isIterable");
6
- const iterate_1 = require("./iterate");
1
+ import { isNumber } from './isNumber';
2
+ import { isIterable } from './isIterable';
3
+ import { iterate } from './iterate';
7
4
  const each = function (arr, fn) {
8
- if ((0, isNumber_1.isNumber)(arr) && arr > 0) {
5
+ if (isNumber(arr) && arr > 0) {
9
6
  for (let i = 0; i < arr; i++) {
10
7
  if (fn(i, i) === false) {
11
8
  return;
@@ -13,7 +10,7 @@ const each = function (arr, fn) {
13
10
  }
14
11
  return;
15
12
  }
16
- if ((0, isIterable_1.isIterable)(arr)) {
13
+ if (isIterable(arr)) {
17
14
  for (let i = 0; i < arr.length; i++) {
18
15
  if (fn(arr[i], i) === false) {
19
16
  return;
@@ -21,6 +18,6 @@ const each = function (arr, fn) {
21
18
  }
22
19
  return arr;
23
20
  }
24
- return (0, iterate_1.iterate)(arr, fn);
21
+ return iterate(arr, fn);
25
22
  };
26
- exports.each = each;
23
+ export { each };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.eraseCookie = void 0;
4
1
  const eraseCookie = function (name) {
5
2
  document.cookie = name + '=; Max-Age=-99999999;';
6
3
  };
7
- exports.eraseCookie = eraseCookie;
4
+ export { eraseCookie };
package/dist/fn/error.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.error = void 0;
4
- const log_1 = require("./log");
1
+ import { log } from './log';
5
2
  const error = function (errorMsg) {
6
3
  if (arguments.length > 1) {
7
4
  const args = [];
@@ -13,8 +10,8 @@ const error = function (errorMsg) {
13
10
  _bbn_console_level: 1,
14
11
  _bbn_console_style: 'color: #E64141; background: #F7E195; font-size: 14px',
15
12
  });
16
- log_1.log.apply(this, args);
13
+ log.apply(this, args);
17
14
  }
18
15
  throw new Error(errorMsg);
19
16
  };
20
- exports.error = error;
17
+ export { error };
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.escapeDquotes = void 0;
4
- const isString_1 = require("./isString");
1
+ import { isString } from './isString';
5
2
  const escapeDquotes = function (str) {
6
- if (!(0, isString_1.isString)(str)) {
3
+ if (!isString(str)) {
7
4
  return str;
8
5
  }
9
6
  return str.replace(/"/g, '\\"');
10
7
  };
11
- exports.escapeDquotes = escapeDquotes;
8
+ export { escapeDquotes };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.escapeRegExp = void 0;
4
1
  const escapeRegExp = function (str) {
5
2
  return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
6
3
  };
7
- exports.escapeRegExp = escapeRegExp;
4
+ export { escapeRegExp };
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.escapeSquotes = void 0;
4
- const isString_1 = require("./isString");
1
+ import { isString } from './isString';
5
2
  const escapeSquotes = function (str) {
6
- if (!(0, isString_1.isString)(str)) {
3
+ if (!isString(str)) {
7
4
  return str;
8
5
  }
9
6
  return str.replace(/'/g, "\\'");
10
7
  };
11
- exports.escapeSquotes = escapeSquotes;
8
+ export { escapeSquotes };
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.escapeTicks = void 0;
4
- const isString_1 = require("./isString");
1
+ import { isString } from './isString';
5
2
  const escapeTicks = function (str) {
6
- if (!(0, isString_1.isString)(str)) {
3
+ if (!isString(str)) {
7
4
  return str;
8
5
  }
9
6
  return str.replace(/`/g, '\\`');
10
7
  };
11
- exports.escapeTicks = escapeTicks;
8
+ export { escapeTicks };