@bbn/bbn 1.0.28 → 1.0.30

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
@@ -362,11 +362,11 @@ declare module "fn/cssExists" {
362
362
  export { cssExists };
363
363
  }
364
364
  declare module "fn/dateSQL" {
365
- const dateSQL: (v: any, dayOnly: any) => string;
365
+ const dateSQL: (v: any, dayOnly: any) => any;
366
366
  export { dateSQL };
367
367
  }
368
368
  declare module "fn/daysInMonth" {
369
- const daysInMonth: (v: any) => number | false;
369
+ const daysInMonth: (v: any) => any;
370
370
  export { daysInMonth };
371
371
  }
372
372
  declare module "fn/deepPath" {
@@ -478,7 +478,7 @@ declare module "fn/formatBytes" {
478
478
  export { formatBytes };
479
479
  }
480
480
  declare module "fn/formatDate" {
481
- const formatDate: (date: any, format: any) => string;
481
+ const formatDate: (date: any, format: any) => any;
482
482
  export { formatDate };
483
483
  }
484
484
  declare module "fn/formatSize" {
@@ -1113,8 +1113,8 @@ declare module "index" {
1113
1113
  createObject: (...args: any[]) => any;
1114
1114
  cssExists: (f: any) => boolean;
1115
1115
  date: (v: any) => any;
1116
- dateSQL: (v: any, dayOnly: any) => string;
1117
- daysInMonth: (v: any) => number | false;
1116
+ dateSQL: (v: any, dayOnly: any) => any;
1117
+ daysInMonth: (v: any) => any;
1118
1118
  deepPath: (arr: any[], filter: object, deepProperty: string, res?: any[]) => false | any[];
1119
1119
  defaultAjaxAbortFunction: (message: string, url?: string) => void;
1120
1120
  defaultAjaxErrorFunction: (jqXHR: any, textStatus?: string, errorThrown?: Error) => boolean;
@@ -1154,7 +1154,7 @@ declare module "index" {
1154
1154
  forir: (arr: any[], fn: (a: any, b: number) => any, max?: number, min?: number) => void;
1155
1155
  format: (str: any) => any;
1156
1156
  formatBytes: (bytes: any, decimals?: number) => string;
1157
- formatDate: (date: any, format: any) => string;
1157
+ formatDate: (date: any, format: any) => any;
1158
1158
  formatSize: (st: any, noValid: any) => any;
1159
1159
  formdata: (form: HTMLFormElement) => {};
1160
1160
  fromXml: (xml: any, arrayTags: any) => {};
@@ -1,25 +1,22 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.calendar = void 0;
7
4
  const fdate_1 = require("./fdate");
8
5
  const date_1 = require("./date");
9
6
  const isDate_1 = require("./isDate");
10
7
  const isString_1 = require("./isString");
11
- const dayjs_1 = __importDefault(require("dayjs"));
12
- const calendar_1 = __importDefault(require("dayjs/plugin/calendar"));
13
- dayjs_1.default.extend(calendar_1.default);
8
+ const dayjs = require("dayjs");
9
+ const cal = require("dayjs/plugin/calendar");
10
+ dayjs.extend(cal);
14
11
  const calendar = function (d, wrong_result) {
15
- if (undefined === dayjs_1.default) {
12
+ if (undefined === dayjs) {
16
13
  return (0, fdate_1.fdate)(d, wrong_result);
17
14
  }
18
15
  let r = (0, date_1.date)(d);
19
16
  if (!(0, isDate_1.isDate)(r)) {
20
17
  return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
21
18
  }
22
- return (0, dayjs_1.default)(r).calendar(null, {
19
+ return dayjs(r).calendar(null, {
23
20
  sameDay: '[' + bbn._('Today') + ']',
24
21
  nextDay: '[' + bbn._('Tomorrow') + ']',
25
22
  nextWeek: 'ddd D',
@@ -1,2 +1,2 @@
1
- declare const dateSQL: (v: any, dayOnly: any) => string;
1
+ declare const dateSQL: (v: any, dayOnly: any) => any;
2
2
  export { dateSQL };
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.dateSQL = void 0;
7
4
  const date_1 = require("./date");
8
- const dayjs_1 = __importDefault(require("dayjs"));
5
+ const dayjs = require("dayjs");
9
6
  const dateSQL = function (v, dayOnly) {
10
7
  let value = (0, date_1.date)(v);
11
8
  if (value) {
12
- return (0, dayjs_1.default)(value).format('YYYY-MM-DD' + (dayOnly ? '' : ' HH:mm:ss'));
9
+ return dayjs(value).format('YYYY-MM-DD' + (dayOnly ? '' : ' HH:mm:ss'));
13
10
  }
14
11
  };
15
12
  exports.dateSQL = dateSQL;
@@ -1,2 +1,2 @@
1
- declare const daysInMonth: (v: any) => number | false;
1
+ declare const daysInMonth: (v: any) => any;
2
2
  export { daysInMonth };
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.daysInMonth = void 0;
7
4
  const date_1 = require("./date");
8
- const dayjs_1 = __importDefault(require("dayjs"));
5
+ const dayjs = require("dayjs");
9
6
  const daysInMonth = function (v) {
10
7
  let d = (0, date_1.date)(v);
11
8
  if (d) {
12
- return (0, dayjs_1.default)(d).daysInMonth();
9
+ return dayjs(d).daysInMonth();
13
10
  }
14
11
  return false;
15
12
  };
package/dist/fn/fdate.js CHANGED
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.fdate = void 0;
7
4
  const fdatetime_1 = require("./fdatetime");
8
5
  const date_1 = require("./date");
9
6
  const isDate_1 = require("./isDate");
10
7
  const isString_1 = require("./isString");
11
- const dayjs_1 = __importDefault(require("dayjs"));
8
+ const dayjs = require("dayjs");
12
9
  const fdate = function (d, wrong_result) {
13
10
  // Retro compatibility
14
11
  if (wrong_result === true) {
@@ -18,8 +15,8 @@ const fdate = function (d, wrong_result) {
18
15
  if (!(0, isDate_1.isDate)(r)) {
19
16
  return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
20
17
  }
21
- if (undefined !== dayjs_1.default) {
22
- return (0, dayjs_1.default)(r).format('L');
18
+ if (undefined !== dayjs) {
19
+ return dayjs(r).format('L');
23
20
  }
24
21
  return r.toLocaleDateString();
25
22
  };
@@ -1,21 +1,18 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.fdatetime = void 0;
7
4
  const date_1 = require("./date");
8
5
  const isDate_1 = require("./isDate");
9
6
  const isString_1 = require("./isString");
10
- const dayjs_1 = __importDefault(require("dayjs"));
7
+ const dayjs = require("dayjs");
11
8
  const fdatetime = function (d, wrong_result) {
12
9
  let r = (0, date_1.date)(d);
13
10
  if (!(0, isDate_1.isDate)(r)) {
14
11
  return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
15
12
  }
16
- if (undefined !== dayjs_1.default) {
13
+ if (undefined !== dayjs) {
17
14
  //return dayjs(r).format('lll');
18
- return (0, dayjs_1.default)(r).calendar(null, {
15
+ return dayjs(r).calendar(null, {
19
16
  sameDay: '[' + bbn._('Today') + '] HH:mm',
20
17
  nextDay: '[' + bbn._('Tomorrow') + '] HH:mm',
21
18
  nextWeek: 'ddd D HH:mm',
@@ -1,2 +1,2 @@
1
- declare const formatDate: (date: any, format: any) => string;
1
+ declare const formatDate: (date: any, format: any) => any;
2
2
  export { formatDate };
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.formatDate = void 0;
7
- const dayjs_1 = __importDefault(require("dayjs"));
4
+ const dayjs = require("dayjs");
8
5
  const formatDate = function (date, format) {
9
- return (0, dayjs_1.default)(date).format(format);
6
+ return dayjs(date).format(format);
10
7
  };
11
8
  exports.formatDate = formatDate;
package/dist/fn/ftime.js CHANGED
@@ -1,22 +1,19 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.ftime = void 0;
7
4
  const date_1 = require("./date");
8
5
  const isDate_1 = require("./isDate");
9
6
  const isString_1 = require("./isString");
10
- const dayjs_1 = __importDefault(require("dayjs"));
11
- const calendar_1 = __importDefault(require("dayjs/plugin/calendar"));
12
- dayjs_1.default.extend(calendar_1.default);
7
+ const dayjs = require("dayjs");
8
+ const cal = require("dayjs/plugin/calendar");
9
+ dayjs.extend(cal);
13
10
  const ftime = function (d, wrong_result) {
14
11
  let r = (0, date_1.date)(d);
15
12
  if (!(0, isDate_1.isDate)(r)) {
16
13
  return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
17
14
  }
18
- if (undefined !== dayjs_1.default) {
19
- return (0, dayjs_1.default)(r).calendar();
15
+ if (undefined !== dayjs) {
16
+ return dayjs(r).calendar();
20
17
  }
21
18
  return r.toLocaleDateString();
22
19
  };
package/dist/fn/init.js CHANGED
@@ -1,30 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.init = void 0;
27
- const dayjs = __importStar(require("../../node_modules/dayjs/index"));
4
+ const dayjs = require("../../node_modules/dayjs/index");
28
5
  const substr_1 = require("./substr");
29
6
  const each_1 = require("./each");
30
7
  const extend_1 = require("./extend");
package/dist/fn/upload.js CHANGED
@@ -1,30 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.upload = void 0;
27
- const axios = __importStar(require("../../node_modules/axios/dist/axios"));
4
+ const axios = require("../../node_modules/axios/dist/axios");
28
5
  const objectToFormData_1 = require("./objectToFormData");
29
6
  const log_1 = require("./log");
30
7
  const upload = function (url, file, success, failure, progress) {
package/dist/index.d.ts CHANGED
@@ -176,8 +176,8 @@ declare const fn: {
176
176
  createObject: (...args: any[]) => any;
177
177
  cssExists: (f: any) => boolean;
178
178
  date: (v: any) => any;
179
- dateSQL: (v: any, dayOnly: any) => string;
180
- daysInMonth: (v: any) => number | false;
179
+ dateSQL: (v: any, dayOnly: any) => any;
180
+ daysInMonth: (v: any) => any;
181
181
  deepPath: (arr: any[], filter: object, deepProperty: string, res?: any[]) => false | any[];
182
182
  defaultAjaxAbortFunction: (message: string, url?: string) => void;
183
183
  defaultAjaxErrorFunction: (jqXHR: any, textStatus?: string, errorThrown?: Error) => boolean;
@@ -217,7 +217,7 @@ declare const fn: {
217
217
  forir: (arr: any[], fn: (a: any, b: number) => any, max?: number, min?: number) => void;
218
218
  format: (str: any) => any;
219
219
  formatBytes: (bytes: any, decimals?: number) => string;
220
- formatDate: (date: any, format: any) => string;
220
+ formatDate: (date: any, format: any) => any;
221
221
  formatSize: (st: any, noValid: any) => any;
222
222
  formdata: (form: HTMLFormElement) => {};
223
223
  fromXml: (xml: any, arrayTags: any) => {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",