@bbn/bbn 1.0.15 → 1.0.16

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 (194) hide show
  1. package/dist/bundle.d.ts +32 -32
  2. package/dist/bundle.js +1215 -418
  3. package/dist/fn/_addLoader.js +21 -1
  4. package/dist/fn/abort.js +12 -3
  5. package/dist/fn/addColors.js +11 -3
  6. package/dist/fn/addInputs.js +9 -2
  7. package/dist/fn/addStyle.js +7 -3
  8. package/dist/fn/adjustSize.js +19 -6
  9. package/dist/fn/ajax.js +16 -5
  10. package/dist/fn/analyzeFunction.js +10 -1
  11. package/dist/fn/animateCss.js +8 -2
  12. package/dist/fn/arrayBuffer2String.js +3 -1
  13. package/dist/fn/arrayFromProp.js +7 -1
  14. package/dist/fn/autoExtend.js +2 -0
  15. package/dist/fn/br2nl.js +3 -1
  16. package/dist/fn/calendar.js +8 -1
  17. package/dist/fn/callback.js +4 -2
  18. package/dist/fn/camelToCss.js +7 -1
  19. package/dist/fn/canvasToImage.js +5 -1
  20. package/dist/fn/center.js +12 -1
  21. package/dist/fn/checkProps.js +3 -1
  22. package/dist/fn/checkPropsDetails.js +4 -1
  23. package/dist/fn/clone.js +3 -1
  24. package/dist/fn/colorToHex.js +5 -1
  25. package/dist/fn/compare.js +28 -15
  26. package/dist/fn/compareConditions.js +1 -0
  27. package/dist/fn/copy.js +8 -2
  28. package/dist/fn/correctCase.js +3 -1
  29. package/dist/fn/count.js +3 -1
  30. package/dist/fn/crc32.js +1 -1
  31. package/dist/fn/cssExists.js +2 -0
  32. package/dist/fn/dateSQL.js +6 -3
  33. package/dist/fn/deepPath.js +9 -7
  34. package/dist/fn/defaultAjaxAbortFunction.js +3 -1
  35. package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
  36. package/dist/fn/defaultAjaxErrorFunction.js +15 -2
  37. package/dist/fn/defaultAlertFunction.d.ts +1 -1
  38. package/dist/fn/defaultAlertFunction.js +5 -1
  39. package/dist/fn/defaultEndLoadingFunction.d.ts +1 -1
  40. package/dist/fn/defaultEndLoadingFunction.js +19 -1
  41. package/dist/fn/defaultErrorFunction.js +3 -1
  42. package/dist/fn/defaultHistoryFunction.js +3 -1
  43. package/dist/fn/defaultLinkFunction.js +3 -1
  44. package/dist/fn/defaultPostLinkFunction.js +3 -1
  45. package/dist/fn/defaultPreLinkFunction.d.ts +1 -1
  46. package/dist/fn/defaultPreLinkFunction.js +11 -1
  47. package/dist/fn/defaultResizeFunction.js +3 -1
  48. package/dist/fn/defaultStartLoadingFunction.d.ts +1 -1
  49. package/dist/fn/defaultStartLoadingFunction.js +14 -1
  50. package/dist/fn/deleteProp.js +5 -1
  51. package/dist/fn/diffObj.js +20 -5
  52. package/dist/fn/download.js +4 -1
  53. package/dist/fn/downloadContent.js +12 -1
  54. package/dist/fn/eraseCookie.js +3 -1
  55. package/dist/fn/error.js +5 -1
  56. package/dist/fn/escapeRegExp.js +3 -1
  57. package/dist/fn/escapeUrl.js +3 -1
  58. package/dist/fn/extend.js +6 -1
  59. package/dist/fn/fdate.js +1 -0
  60. package/dist/fn/fdatetime.js +10 -1
  61. package/dist/fn/filter.js +10 -6
  62. package/dist/fn/filterToConditions.js +8 -2
  63. package/dist/fn/findAll.js +5 -3
  64. package/dist/fn/format.js +5 -1
  65. package/dist/fn/formatDate.js +3 -1
  66. package/dist/fn/formdata.js +7 -2
  67. package/dist/fn/ftime.js +3 -1
  68. package/dist/fn/getAllTags.js +3 -1
  69. package/dist/fn/getAttributes.js +3 -1
  70. package/dist/fn/getBrowserName.js +20 -10
  71. package/dist/fn/getBrowserVersion.js +21 -10
  72. package/dist/fn/getEventData.js +26 -6
  73. package/dist/fn/getField.js +1 -2
  74. package/dist/fn/getPath.js +14 -3
  75. package/dist/fn/getProp.js +5 -1
  76. package/dist/fn/getRequestId.js +5 -3
  77. package/dist/fn/getScrollBarSize.js +4 -1
  78. package/dist/fn/getText.js +3 -1
  79. package/dist/fn/happy.js +8 -1
  80. package/dist/fn/hash.js +2 -1
  81. package/dist/fn/hex2rgb.js +8 -1
  82. package/dist/fn/history.js +3 -1
  83. package/dist/fn/html2text.js +6 -1
  84. package/dist/fn/imageToCanvas.js +7 -1
  85. package/dist/fn/imgToBase64.js +4 -1
  86. package/dist/fn/info.js +9 -1
  87. package/dist/fn/init.js +72 -14
  88. package/dist/fn/isArray.d.ts +1 -1
  89. package/dist/fn/isArray.js +3 -3
  90. package/dist/fn/isBlob.d.ts +1 -1
  91. package/dist/fn/isBlob.js +3 -3
  92. package/dist/fn/isBoolean.d.ts +1 -1
  93. package/dist/fn/isBoolean.js +3 -3
  94. package/dist/fn/isCanvas.d.ts +1 -1
  95. package/dist/fn/isCanvas.js +3 -3
  96. package/dist/fn/isComment.d.ts +1 -1
  97. package/dist/fn/isComment.js +3 -3
  98. package/dist/fn/isCp.d.ts +1 -1
  99. package/dist/fn/isCp.js +3 -3
  100. package/dist/fn/isDate.d.ts +1 -1
  101. package/dist/fn/isDate.js +3 -3
  102. package/dist/fn/isDesktopDevice.js +3 -1
  103. package/dist/fn/isDom.d.ts +1 -1
  104. package/dist/fn/isDom.js +3 -3
  105. package/dist/fn/isEvent.d.ts +1 -1
  106. package/dist/fn/isEvent.js +3 -3
  107. package/dist/fn/isFocused.js +3 -1
  108. package/dist/fn/isFunction.d.ts +1 -1
  109. package/dist/fn/isFunction.js +3 -3
  110. package/dist/fn/isHostname.d.ts +1 -1
  111. package/dist/fn/isHostname.js +10 -5
  112. package/dist/fn/isIP.d.ts +1 -1
  113. package/dist/fn/isIP.js +10 -3
  114. package/dist/fn/isInside.js +6 -4
  115. package/dist/fn/isInt.d.ts +1 -1
  116. package/dist/fn/isInt.js +3 -3
  117. package/dist/fn/isIterable.js +3 -1
  118. package/dist/fn/isMobile.js +3 -1
  119. package/dist/fn/isMobileDevice.js +3 -1
  120. package/dist/fn/isNull.d.ts +1 -1
  121. package/dist/fn/isNull.js +3 -3
  122. package/dist/fn/isNumber.d.ts +1 -1
  123. package/dist/fn/isNumber.js +3 -3
  124. package/dist/fn/isObject.d.ts +1 -1
  125. package/dist/fn/isObject.js +3 -3
  126. package/dist/fn/isPercent.d.ts +1 -1
  127. package/dist/fn/isPercent.js +3 -3
  128. package/dist/fn/isPrimitive.d.ts +1 -1
  129. package/dist/fn/isPrimitive.js +3 -3
  130. package/dist/fn/isPromise.d.ts +1 -1
  131. package/dist/fn/isPromise.js +3 -3
  132. package/dist/fn/isPropSize.js +10 -4
  133. package/dist/fn/isSQLDate.d.ts +1 -1
  134. package/dist/fn/isSQLDate.js +5 -4
  135. package/dist/fn/isSame.js +7 -4
  136. package/dist/fn/isString.d.ts +1 -1
  137. package/dist/fn/isString.js +3 -3
  138. package/dist/fn/isSymbol.d.ts +1 -1
  139. package/dist/fn/isSymbol.js +3 -3
  140. package/dist/fn/isTabletDevice.js +3 -1
  141. package/dist/fn/isURL.d.ts +1 -1
  142. package/dist/fn/isURL.js +10 -1
  143. package/dist/fn/isValidDimension.js +3 -1
  144. package/dist/fn/isValidName.d.ts +1 -1
  145. package/dist/fn/isValidName.js +3 -3
  146. package/dist/fn/isValue.d.ts +1 -1
  147. package/dist/fn/isValue.js +3 -3
  148. package/dist/fn/isVue.d.ts +1 -1
  149. package/dist/fn/isVue.js +5 -5
  150. package/dist/fn/iterate.js +5 -3
  151. package/dist/fn/link.js +24 -3
  152. package/dist/fn/makeReactive.js +47 -11
  153. package/dist/fn/md5.js +12 -3
  154. package/dist/fn/money.js +26 -0
  155. package/dist/fn/nl2br.js +3 -1
  156. package/dist/fn/objectToFormData.js +8 -4
  157. package/dist/fn/order.js +3 -1
  158. package/dist/fn/percent.js +3 -1
  159. package/dist/fn/pickValue.js +5 -3
  160. package/dist/fn/post.js +8 -3
  161. package/dist/fn/printf.js +8 -1
  162. package/dist/fn/randomInt.js +3 -1
  163. package/dist/fn/randomString.js +9 -2
  164. package/dist/fn/removeExtraSpaces.js +3 -1
  165. package/dist/fn/repeat.js +7 -1
  166. package/dist/fn/replaceSelection.js +6 -0
  167. package/dist/fn/riterate.js +3 -1
  168. package/dist/fn/roundDecimal.js +3 -1
  169. package/dist/fn/search.js +17 -2
  170. package/dist/fn/selector.js +3 -1
  171. package/dist/fn/setNavigationVars.js +20 -2
  172. package/dist/fn/setProp.js +9 -1
  173. package/dist/fn/shorten.js +1 -1
  174. package/dist/fn/shuffle.js +6 -1
  175. package/dist/fn/simpleHash.js +5 -1
  176. package/dist/fn/simpleHash1.js +1 -1
  177. package/dist/fn/simpleHash2.js +1 -1
  178. package/dist/fn/startChrono.js +5 -3
  179. package/dist/fn/stat.js +4 -2
  180. package/dist/fn/stopChrono.js +7 -5
  181. package/dist/fn/string2ArrayBuffer.js +1 -1
  182. package/dist/fn/submit.js +12 -1
  183. package/dist/fn/sum.js +11 -3
  184. package/dist/fn/timestamp.js +4 -1
  185. package/dist/fn/toggleFullScreen.js +3 -1
  186. package/dist/fn/translate.js +6 -1
  187. package/dist/fn/treatAjaxArguments.js +8 -0
  188. package/dist/fn/uniqString.d.ts +1 -1
  189. package/dist/fn/uniqString.js +14 -11
  190. package/dist/fn/unique.js +5 -1
  191. package/dist/fn/upload.js +20 -9
  192. package/dist/fn/warning.js +10 -1
  193. package/dist/index.js +1 -1
  194. package/package.json +1 -1
