@bbn/bbn 1.0.54 → 1.0.56

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
@@ -145,7 +145,7 @@ declare module "fn/_deleteLoader" {
145
145
  export { _deleteLoader };
146
146
  }
147
147
  declare module "fn/getLoader" {
148
- const getLoader: (requestId: string) => BbnLoader | false;
148
+ const getLoader: (requestId: string) => BbnLoader | null;
149
149
  export { getLoader };
150
150
  }
151
151
  declare module "fn/abort" {
package/dist/bundle.js CHANGED
@@ -906,7 +906,7 @@
906
906
  if (idx > -1) {
907
907
  return bbn.env.loaders[idx];
908
908
  }
909
- return false;
909
+ return null;
910
910
  };
911
911
  exports.getLoader = getLoader;
912
912
  });
@@ -1450,7 +1450,7 @@
1450
1450
  let requestId = (0, getRequestId_1.getRequestId)(url, data, datatype);
1451
1451
  let loaderObj = (0, getLoader_2.getLoader)(requestId);
1452
1452
  //log("IN AJAX", loaderObj? loaderObj.loader : "NO LOADER")
1453
- if (loaderObj && loaderObj.loader) {
1453
+ if (loaderObj?.loader) {
1454
1454
  return loaderObj.loader;
1455
1455
  }
1456
1456
  if (bbn.env.token) {
@@ -1474,7 +1474,7 @@
1474
1474
  }
1475
1475
  args.push(options);
1476
1476
  let loader = axios[args.length === 2 ? 'get' : 'post']
1477
- .apply(axios, args)
1477
+ .apply(axios, ...args)
1478
1478
  .then((res) => {
1479
1479
  (0, _deleteLoader_1._deleteLoader)(requestId, res);
1480
1480
  (0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, res);
package/dist/fn/ajax.js CHANGED
@@ -44,7 +44,7 @@ const ajax = function (url, datatype, data, success, failure, abort) {
44
44
  let requestId = getRequestId(url, data, datatype);
45
45
  let loaderObj = getLoader(requestId);
46
46
  //log("IN AJAX", loaderObj? loaderObj.loader : "NO LOADER")
47
- if (loaderObj && loaderObj.loader) {
47
+ if (loaderObj?.loader) {
48
48
  return loaderObj.loader;
49
49
  }
50
50
  if (bbn.env.token) {
@@ -68,7 +68,7 @@ const ajax = function (url, datatype, data, success, failure, abort) {
68
68
  }
69
69
  args.push(options);
70
70
  let loader = axios[args.length === 2 ? 'get' : 'post']
71
- .apply(axios, args)
71
+ .apply(axios, ...args)
72
72
  .then((res) => {
73
73
  _deleteLoader(requestId, res);
74
74
  defaultEndLoadingFunction(url, tst, data, res);
@@ -1,2 +1,2 @@
1
- declare const getLoader: (requestId: string) => BbnLoader | false;
1
+ declare const getLoader: (requestId: string) => BbnLoader | null;
2
2
  export { getLoader };
@@ -4,6 +4,6 @@ const getLoader = function (requestId) {
4
4
  if (idx > -1) {
5
5
  return bbn.env.loaders[idx];
6
6
  }
7
- return false;
7
+ return null;
8
8
  };
9
9
  export { getLoader };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "toolkit"
16
16
  ],
17
17
  "author": "Thomas Nabet <thomas.nabet@gmail.com>",
18
- "license": "ISC",
18
+ "license": "MIT",
19
19
  "devDependencies": {
20
20
  "typescript": "^5.2.2"
21
21
  },
@@ -27,5 +27,13 @@
27
27
  "axios": "^1.5.1",
28
28
  "dayjs": "^1.11.10",
29
29
  "typescript-bundle": "^1.0.18"
30
+ },
31
+ "directories": {
32
+ "doc": "doc",
33
+ "test": "test"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git@github.com:nabab/bbn-js.git"
30
38
  }
31
39
  }