@bbn/bbn 1.0.75 → 1.0.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.d.ts CHANGED
@@ -1851,7 +1851,7 @@ declare module "fn/ajax/callback" {
1851
1851
  *
1852
1852
  * @returns {*} The result of the main callback function: res.script, fn, or bbn.fn.defaultLinkFunction
1853
1853
  */
1854
- const callback: (url: string, res?: BbnAjaxResult, fn?: (a: BbnAjaxResult, b?: HTMLElement) => any, fn2?: (a: BbnAjaxResult) => any, ele?: HTMLElement | HTMLInputElement | HTMLTextAreaElement) => boolean;
1854
+ const callback: (url: string, res?: any, fn?: any, fn2?: any, ele?: any) => boolean;
1855
1855
  export { callback };
1856
1856
  }
1857
1857
  declare module "fn/string/camelize" {
@@ -4675,7 +4675,7 @@ declare module "fn" {
4675
4675
  baseName: (path: string, suffix?: string) => string;
4676
4676
  br2nl: (st: any) => string;
4677
4677
  calendar: (d?: string | number | Date, wrong_result?: string) => any;
4678
- callback: (url: string, res?: BbnAjaxResult, fn?: (a: BbnAjaxResult, b?: HTMLElement) => any, fn2?: (a: BbnAjaxResult) => any, ele?: HTMLElement | HTMLInputElement | HTMLTextAreaElement) => boolean;
4678
+ callback: (url: string, res?: any, fn?: any, fn2?: any, ele?: any) => boolean;
4679
4679
  camelize: (str: any) => any;
4680
4680
  camelToCss: (str: any) => any;
4681
4681
  canvasToImage: (canvas: any) => HTMLImageElement;
package/dist/bundle.js CHANGED
@@ -1371,15 +1371,15 @@
1371
1371
  if (!args.length) {
1372
1372
  return false;
1373
1373
  }
1374
- if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
1375
- for (let a of args) {
1376
- let res = bbn.cp.isComponent(a);
1377
- if (!res || (0, isDom_1.isDom)(a) || !((_a = a.$el) === null || _a === void 0 ? void 0 : _a.bbnCid)) {
1378
- return false;
1379
- }
1380
- }
1374
+ if (!('cp' in bbn) || !('isComponent' in bbn['cp']) || !(typeof bbn['cp'].isComponent === 'function')) {
1381
1375
  return false;
1382
1376
  }
1377
+ for (let a of args) {
1378
+ let res = bbn.cp.isComponent(a);
1379
+ if (!res || (0, isDom_1.isDom)(a) || !((_a = a.$el) === null || _a === void 0 ? void 0 : _a.bbnCid)) {
1380
+ return false;
1381
+ }
1382
+ }
1383
1383
  return true;
1384
1384
  };
1385
1385
  exports.isCp = isCp;
@@ -3813,7 +3813,7 @@
3813
3813
  res.url = url;
3814
3814
  }
3815
3815
  /* Case where a callback is defined */
3816
- if (fn) {
3816
+ if (fn && (0, isFunction_4.isFunction)(fn)) {
3817
3817
  tmp = fn(res, ele);
3818
3818
  }
3819
3819
  else {
@@ -3849,7 +3849,7 @@
3849
3849
  }
3850
3850
  }
3851
3851
  /* Case where a callback is defined */
3852
- if (tmp && fn2) {
3852
+ if (tmp && fn2 && (0, isFunction_4.isFunction)(fn2)) {
3853
3853
  fn2(res);
3854
3854
  }
3855
3855
  else if (isObj && defaultPostLinkFunction_1.defaultPostLinkFunction) {
@@ -33,5 +33,5 @@
33
33
  *
34
34
  * @returns {*} The result of the main callback function: res.script, fn, or bbn.fn.defaultLinkFunction
35
35
  */
36
- declare const callback: (url: string, res?: BbnAjaxResult, fn?: (a: BbnAjaxResult, b?: HTMLElement) => any, fn2?: (a: BbnAjaxResult) => any, ele?: HTMLElement | HTMLInputElement | HTMLTextAreaElement) => boolean;
36
+ declare const callback: (url: string, res?: any, fn?: any, fn2?: any, ele?: any) => boolean;
37
37
  export { callback };
@@ -59,7 +59,7 @@ const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
59
59
  res.url = url;
60
60
  }
61
61
  /* Case where a callback is defined */
62
- if (fn) {
62
+ if (fn && isFunction(fn)) {
63
63
  tmp = fn(res, ele);
64
64
  }
65
65
  else {
@@ -95,7 +95,7 @@ const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
95
95
  }
96
96
  }
97
97
  /* Case where a callback is defined */
98
- if (tmp && fn2) {
98
+ if (tmp && fn2 && isFunction(fn2)) {
99
99
  fn2(res);
100
100
  }
101
101
  else if (isObj && defaultPostLinkFunction) {
@@ -4,15 +4,15 @@ const isCp = function (...args) {
4
4
  if (!args.length) {
5
5
  return false;
6
6
  }
7
- if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
8
- for (let a of args) {
9
- let res = bbn.cp.isComponent(a);
10
- if (!res || isDom(a) || !((_a = a.$el) === null || _a === void 0 ? void 0 : _a.bbnCid)) {
11
- return false;
12
- }
13
- }
7
+ if (!('cp' in bbn) || !('isComponent' in bbn['cp']) || !(typeof bbn['cp'].isComponent === 'function')) {
14
8
  return false;
15
9
  }
10
+ for (let a of args) {
11
+ let res = bbn.cp.isComponent(a);
12
+ if (!res || isDom(a) || !((_a = a.$el) === null || _a === void 0 ? void 0 : _a.bbnCid)) {
13
+ return false;
14
+ }
15
+ }
16
16
  return true;
17
17
  };
18
18
  export { isCp };
package/dist/fn.d.ts CHANGED
@@ -28,7 +28,7 @@ declare const fn: {
28
28
  baseName: (path: string, suffix?: string) => string;
29
29
  br2nl: (st: any) => string;
30
30
  calendar: (d?: string | number | Date, wrong_result?: string) => any;
31
- callback: (url: string, res?: BbnAjaxResult, fn?: (a: BbnAjaxResult, b?: HTMLElement) => any, fn2?: (a: BbnAjaxResult) => any, ele?: HTMLElement | HTMLInputElement | HTMLTextAreaElement) => boolean;
31
+ callback: (url: string, res?: any, fn?: any, fn2?: any, ele?: any) => boolean;
32
32
  camelize: (str: any) => any;
33
33
  camelToCss: (str: any) => any;
34
34
  canvasToImage: (canvas: any) => HTMLImageElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",