asv-hlps 1.2.59 → 1.2.61
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/lib/cjs/index.d.ts +1 -2
- package/lib/cjs/index.js +2 -3
- package/lib/cjs/services/capacitorStorageService.d.ts +0 -7
- package/lib/cjs/services/capacitorStorageService.js +14 -24
- package/lib/cjs/utils.d.ts +4 -0
- package/lib/cjs/utils.js +21 -1
- package/lib/esm/index.d.ts +1 -2
- package/lib/esm/index.js +4 -2
- package/lib/esm/services/capacitorStorageService.d.ts +0 -7
- package/lib/esm/services/capacitorStorageService.js +15 -23
- package/lib/esm/utils.d.ts +4 -0
- package/lib/esm/utils.js +19 -0
- package/package.json +1 -2
package/lib/cjs/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import AmountOnBillPipe from "./helpers/pipes/amount-on-bill-pipe";
|
|
|
5
5
|
import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
|
|
6
6
|
import StockPipe from "./helpers/pipes/stock-pipe";
|
|
7
7
|
import { AuthService } from "./services/authService";
|
|
8
|
-
import CapacitorStorageService from "./services/capacitorStorageService";
|
|
9
8
|
import StorageService from "./services/storageService";
|
|
10
9
|
import "./auth";
|
|
11
10
|
import "./bill";
|
|
@@ -36,4 +35,4 @@ export * from "./react-utils";
|
|
|
36
35
|
export * from "./sale";
|
|
37
36
|
export * from "./user";
|
|
38
37
|
export * from "./utils";
|
|
39
|
-
export { AuthParam, getAuth, AuthService, StorageService,
|
|
38
|
+
export { AuthParam, getAuth, AuthService, StorageService, HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe, };
|
package/lib/cjs/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.AmountOnBillPipe = exports.AmountOnListBillPipe = exports.StockPipe = exports.HlpEntry = exports.HlpProduct = exports.
|
|
20
|
+
exports.AmountOnBillPipe = exports.AmountOnListBillPipe = exports.StockPipe = exports.HlpEntry = exports.HlpProduct = exports.StorageService = exports.AuthService = exports.getAuth = void 0;
|
|
21
21
|
const auth_1 = require("./auth");
|
|
22
22
|
Object.defineProperty(exports, "getAuth", { enumerable: true, get: function () { return auth_1.getAuth; } });
|
|
23
23
|
const hlpEntry_1 = require("./helpers/hlpEntry");
|
|
@@ -32,8 +32,7 @@ const stock_pipe_1 = __importDefault(require("./helpers/pipes/stock-pipe"));
|
|
|
32
32
|
exports.StockPipe = stock_pipe_1.default;
|
|
33
33
|
const authService_1 = require("./services/authService");
|
|
34
34
|
Object.defineProperty(exports, "AuthService", { enumerable: true, get: function () { return authService_1.AuthService; } });
|
|
35
|
-
|
|
36
|
-
exports.CapacitorStorageService = capacitorStorageService_1.default;
|
|
35
|
+
// import CapacitorStorageService from "./services/capacitorStorageService";
|
|
37
36
|
const storageService_1 = __importDefault(require("./services/storageService"));
|
|
38
37
|
exports.StorageService = storageService_1.default;
|
|
39
38
|
require("./auth");
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare class CapacitorStorageService {
|
|
2
|
-
setStorage: (key: string, value: string) => Promise<void>;
|
|
3
|
-
getStorage: (key: string) => Promise<import("@capacitor/preferences").GetResult>;
|
|
4
|
-
removeName: (key: string) => Promise<void>;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: CapacitorStorageService;
|
|
7
|
-
export default _default;
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
constructor() {
|
|
15
|
-
this.setStorage = (key, value) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
yield preferences_1.Preferences.set({ key, value });
|
|
17
|
-
});
|
|
18
|
-
this.getStorage = (key) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
return yield preferences_1.Preferences.get({ key });
|
|
20
|
-
});
|
|
21
|
-
this.removeName = (key) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
yield preferences_1.Preferences.remove({ key });
|
|
23
|
-
});
|
|
24
|
-
}
|
|
2
|
+
/* class CapacitorStorageService {
|
|
3
|
+
setStorage = async (key: string, value: string) => {
|
|
4
|
+
await Preferences.set({ key, value });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
getStorage = async (key: string) => {
|
|
8
|
+
return await Preferences.get({ key });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
removeName = async (key: string) => {
|
|
12
|
+
await Preferences.remove({ key });
|
|
13
|
+
};
|
|
25
14
|
}
|
|
26
|
-
|
|
15
|
+
|
|
16
|
+
export default new CapacitorStorageService(); */
|
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -86,3 +86,7 @@ export declare const absFromSequence: (arr: number[]) => number[];
|
|
|
86
86
|
export declare const fillStartWithZero: (num: string | number, targetLength: number) => string;
|
|
87
87
|
export declare const fillEndWithZero: (num: string | number, targetLength: number) => string;
|
|
88
88
|
export declare const sumAmount: (tobs: any[], property: string) => number;
|
|
89
|
+
export declare const formatAmountToString: (amount: number, opt?: {
|
|
90
|
+
math?: "ceil" | "floor";
|
|
91
|
+
currency?: "cfa";
|
|
92
|
+
}) => string;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validEmail = exports.convertToCfa = exports.packAndUnit = exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = exports.dateToString = exports.replaceSpacesWith = exports.replaceAllIn = exports.sesStorageGet = exports.sesStorageSet = exports.genSequenceRef = exports.removeBackSlashOccurences = exports.removeString = exports.deepClone = exports.findFirstSequenceMissing = exports.fillNumWithZero = exports.findSequencesMissing = exports.sequencesToNumbers = exports.notInSequence = exports.reformatDates = exports.formatToStringCfa = exports.formatToString = exports.wakeUp = exports.sleep = exports.limitTo = exports.titleCase = exports.toObjectDate = exports.removeDuplicatesByKey = exports.removeDuplicates = exports.getRandomColor = exports.getNbOfDaysBetweenTwoDates = exports.displayDateRangeFr = exports.calPercent = exports.percentOf = exports.genDateMinutesStep = exports.convertFrDateToEnDate = exports.convertEnDateToFr = exports.formatDateMd = exports.formatDateYm = exports.formatDateYmFirstDay = exports.formatDateYmd = exports.formatFromAndToDate = exports.formatDateYmHypen = exports.formatDateFirstDayFr = exports.formatDateYmdHypenFr = exports.formatDateYmdHypen = void 0;
|
|
4
|
-
exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = void 0;
|
|
4
|
+
exports.formatAmountToString = exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = void 0;
|
|
5
5
|
const formatDateYmdHypen = (date) => {
|
|
6
6
|
return (0, exports.formatDateYmd)(date, "-");
|
|
7
7
|
};
|
|
@@ -496,3 +496,23 @@ const sumAmount = (tobs, property) => {
|
|
|
496
496
|
}, 0);
|
|
497
497
|
};
|
|
498
498
|
exports.sumAmount = sumAmount;
|
|
499
|
+
const formatAmountToString = (amount, opt) => {
|
|
500
|
+
switch (opt.math) {
|
|
501
|
+
case "ceil":
|
|
502
|
+
Math.ceil(amount);
|
|
503
|
+
break;
|
|
504
|
+
case "floor":
|
|
505
|
+
Math.floor(amount);
|
|
506
|
+
break;
|
|
507
|
+
default:
|
|
508
|
+
amount;
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
switch (opt.currency) {
|
|
512
|
+
case "cfa":
|
|
513
|
+
return (0, exports.formatToStringCfa)(amount);
|
|
514
|
+
default:
|
|
515
|
+
return (0, exports.formatToString)(amount);
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
exports.formatAmountToString = formatAmountToString;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import AmountOnBillPipe from "./helpers/pipes/amount-on-bill-pipe";
|
|
|
5
5
|
import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
|
|
6
6
|
import StockPipe from "./helpers/pipes/stock-pipe";
|
|
7
7
|
import { AuthService } from "./services/authService";
|
|
8
|
-
import CapacitorStorageService from "./services/capacitorStorageService";
|
|
9
8
|
import StorageService from "./services/storageService";
|
|
10
9
|
import "./auth";
|
|
11
10
|
import "./bill";
|
|
@@ -36,4 +35,4 @@ export * from "./react-utils";
|
|
|
36
35
|
export * from "./sale";
|
|
37
36
|
export * from "./user";
|
|
38
37
|
export * from "./utils";
|
|
39
|
-
export { AuthParam, getAuth, AuthService, StorageService,
|
|
38
|
+
export { AuthParam, getAuth, AuthService, StorageService, HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe, };
|
package/lib/esm/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import AmountOnBillPipe from "./helpers/pipes/amount-on-bill-pipe";
|
|
|
5
5
|
import AmountOnListBillPipe from "./helpers/pipes/amount-on-list-bill-pipe";
|
|
6
6
|
import StockPipe from "./helpers/pipes/stock-pipe";
|
|
7
7
|
import { AuthService } from "./services/authService";
|
|
8
|
-
import CapacitorStorageService from "./services/capacitorStorageService";
|
|
8
|
+
// import CapacitorStorageService from "./services/capacitorStorageService";
|
|
9
9
|
import StorageService from "./services/storageService";
|
|
10
10
|
import "./auth";
|
|
11
11
|
import "./bill";
|
|
@@ -41,4 +41,6 @@ export * from "./sale";
|
|
|
41
41
|
export * from "./user";
|
|
42
42
|
export * from "./utils";
|
|
43
43
|
// export * from "./helpers/hlpProduct";
|
|
44
|
-
export { getAuth, AuthService, StorageService,
|
|
44
|
+
export { getAuth, AuthService, StorageService,
|
|
45
|
+
// CapacitorStorageService,
|
|
46
|
+
HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe, };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare class CapacitorStorageService {
|
|
2
|
-
setStorage: (key: string, value: string) => Promise<void>;
|
|
3
|
-
getStorage: (key: string) => Promise<import("@capacitor/preferences").GetResult>;
|
|
4
|
-
removeName: (key: string) => Promise<void>;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: CapacitorStorageService;
|
|
7
|
-
export default _default;
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
yield Preferences.set({ key, value });
|
|
15
|
-
});
|
|
16
|
-
this.getStorage = (key) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
return yield Preferences.get({ key });
|
|
18
|
-
});
|
|
19
|
-
this.removeName = (key) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
yield Preferences.remove({ key });
|
|
21
|
-
});
|
|
22
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
/* class CapacitorStorageService {
|
|
3
|
+
setStorage = async (key: string, value: string) => {
|
|
4
|
+
await Preferences.set({ key, value });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
getStorage = async (key: string) => {
|
|
8
|
+
return await Preferences.get({ key });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
removeName = async (key: string) => {
|
|
12
|
+
await Preferences.remove({ key });
|
|
13
|
+
};
|
|
23
14
|
}
|
|
24
|
-
|
|
15
|
+
|
|
16
|
+
export default new CapacitorStorageService(); */
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -86,3 +86,7 @@ export declare const absFromSequence: (arr: number[]) => number[];
|
|
|
86
86
|
export declare const fillStartWithZero: (num: string | number, targetLength: number) => string;
|
|
87
87
|
export declare const fillEndWithZero: (num: string | number, targetLength: number) => string;
|
|
88
88
|
export declare const sumAmount: (tobs: any[], property: string) => number;
|
|
89
|
+
export declare const formatAmountToString: (amount: number, opt?: {
|
|
90
|
+
math?: "ceil" | "floor";
|
|
91
|
+
currency?: "cfa";
|
|
92
|
+
}) => string;
|
package/lib/esm/utils.js
CHANGED
|
@@ -425,3 +425,22 @@ export const sumAmount = (tobs, property) => {
|
|
|
425
425
|
return +prev + +curr[property];
|
|
426
426
|
}, 0);
|
|
427
427
|
};
|
|
428
|
+
export const formatAmountToString = (amount, opt) => {
|
|
429
|
+
switch (opt.math) {
|
|
430
|
+
case "ceil":
|
|
431
|
+
Math.ceil(amount);
|
|
432
|
+
break;
|
|
433
|
+
case "floor":
|
|
434
|
+
Math.floor(amount);
|
|
435
|
+
break;
|
|
436
|
+
default:
|
|
437
|
+
amount;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
switch (opt.currency) {
|
|
441
|
+
case "cfa":
|
|
442
|
+
return formatToStringCfa(amount);
|
|
443
|
+
default:
|
|
444
|
+
return formatToString(amount);
|
|
445
|
+
}
|
|
446
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asv-hlps",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.61",
|
|
4
4
|
"description": "helpers",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"typescript": "^4.8.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@capacitor/preferences": "^4.0.1",
|
|
27
26
|
"axios": "^0.27.2",
|
|
28
27
|
"bcryptjs": "^2.4.3",
|
|
29
28
|
"classnames": "^2.3.1",
|