@provis/provis-common-be-module 2.6.15 → 2.6.17
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.
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
declare const source:
|
|
1
|
+
declare const source: {
|
|
2
|
+
SOURCE_KALOG: string;
|
|
3
|
+
SOURCE_TANTO: string;
|
|
4
|
+
SOURCE_MERATUS_PALISIDE: string;
|
|
5
|
+
SOURCE_TEMAS: string;
|
|
6
|
+
SOURCE_DOMESTIK: string;
|
|
7
|
+
SOURCE_YUDHA_EXCEL: string;
|
|
8
|
+
SOURCE_EXIM: string;
|
|
9
|
+
SOURCE_UPLOAD_BUNDLE: string;
|
|
10
|
+
SOURCE_UPLOAD: string;
|
|
11
|
+
SOURCE_POLISMALL_CARGO: string;
|
|
12
|
+
LIST: any[];
|
|
13
|
+
};
|
|
2
14
|
export default source;
|
package/dist/constants/source.js
CHANGED
|
@@ -1,16 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const source = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
const source = {
|
|
4
|
+
SOURCE_KALOG: 'KALOG',
|
|
5
|
+
// SOURCE_LOTTE : 'LOTTE', // tidak jadi
|
|
6
|
+
SOURCE_TANTO: 'TANTO',
|
|
7
|
+
SOURCE_MERATUS_PALISIDE: 'MERATUS-PALISIDE',
|
|
8
|
+
SOURCE_TEMAS: 'TEMAS',
|
|
9
|
+
SOURCE_DOMESTIK: 'DOMESTIK',
|
|
10
|
+
SOURCE_YUDHA_EXCEL: 'YUDHA',
|
|
11
|
+
SOURCE_EXIM: 'EXIM',
|
|
12
|
+
SOURCE_UPLOAD_BUNDLE: 'UPLOAD-BUNDLE',
|
|
13
|
+
SOURCE_UPLOAD: 'UPLOAD',
|
|
14
|
+
SOURCE_POLISMALL_CARGO: 'polismall-cargo',
|
|
15
|
+
LIST: [],
|
|
16
|
+
};
|
|
17
|
+
source.LIST.push({
|
|
18
|
+
code: source.SOURCE_KALOG,
|
|
19
|
+
desc: { en: 'Kalog', id: 'Kalog' }
|
|
20
|
+
}, {
|
|
21
|
+
code: source.SOURCE_TANTO,
|
|
22
|
+
desc: { en: 'Tanto', id: 'Tanto' }
|
|
23
|
+
}, {
|
|
24
|
+
code: source.SOURCE_MERATUS_PALISIDE,
|
|
25
|
+
desc: { en: 'Meratus Paliside', id: 'Meratus Paliside' }
|
|
26
|
+
}, {
|
|
27
|
+
code: source.SOURCE_TEMAS,
|
|
28
|
+
desc: { en: 'Temas', id: 'Temas' }
|
|
29
|
+
}, {
|
|
30
|
+
code: source.SOURCE_DOMESTIK,
|
|
31
|
+
desc: { en: 'Cargo Microsite - Domestic', id: 'Mikrositus Cargo - Domestik' }
|
|
32
|
+
}, {
|
|
33
|
+
code: source.SOURCE_YUDHA_EXCEL,
|
|
34
|
+
desc: { en: 'Yudha', id: 'Yudha' }
|
|
35
|
+
}, {
|
|
36
|
+
code: source.SOURCE_EXIM,
|
|
37
|
+
desc: { en: 'Cargo Microsite - Export Import', id: 'Mikrositus Cargo - Ekspor Impor' }
|
|
38
|
+
}, {
|
|
39
|
+
code: source.SOURCE_UPLOAD_BUNDLE,
|
|
40
|
+
desc: { en: 'Upload Bundle', id: 'Upload Bundle' }
|
|
41
|
+
}, {
|
|
42
|
+
code: source.SOURCE_UPLOAD,
|
|
43
|
+
desc: { en: 'Upload Single', id: 'Upload Satuan' }
|
|
44
|
+
}, {
|
|
45
|
+
code: source.SOURCE_POLISMALL_CARGO,
|
|
46
|
+
desc: { en: 'Polismall Cargo', id: 'Polismall Cargo' }
|
|
47
|
+
});
|
|
16
48
|
exports.default = source;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare function sum(a: number | null, b: number | null): number;
|
|
2
2
|
declare function minus(a: number | null, b: number | null): number;
|
|
3
3
|
declare function multiple(a: number | null, b: number | null): number;
|
|
4
|
+
declare function roundTo(num: number | null, precision?: number | null): number;
|
|
4
5
|
declare function divide(a: number | null, b: number | null): number;
|
|
5
6
|
declare const sumN: (...numbers: (number | null)[]) => any;
|
|
6
|
-
|
|
7
|
+
declare const minusN: (...numbers: (number | null)[]) => any;
|
|
8
|
+
export { sum, minus, multiple, divide, sumN, minusN, roundTo };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sumN = exports.divide = exports.multiple = exports.minus = exports.sum = void 0;
|
|
3
|
+
exports.roundTo = exports.minusN = exports.sumN = exports.divide = exports.multiple = exports.minus = exports.sum = void 0;
|
|
4
4
|
function sum(a, b) {
|
|
5
5
|
try {
|
|
6
6
|
if (a == null && b == null)
|
|
@@ -34,11 +34,23 @@ function multiple(a, b) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.multiple = multiple;
|
|
37
|
+
function roundTo(num, precision = 2) {
|
|
38
|
+
try {
|
|
39
|
+
if (num == null && precision == null)
|
|
40
|
+
return null;
|
|
41
|
+
const factor = Math.pow(10, precision);
|
|
42
|
+
return Math.round((num ? Number(num) : 0) * factor) / factor;
|
|
43
|
+
}
|
|
44
|
+
catch (_a) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.roundTo = roundTo;
|
|
37
49
|
function divide(a, b) {
|
|
38
50
|
try {
|
|
39
51
|
if (a == null && b == null)
|
|
40
52
|
return null;
|
|
41
|
-
return (a ? Number(a) : 0)
|
|
53
|
+
return (a ? Number(a) : 0) / (b ? Number(b) : 0);
|
|
42
54
|
}
|
|
43
55
|
catch (_a) {
|
|
44
56
|
return null;
|
|
@@ -53,3 +65,11 @@ const sumN = (...numbers) => {
|
|
|
53
65
|
return result;
|
|
54
66
|
};
|
|
55
67
|
exports.sumN = sumN;
|
|
68
|
+
const minusN = (...numbers) => {
|
|
69
|
+
let result = null;
|
|
70
|
+
numbers.forEach(each => {
|
|
71
|
+
result = minus(result, each);
|
|
72
|
+
});
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
exports.minusN = minusN;
|