@@ -3,9 +3,11 @@ import { md5 } from './md5';
3
3
  const getRequestId = function (url, data, datatype) {
4
4
  let d = {};
5
5
  if (data) {
6
- iterate(data, (a, n) => { if (n.indexOf('_bbn') === -1) {
7
- d[n] = a;
8
- } });
6
+ iterate(data, (a, n) => {
7
+ if (n.indexOf('_bbn') === -1) {
8
+ d[n] = a;
9
+ }
10
+ });
9
11
  }
10
12
  return url + ':' + md5((datatype || 'json') + JSON.stringify(d));
11
13
  };
@@ -3,14 +3,17 @@ const getScrollBarSize = function () {
3
3
  let outer = document.createElement("div");
4
4
  outer.style.visibility = "hidden";
5
5
  outer.style.width = "100px";
6
- outer.style.msOverflowStyle = "scrollbar";
6
+ outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
7
7
  document.body.appendChild(outer);
8
8
  let widthNoScroll = outer.offsetWidth;
9
+ // force scrollbars
9
10
  outer.style.overflow = "scroll";
11
+ // add innerdiv
10
12
  let inner = document.createElement("div");
11
13
  inner.style.width = "100%";
12
14
  outer.appendChild(inner);
13
15
  let widthWithScroll = inner.offsetWidth;
16
+ // remove divs
14
17
  outer.parentNode.removeChild(outer);
15
18
  let sz = widthNoScroll - widthWithScroll;
16
19
  bbn.env.scrollBarSize = sz ? sz + 1 : 0;
@@ -1,2 +1,4 @@
1
- const getText = function (ele) { return ele.innerText().trim(); };
1
+ const getText = function (ele) {
2
+ return ele.innerText().trim();
3
+ };
2
4
  export { getText };
package/dist/fn/happy.js CHANGED
@@ -1,3 +1,10 @@
1
1
  import { log } from './log';
2
- const happy = function (...args) { args.unshift({ _bbn_console_level: 3, _bbn_console_style: "color: white; background: green; font-size: 18px;" }); log.apply(this, args); return this; };
2
+ const happy = function (...args) {
3
+ args.unshift({
4
+ _bbn_console_level: 3,
5
+ _bbn_console_style: "color: white; background: green; font-size: 18px;"
6
+ });
7
+ log.apply(this, args);
8
+ return this;
9
+ };
3
10
  export { happy };
package/dist/fn/hash.js CHANGED
@@ -1,9 +1,10 @@
1
+ import { log } from './log';
1
2
  import { isDom } from './isDom';
2
3
  import { isCp } from './isCp';
3
- import { log } from './log';
4
4
  import { circularReplacer } from './circularReplacer';
5
5
  import { simpleHash } from './simpleHash';
6
6
  const hash = function (obj) {
7
+ //log(obj);
7
8
  let st = '__bbn__';
8
9
  for (let i in arguments) {
9
10
  if (arguments[i]) {
@@ -1,2 +1,9 @@
1
- const hex2rgb = function (hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; };
1
+ const hex2rgb = function (hex) {
2
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
3
+ return result ? {
4
+ r: parseInt(result[1], 16),
5
+ g: parseInt(result[2], 16),
6
+ b: parseInt(result[3], 16)
7
+ } : null;
8
+ };
2
9
  export { hex2rgb };
@@ -1,2 +1,4 @@
1
- const history = function () { return window.history || false; };
1
+ const history = function () {
2
+ return window.history || false;
3
+ };
2
4
  export { history };
@@ -1,2 +1,7 @@
1
- const html2text = function (st) { let $test = document.createElement('div'); $test.innerHTML = st; st = $test.innerText; return st; };
1
+ const html2text = function (st) {
2
+ let $test = document.createElement('div');
3
+ $test.innerHTML = st;
4
+ st = $test.innerText;
5
+ return st;
6
+ };
2
7
  export { html2text };
@@ -1,2 +1,8 @@
1
- const imageToCanvas = function (img) { let canvas = document.createElement("canvas"); canvas.width = img.width; canvas.height = img.height; canvas.getContext("2d").drawImage(img, 0, 0); return canvas; };
1
+ const imageToCanvas = function (img) {
2
+ let canvas = document.createElement("canvas");
3
+ canvas.width = img.width;
4
+ canvas.height = img.height;
5
+ canvas.getContext("2d").drawImage(img, 0, 0);
6
+ return canvas;
7
+ };
2
8
  export { imageToCanvas };
@@ -1,4 +1,7 @@
1
1
  import { imageToCanvas } from './imageToCanvas';
2
2
  import { canvasToImage } from './canvasToImage';
3
- const imgToBase64 = function (img) { let canvas = imageToCanvas(img); return canvasToImage(canvas); };
3
+ const imgToBase64 = function (img) {
4
+ let canvas = imageToCanvas(img);
5
+ return canvasToImage(canvas);
6
+ };
4
7
  export { imgToBase64 };
package/dist/fn/info.js CHANGED
@@ -1,3 +1,11 @@
1
1
  import { log } from './log';
2
- const info = function (...args) { args.unshift({ _bbn_console_level: 4, _bbn_console_style: "color: #EEE; background: blue; font-size: 12px;" }); log.apply(this, args); return this; };
2
+ const info = function (...args) {
3
+ args.unshift({
4
+ //_bbn_console_mode: "info",
5
+ _bbn_console_level: 4,
6
+ _bbn_console_style: "color: #EEE; background: blue; font-size: 12px;"
7
+ });
8
+ log.apply(this, args);
9
+ return this;
10
+ };
3
11
  export { info };
package/dist/fn/init.js CHANGED
@@ -18,26 +18,72 @@ const init = function (cfg, force) {
18
18
  bbn.env.root += '/';
19
19
  }
20
20
  if (!bbn.env.isInit && (typeof dayjs !== 'undefined')) {
21
- each(['advancedFormat', 'arraySupport', 'badMutable', 'buddhistEra', 'calendar', 'customParseFormat', 'dayOfYear', 'devHelper', 'duration', 'isBetween', 'isLeapYear', 'isSameOrAfter', 'isSameOrBefore', 'isToday', 'isTomorrow', 'isYesterday', 'isoWeek', 'isoWeeksInYear', 'localeData', 'localizedFormat', 'minMax', 'objectSupport', 'pluralGetSet', 'quarterOfYear', 'relativeTime', 'timezone', 'toArray', 'toObject', 'updateLocale', 'utc', 'weekOfYear', 'weekYear', 'weekday'], plugin => { if (window['dayjs_plugin_' + plugin]) {
22
- dayjs.extend(window['dayjs_plugin_' + plugin]);
23
- } });
21
+ each([
22
+ 'advancedFormat',
23
+ 'arraySupport',
24
+ 'badMutable',
25
+ 'buddhistEra',
26
+ 'calendar',
27
+ 'customParseFormat',
28
+ 'dayOfYear',
29
+ 'devHelper',
30
+ 'duration',
31
+ 'isBetween',
32
+ 'isLeapYear',
33
+ 'isSameOrAfter',
34
+ 'isSameOrBefore',
35
+ 'isToday',
36
+ 'isTomorrow',
37
+ 'isYesterday',
38
+ 'isoWeek',
39
+ 'isoWeeksInYear',
40
+ 'localeData',
41
+ 'localizedFormat',
42
+ 'minMax',
43
+ 'objectSupport',
44
+ 'pluralGetSet',
45
+ 'quarterOfYear',
46
+ 'relativeTime',
47
+ 'timezone',
48
+ 'toArray',
49
+ 'toObject',
50
+ 'updateLocale',
51
+ 'utc',
52
+ 'weekOfYear',
53
+ 'weekYear',
54
+ 'weekday'
55
+ ], plugin => {
56
+ if (window['dayjs_plugin_' + plugin]) {
57
+ dayjs.extend(window['dayjs_plugin_' + plugin]);
58
+ }
59
+ });
24
60
  }
61
+ /* The server's path (difference between the host and the current dir */
25
62
  if (typeof (cfg) === 'object') {
26
63
  extend(true, window.bbn, cfg);
27
64
  }
28
65
  bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
29
66
  parts = bbn.env.path.split("/");
30
- each(parts, (v, i) => { v = decodeURI(v.trim()); if (v !== "") {
31
- bbn.env.params.push(v);
32
- } });
33
- if (bbn.vars.colors) {
34
- addColors(bbn.vars.colors);
67
+ //$.each(parts, function(i, v){
68
+ each(parts, (v, i) => {
69
+ v = decodeURI(v.trim());
70
+ if (v !== "") {
71
+ bbn.env.params.push(v);
72
+ }
73
+ });
74
+ if (bbn.var.colors) {
75
+ addColors(bbn.var.colors);
35
76
  }
36
77
  if (bbn.env.lang && (undefined !== dayjs)) {
37
78
  dayjs.locale(bbn.env.lang);
38
79
  }
39
- window.onfocus = () => { bbn.env.isFocused = true; };
40
- window.onblur = () => { bbn.env.isFocused = false; bbn.env.timeoff = Math.round((new Date()).getTime() / 1000); };
80
+ window.onfocus = () => {
81
+ bbn.env.isFocused = true;
82
+ };
83
+ window.onblur = () => {
84
+ bbn.env.isFocused = false;
85
+ bbn.env.timeoff = Math.round((new Date()).getTime() / 1000);
86
+ };
41
87
  document.addEventListener("focusin", e => {
42
88
  if (!e.target.classList.contains('bbn-no')) {
43
89
  bbn.env.focused = e.target;
@@ -72,10 +118,20 @@ const init = function (cfg, force) {
72
118
  return false;
73
119
  }
74
120
  });
75
- each(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), (ele, i) => { ele.addEventListener("submit", e => { submit(ele, e); }); });
76
- window.addEventListener('hashchange', () => { bbn.env.hashChanged = (new Date()).getTime(); }, false);
77
- window.addEventListener("resize", () => { resize(); });
78
- window.addEventListener("orientationchange", () => { resize(); });
121
+ each(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), (ele, i) => {
122
+ ele.addEventListener("submit", e => {
123
+ submit(ele, e);
124
+ });
125
+ });
126
+ window.addEventListener('hashchange', () => {
127
+ bbn.env.hashChanged = (new Date()).getTime();
128
+ }, false);
129
+ window.addEventListener("resize", () => {
130
+ resize();
131
+ });
132
+ window.addEventListener("orientationchange", () => {
133
+ resize();
134
+ });
79
135
  resize();
80
136
  if (isMobile()) {
81
137
  document.body.classList.add('bbn-mobile');
@@ -87,9 +143,11 @@ const init = function (cfg, force) {
87
143
  window.onpopstate = function (e) {
88
144
  let h = window.history;
89
145
  if (!bbn.env.historyDisabled && h) {
146
+ //e.preventDefault();
90
147
  let state = h.state;
91
148
  if (state) {
92
149
  if (defaultHistoryFunction(state)) {
150
+ //link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
93
151
  link(state.url, extend({ title: state.title || bbn.env.siteTitle }, state.data || {}));
94
152
  }
95
153
  else if (state && state.data && isFunction(state.data.script)) {
@@ -1,2 +1,2 @@
1
- declare const isArray: () => boolean;
1
+ declare const isArray: (...args: any[]) => boolean;
2
2
  export { isArray };
@@ -1,7 +1,7 @@
1
- const isArray = function () {
2
- if (!arguments.length)
1
+ const isArray = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (!Array.isArray(a)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isBlob: () => boolean;
1
+ declare const isBlob: (...args: any[]) => boolean;
2
2
  export { isBlob };
package/dist/fn/isBlob.js CHANGED
@@ -1,7 +1,7 @@
1
- const isBlob = function () {
2
- if (!arguments.length)
1
+ const isBlob = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if ({}.toString.apply(a) !== '[object Blob]') {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isBoolean: () => boolean;
1
+ declare const isBoolean: (...args: any[]) => boolean;
2
2
  export { isBoolean };
@@ -1,7 +1,7 @@
1
- const isBoolean = function () {
2
- if (!arguments.length)
1
+ const isBoolean = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (![true, false].includes(a)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isCanvas: () => boolean;
1
+ declare const isCanvas: (...args: any[]) => boolean;
2
2
  export { isCanvas };
@@ -1,7 +1,7 @@
1
- const isCanvas = function () {
2
- if (!arguments.length)
1
+ const isCanvas = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (!(a instanceof HTMLCanvasElement)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isComment: () => boolean;
1
+ declare const isComment: (...args: any[]) => boolean;
2
2
  export { isComment };
@@ -1,7 +1,7 @@
1
- const isComment = function () {
2
- if (!arguments.length)
1
+ const isComment = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (!(a instanceof Comment)) {
6
6
  return false;
7
7
  }
package/dist/fn/isCp.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const isCp: () => boolean;
1
+ declare const isCp: (...args: any[]) => boolean;
2
2
  export { isCp };
package/dist/fn/isCp.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { isDom } from './isDom';
2
- const isCp = function () {
3
- if (!arguments.length) {
2
+ const isCp = function (...args) {
3
+ if (!args.length) {
4
4
  return false;
5
5
  }
6
6
  if (!Object.hasOwn(bbn, 'cp')) {
7
7
  return false;
8
8
  }
9
- for (let a of arguments) {
9
+ for (let a of args) {
10
10
  let res = bbn.cp.isComponent(a);
11
11
  if (!res || isDom(res) || !res.$el) {
12
12
  return false;
@@ -1,2 +1,2 @@
1
- declare const isDate: () => boolean;
1
+ declare const isDate: (...args: any[]) => boolean;
2
2
  export { isDate };
package/dist/fn/isDate.js CHANGED
@@ -1,7 +1,7 @@
1
- const isDate = function () {
2
- if (!arguments.length)
1
+ const isDate = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if ({}.toString.apply(a) !== '[object Date]') {
6
6
  return false;
7
7
  }
@@ -1,2 +1,4 @@
1
- const isDesktopDevice = function () { return this.getDeviceType() === 'desktop'; };
1
+ const isDesktopDevice = function () {
2
+ return this.getDeviceType() === 'desktop';
3
+ };
2
4
  export { isDesktopDevice };
@@ -1,2 +1,2 @@
1
- declare const isDom: () => boolean;
1
+ declare const isDom: (...args: any[]) => boolean;
2
2
  export { isDom };
package/dist/fn/isDom.js CHANGED
@@ -1,7 +1,7 @@
1
- const isDom = function () {
2
- if (!arguments.length)
1
+ const isDom = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (!(a instanceof HTMLElement)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isEvent: () => boolean;
1
+ declare const isEvent: (...args: any[]) => boolean;
2
2
  export { isEvent };
@@ -1,7 +1,7 @@
1
- const isEvent = function () {
2
- if (!arguments.length)
1
+ const isEvent = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (!(a instanceof Event)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,4 @@
1
- const isFocused = function (ele, contain) { return (ele === document.activeElement) || (contain && ele.contains && (ele.contains(document.activeElement))); };
1
+ const isFocused = function (ele, contain) {
2
+ return (ele === document.activeElement) || (contain && ele.contains && (ele.contains(document.activeElement)));
3
+ };
2
4
  export { isFocused };
@@ -1,2 +1,2 @@
1
- declare const isFunction: () => boolean;
1
+ declare const isFunction: (...args: any[]) => boolean;
2
2
  export { isFunction };
@@ -1,7 +1,7 @@
1
- const isFunction = function () {
2
- if (!arguments.length)
1
+ const isFunction = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let obj of arguments) {
4
+ for (let obj of args) {
5
5
  if (!(obj && obj.constructor && obj.call && obj.apply)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isHostname: (st: any) => any;
1
+ declare const isHostname: (...args: any[]) => boolean;
2
2
  export { isHostname };
@@ -1,11 +1,16 @@
1
1
  import { isString } from './isString';
2
2
  import { isIP } from './isIP';
3
- const isHostname = function (st) {
4
- if (isString(st)) {
5
- if (isIP(st)) {
6
- return true;
3
+ const isHostname = function (...args) {
4
+ if (!args.length)
5
+ return false;
6
+ for (let st of args) {
7
+ if (!isString(st)) {
8
+ return false;
9
+ }
10
+ if (!isIP(st) && !bbn.var.regexp.hostname.test(st)) {
11
+ return false;
7
12
  }
8
- return bbn.vars.regexp.hostname.test(st);
9
13
  }
14
+ return true;
10
15
  };
11
16
  export { isHostname };
package/dist/fn/isIP.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const isIP: (st: any) => any;
1
+ declare const isIP: (...args: any[]) => boolean;
2
2
  export { isIP };
package/dist/fn/isIP.js CHANGED
@@ -1,5 +1,12 @@
1
1
  import { isString } from './isString';
2
- const isIP = function (st) { if (isString(st)) {
3
- return bbn.vars.regexp.ip.test(st);
4
- } };
2
+ const isIP = function (...args) {
3
+ if (!args.length)
4
+ return false;
5
+ for (let st of args) {
6
+ if (!isString(st) || !bbn.var.regexp.ip.test(st)) {
7
+ return false;
8
+ }
9
+ }
10
+ return true;
11
+ };
5
12
  export { isIP };
@@ -6,10 +6,12 @@ const isInside = function (ele, ancestor) {
6
6
  if (ancestors.length) {
7
7
  if (isString(ancestor)) {
8
8
  let ok = false;
9
- each(ancestors, a => { if (a.matches && a.matches(ancestor)) {
10
- ok = true;
11
- return false;
12
- } });
9
+ each(ancestors, a => {
10
+ if (a.matches && a.matches(ancestor)) {
11
+ ok = true;
12
+ return false;
13
+ }
14
+ });
13
15
  return ok;
14
16
  }
15
17
  if (ancestor instanceof HTMLElement) {
@@ -1,2 +1,2 @@
1
- declare const isInt: () => boolean;
1
+ declare const isInt: (...args: any[]) => boolean;
2
2
  export { isInt };
package/dist/fn/isInt.js CHANGED
@@ -1,7 +1,7 @@
1
- const isInt = function () {
2
- if (!arguments.length)
1
+ const isInt = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (!Number.isInteger(a)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,4 @@
1
- const isIterable = function (v) { return v && (typeof v === 'object') && (Symbol.iterator in Object(v)); };
1
+ const isIterable = function (v) {
2
+ return v && (typeof v === 'object') && (Symbol.iterator in Object(v));
3
+ };
2
4
  export { isIterable };
@@ -1,4 +1,6 @@
1
1
  import { isMobileDevice } from './isMobileDevice';
2
2
  import { isTabletDevice } from './isTabletDevice';
3
- const isMobile = function () { return isMobileDevice() || isTabletDevice(); };
3
+ const isMobile = function () {
4
+ return isMobileDevice() || isTabletDevice();
5
+ };
4
6
  export { isMobile };
@@ -1,2 +1,4 @@
1
- const isMobileDevice = function () { return this.getDeviceType() === 'mobile'; };
1
+ const isMobileDevice = function () {
2
+ return this.getDeviceType() === 'mobile';
3
+ };
2
4
  export { isMobileDevice };
@@ -1,2 +1,2 @@
1
- declare const isNull: () => boolean;
1
+ declare const isNull: (...args: any[]) => boolean;
2
2
  export { isNull };
package/dist/fn/isNull.js CHANGED
@@ -1,7 +1,7 @@
1
- const isNull = function () {
2
- if (!arguments.length)
1
+ const isNull = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if ({}.toString.apply(a) !== '[object Null]') {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isNumber: () => boolean;
1
+ declare const isNumber: (...args: any[]) => boolean;
2
2
  export { isNumber };
@@ -1,7 +1,7 @@
1
- const isNumber = function () {
2
- if (!arguments.length)
1
+ const isNumber = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if (['boolean', 'object', 'symbol'].includes(typeof a) || (a === '') || isNaN(a)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isObject: () => boolean;
1
+ declare const isObject: (...args: any[]) => boolean;
2
2
  export { isObject };
@@ -1,7 +1,7 @@
1
- const isObject = function () {
2
- if (!arguments.length)
1
+ const isObject = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if ({}.toString.apply(a) !== '[object Object]') {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isPercent: () => boolean;
1
+ declare const isPercent: (...args: any[]) => boolean;
2
2
  export { isPercent };
@@ -1,7 +1,7 @@
1
- const isPercent = function () {
2
- if (!arguments.length)
1
+ const isPercent = function (...args) {
2
+ if (!args.length)
3
3
  return false;
4
- for (let a of arguments) {
4
+ for (let a of args) {
5
5
  if ((typeof a !== 'string') || !a.match(/^\d+(?:\.\d+)?%$/)) {
6
6
  return false;
7
7
  }
@@ -1,2 +1,2 @@
1
- declare const isPrimitive: () => boolean;
1
+ declare const isPrimitive: (...args: any[]) => boolean;
2
2
  export { isPrimitive };