@provis/provis-common-be-module 1.7.3 → 1.7.5
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/constants/claim/kalog.js +1 -1
- package/dist/constants/claim/loket.js +27 -27
- package/dist/constants/claim/motorVehicle.js +1 -1
- package/dist/constants/claim/travel.js +1 -1
- package/dist/constants/product/occupation.d.ts +5 -0
- package/dist/constants/product/occupation.js +25 -0
- package/dist/constants/product/policy.d.ts +8 -0
- package/dist/constants/product/policy.js +10 -0
- package/dist/constants/product.d.ts +2 -1
- package/dist/constants/product.js +19 -30
- package/dist/helpers/amountDescription.js +1 -1
- package/dist/helpers/axiosGet.js +1 -1
- package/dist/helpers/axiosPost.js +1 -1
- package/dist/helpers/axiosPut.js +1 -1
- package/dist/helpers/calculateByType.js +2 -2
- package/dist/helpers/loop.js +2 -2
- package/dist/helpers/loopBackward.js +2 -2
- package/dist/helpers/readExcel.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3,37 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const status_1 = require("./status");
|
|
4
4
|
const loket = {
|
|
5
5
|
// LIST RESIKO
|
|
6
|
-
RISK_CLK001: 'CLK001',
|
|
7
|
-
RISK_CLK002: 'CLK002',
|
|
8
|
-
RISK_CLK003: 'CLK003',
|
|
9
|
-
RISK_CLK004: 'CLK004',
|
|
10
|
-
RISK_CLK005: 'CLK005',
|
|
11
|
-
RISK_CLK006: 'CLK006',
|
|
12
|
-
RISK_CLK007: 'CLK007',
|
|
6
|
+
RISK_CLK001: 'CLK001',
|
|
7
|
+
RISK_CLK002: 'CLK002',
|
|
8
|
+
RISK_CLK003: 'CLK003',
|
|
9
|
+
RISK_CLK004: 'CLK004',
|
|
10
|
+
RISK_CLK005: 'CLK005',
|
|
11
|
+
RISK_CLK006: 'CLK006',
|
|
12
|
+
RISK_CLK007: 'CLK007',
|
|
13
13
|
// LIST DOCUMENT
|
|
14
|
-
DOCUMENT_DLK001: 'DLK001',
|
|
15
|
-
DOCUMENT_DLK002: 'DLK002',
|
|
16
|
-
DOCUMENT_DLK003: 'DLK003',
|
|
17
|
-
DOCUMENT_DLK004: 'DLK004',
|
|
18
|
-
DOCUMENT_DLK005: 'DLK005',
|
|
19
|
-
DOCUMENT_DLK006: 'DLK006',
|
|
20
|
-
DOCUMENT_DLK007: 'DLK007',
|
|
21
|
-
DOCUMENT_DLK008: 'DLK008',
|
|
22
|
-
DOCUMENT_DLK009: 'DLK009',
|
|
23
|
-
DOCUMENT_DLK010: 'DLK010',
|
|
24
|
-
DOCUMENT_DLK011: 'DLK011',
|
|
25
|
-
DOCUMENT_DLK012: 'DLK012',
|
|
26
|
-
DOCUMENT_DLK013: 'DLK013',
|
|
27
|
-
DOCUMENT_DLK014: 'DLK014',
|
|
28
|
-
DOCUMENT_DLK015: 'DLK015',
|
|
29
|
-
DOCUMENT_DLK016: 'DLK016',
|
|
30
|
-
DOCUMENT_DLK017: 'DLK017',
|
|
31
|
-
DOCUMENT_DLK018: 'DLK018',
|
|
32
|
-
DOCUMENT_DLK019: 'DLK019',
|
|
14
|
+
DOCUMENT_DLK001: 'DLK001',
|
|
15
|
+
DOCUMENT_DLK002: 'DLK002',
|
|
16
|
+
DOCUMENT_DLK003: 'DLK003',
|
|
17
|
+
DOCUMENT_DLK004: 'DLK004',
|
|
18
|
+
DOCUMENT_DLK005: 'DLK005',
|
|
19
|
+
DOCUMENT_DLK006: 'DLK006',
|
|
20
|
+
DOCUMENT_DLK007: 'DLK007',
|
|
21
|
+
DOCUMENT_DLK008: 'DLK008',
|
|
22
|
+
DOCUMENT_DLK009: 'DLK009',
|
|
23
|
+
DOCUMENT_DLK010: 'DLK010',
|
|
24
|
+
DOCUMENT_DLK011: 'DLK011',
|
|
25
|
+
DOCUMENT_DLK012: 'DLK012',
|
|
26
|
+
DOCUMENT_DLK013: 'DLK013',
|
|
27
|
+
DOCUMENT_DLK014: 'DLK014',
|
|
28
|
+
DOCUMENT_DLK015: 'DLK015',
|
|
29
|
+
DOCUMENT_DLK016: 'DLK016',
|
|
30
|
+
DOCUMENT_DLK017: 'DLK017',
|
|
31
|
+
DOCUMENT_DLK018: 'DLK018',
|
|
32
|
+
DOCUMENT_DLK019: 'DLK019',
|
|
33
33
|
DOCUMENT_DT001: 'DT001',
|
|
34
34
|
DOCUMENT_DT002: 'DT002',
|
|
35
35
|
DOCUMENT_DT003: 'DT003',
|
|
36
|
-
LIST_RISK: [],
|
|
36
|
+
LIST_RISK: [],
|
|
37
37
|
RISK_CONFIG: {},
|
|
38
38
|
DOCUMENT_CONFIG: {},
|
|
39
39
|
STATUS_DEADLINE: {},
|
|
@@ -33,7 +33,7 @@ const motorVehicle = {
|
|
|
33
33
|
VCDOC022: { key: 'VCDOC022', descEn: '', desc: 'Kuitansi dari Rumah Sakit' },
|
|
34
34
|
VCDOC023: { key: 'VCDOC023', descEn: '', desc: 'Sertifikat Kematian - Untuk kematian Pihak Ketiga' },
|
|
35
35
|
VCDOC024: { key: 'VCDOC024', descEn: '', desc: 'Seluruh korespondensi dengan pihak ketiga yang mengalami luka/kematian' },
|
|
36
|
-
LIST_RISK: [],
|
|
36
|
+
LIST_RISK: [],
|
|
37
37
|
RISK_CONFIG: {},
|
|
38
38
|
DOCUMENT_CONFIG: {},
|
|
39
39
|
STATUS_DEADLINE: {},
|
|
@@ -73,7 +73,7 @@ const travel = {
|
|
|
73
73
|
TCDOC044: { key: 'TCDOC044', descEn: '', desc: 'Tanda terima bagasi (berisi jam & tanggal bagasi diterima)' },
|
|
74
74
|
TCDOC045: { key: 'TCDOC045', descEn: '', desc: 'Ticket & Boarding Pass' },
|
|
75
75
|
TCDOC046: { key: 'TCDOC046', descEn: '', desc: 'Visum et Repertum' },
|
|
76
|
-
LIST_RISK: [],
|
|
76
|
+
LIST_RISK: [],
|
|
77
77
|
RISK_CONFIG: {},
|
|
78
78
|
DOCUMENT_CONFIG: {},
|
|
79
79
|
STATUS_DEADLINE: {},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const occupation = [
|
|
4
|
+
{
|
|
5
|
+
value: "DH",
|
|
6
|
+
name: "Dwelling House",
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
value: "HT",
|
|
10
|
+
name: "Hotels",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
value: "PW",
|
|
14
|
+
name: "Private Warehouse",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: "SH",
|
|
18
|
+
name: "Shops",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: "PD",
|
|
22
|
+
name: "Petrol / Diesel Fuel Stations",
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
exports.default = occupation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const product: {
|
|
2
2
|
LIST: {};
|
|
3
|
-
|
|
3
|
+
MANUAL_LIST: {};
|
|
4
4
|
PRODUCT_CODE_PROPERTY_ALL_RISK: string;
|
|
5
5
|
PRODUCT_CODE_EARTHQUAKE: string;
|
|
6
6
|
PRODUCT_CODE_VEHICLE: string;
|
|
@@ -45,6 +45,7 @@ declare const product: {
|
|
|
45
45
|
PRODUCT_CODE_CARGO_BUNDLE: string;
|
|
46
46
|
PRODUCT_CODE_MERIMEN_CARGO: string;
|
|
47
47
|
PRODUCT_CODE_CARGO_TEMAS: string;
|
|
48
|
+
PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: string;
|
|
48
49
|
PRODUCT_CODE_OTTO_CI: string;
|
|
49
50
|
PRODUCT_CODE_OTTO_FLEXAS: string;
|
|
50
51
|
PRODUCT_CODE_OTTO_CRACK_SCREEN: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const occupation_1 = require("./product/occupation");
|
|
3
4
|
const product = {
|
|
4
5
|
LIST: {},
|
|
5
|
-
|
|
6
|
+
MANUAL_LIST: {},
|
|
6
7
|
PRODUCT_CODE_PROPERTY_ALL_RISK: 'polismall-property-allrisk',
|
|
7
8
|
PRODUCT_CODE_EARTHQUAKE: 'polismall-earthquake',
|
|
8
9
|
PRODUCT_CODE_VEHICLE: 'polismall-vehicle',
|
|
@@ -48,16 +49,17 @@ const product = {
|
|
|
48
49
|
PRODUCT_CODE_CARGO_BUNDLE: 'polismall-cargo-bundle',
|
|
49
50
|
PRODUCT_CODE_MERIMEN_CARGO: 'polismall-merimen-cargo',
|
|
50
51
|
PRODUCT_CODE_CARGO_TEMAS: 'polismall-cargo-temas',
|
|
52
|
+
PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: 'polismall-cargo-single-shipment',
|
|
51
53
|
// OTTO
|
|
52
|
-
PRODUCT_CODE_OTTO_CI: 'polismall-otto-critical-illness',
|
|
53
|
-
PRODUCT_CODE_OTTO_FLEXAS: 'polismall-otto-flexas',
|
|
54
|
-
PRODUCT_CODE_OTTO_CRACK_SCREEN: 'polismall-otto-crack',
|
|
55
|
-
PRODUCT_CODE_OTTO_AUM_GP: 'polismall-otto-aum-gp',
|
|
56
|
-
PRODUCT_CODE_OTTO_AUM_PLN: 'polismall-otto-aum-pln',
|
|
57
|
-
PRODUCT_CODE_OTTO_AUM_PDAM: 'polismall-otto-aum-pdam',
|
|
58
|
-
PRODUCT_CODE_OTTO_AUM_SB: 'polismall-otto-aum-sb',
|
|
59
|
-
PRODUCT_CODE_OTTO_AUM_FB: 'polismall-otto-aum-fb',
|
|
60
|
-
PRODUCT_CODE_OTTO_AUM_FBK: 'polismall-otto-aum-fbk',
|
|
54
|
+
PRODUCT_CODE_OTTO_CI: 'polismall-otto-critical-illness',
|
|
55
|
+
PRODUCT_CODE_OTTO_FLEXAS: 'polismall-otto-flexas',
|
|
56
|
+
PRODUCT_CODE_OTTO_CRACK_SCREEN: 'polismall-otto-crack',
|
|
57
|
+
PRODUCT_CODE_OTTO_AUM_GP: 'polismall-otto-aum-gp',
|
|
58
|
+
PRODUCT_CODE_OTTO_AUM_PLN: 'polismall-otto-aum-pln',
|
|
59
|
+
PRODUCT_CODE_OTTO_AUM_PDAM: 'polismall-otto-aum-pdam',
|
|
60
|
+
PRODUCT_CODE_OTTO_AUM_SB: 'polismall-otto-aum-sb',
|
|
61
|
+
PRODUCT_CODE_OTTO_AUM_FB: 'polismall-otto-aum-fb',
|
|
62
|
+
PRODUCT_CODE_OTTO_AUM_FBK: 'polismall-otto-aum-fbk',
|
|
61
63
|
// BDKI
|
|
62
64
|
PRODUCT_CODE_BDKI_MOTOR: 'polismall-bdki-motor',
|
|
63
65
|
PRODUCT_CODE_BDKI_RUMAH: 'polismall-bdki-rumah',
|
|
@@ -70,24 +72,6 @@ const product = {
|
|
|
70
72
|
PRODUCT_CODE_RETAIL_KALOG_CARGO: 'polismall-kalog-cargo',
|
|
71
73
|
PRODUCT_CODE_RETAIL_POS_CARGO: 'polismall-pos-cargo',
|
|
72
74
|
};
|
|
73
|
-
product.OCUPATION = [
|
|
74
|
-
{
|
|
75
|
-
value: "DH",
|
|
76
|
-
name: "Dwelling House",
|
|
77
|
-
}, {
|
|
78
|
-
value: "HT",
|
|
79
|
-
name: "Hotels",
|
|
80
|
-
}, {
|
|
81
|
-
value: "PW",
|
|
82
|
-
name: "Private Warehouse",
|
|
83
|
-
}, {
|
|
84
|
-
value: "SH",
|
|
85
|
-
name: "Shops",
|
|
86
|
-
}, {
|
|
87
|
-
value: "PD",
|
|
88
|
-
name: "Petrol / Diesel Fuel Stations",
|
|
89
|
-
}
|
|
90
|
-
];
|
|
91
75
|
product.LIST = {
|
|
92
76
|
[product.PRODUCT_CODE_BNI_MOBIL]: {
|
|
93
77
|
value: product.PRODUCT_CODE_BNI_MOBIL,
|
|
@@ -124,12 +108,12 @@ product.LIST = {
|
|
|
124
108
|
[product.PRODUCT_CODE_PROPERTY_ALL_RISK]: {
|
|
125
109
|
value: product.PRODUCT_CODE_PROPERTY_ALL_RISK,
|
|
126
110
|
name: "Property All Risk",
|
|
127
|
-
ocupation:
|
|
111
|
+
ocupation: occupation_1.default,
|
|
128
112
|
},
|
|
129
113
|
[product.PRODUCT_CODE_EARTHQUAKE]: {
|
|
130
114
|
value: product.PRODUCT_CODE_EARTHQUAKE,
|
|
131
115
|
name: "Earthquake",
|
|
132
|
-
ocupation:
|
|
116
|
+
ocupation: occupation_1.default,
|
|
133
117
|
},
|
|
134
118
|
[product.PRODUCT_CODE_VEHICLE]: {
|
|
135
119
|
value: product.PRODUCT_CODE_VEHICLE,
|
|
@@ -331,5 +315,10 @@ product.LIST = {
|
|
|
331
315
|
value: product.PRODUCT_CODE_CARGO_TEMAS,
|
|
332
316
|
name: "Polismall Cargo Temas",
|
|
333
317
|
},
|
|
318
|
+
[product.PRODUCT_CODE_CARGO_SINGLE_SHIPMENT]: {
|
|
319
|
+
value: product.PRODUCT_CODE_CARGO_SINGLE_SHIPMENT,
|
|
320
|
+
name: "Marine Cargo Single Shipment",
|
|
321
|
+
},
|
|
334
322
|
};
|
|
323
|
+
product.MANUAL_LIST = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, product.LIST[product.PRODUCT_POLISMALL_CARGO_MERATUS]), product.LIST[product.PRODUCT_CODE_PROPERTY_ALL_RISK]), product.LIST[product.PRODUCT_CODE_EARTHQUAKE]), product.LIST[product.PRODUCT_CODE_VEHICLE]), product.LIST[product.PRODUCT_CODE_PUBLIC_LIABILITY]), product.LIST[product.PRODUCT_CODE_MACHINERYR_BREAKDOWN]), product.LIST[product.PRODUCT_CODE_TERRORISM_SABOTAGE]), product.LIST[product.PRODUCT_CODE_COMPREHENSIVE_LIABILITY]), product.LIST[product.PRODUCT_CODE_GROUP_HEALTH]), product.LIST[product.PRODUCT_CODE_TRAVEL]), product.LIST[product.PRODUCT_CODE_HOSPITAL_CASH_PLAN]), product.LIST[product.PRODUCT_CODE_TERM_LIFE]), product.LIST[product.PRODUCT_CODE_PERSONAL_ACCIDENT]), product.LIST[product.PRODUCT_CODE_TAILOR_MADE]), product.LIST[product.PRODUCT_CODE_CRITICAL_ILLNESS]), product.LIST[product.PRODUCT_CODE_FREIGHT_FORWARDER_LIABILITY]), product.LIST[product.PRODUCT_CODE_MARINE_HULL]), product.LIST[product.PRODUCT_CODE_CREDIT_LIFE]), product.LIST[product.PRODUCT_CODE_TRADITIONAL_WHOLE_LIFE]), product.LIST[product.PRODUCT_CODE_CARPAKR_LIABILITY]), product.LIST[product.PRODUCT_CODE_DIRECTOR_OFFICER_LIABILITY]), product.LIST[product.PRODUCT_CODE_PROFESIONAL_INDEMNITY]), product.LIST[product.PRODUCT_CODE_GENERAL_LIABILITY]), product.LIST[product.PRODUCT_CODE_WEDDING]), product.LIST[product.PRODUCT_CODE_PENSIUN_FUND]), product.LIST[product.PRODUCT_CODE_ENVIRONMENTAL_LIABILITY]), product.LIST[product.PRODUCT_CODE_PROTECTION_INDEMNITY]), product.LIST[product.PRODUCT_CODE_STUDENT_PROTECTION]), product.LIST[product.PRODUCT_CODE_GADGET]), product.LIST[product.PRODUCT_CODE_ELECTRONIC_EQUIPMENT]), product.LIST[product.PRODUCT_CODE_CPM]), product.LIST[product.PRODUCT_CODE_CONSTRUCTION_ALLRISK]), product.LIST[product.PRODUCT_CODE_MERIMEN_CARGO]), product.LIST[product.PRODUCT_CODE_MOVEABLE_ALL_RISK]), product.LIST[product.PRODUCT_CODE_SURETY_BOND]), product.LIST[product.PRODUCT_CODE_ERECTION_ALL_RISK]), product.LIST[product.PRODUCT_CODE_CARGO_SINGLE_SHIPMENT]);
|
|
335
324
|
exports.default = product;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = terbilang;
|
|
4
3
|
function terbilang(value) {
|
|
5
4
|
const satuan = ['', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan'];
|
|
6
5
|
const belasan = ['sepuluh', 'sebelas', 'dua belas', 'tiga belas', 'empat belas', 'lima belas', 'enam belas', 'tujuh belas', 'delapan belas', 'sembilan belas'];
|
|
@@ -42,3 +41,4 @@ function terbilang(value) {
|
|
|
42
41
|
// Menghilangkan spasi yang double
|
|
43
42
|
return result.replace(/\s+/g, ' ').trim();
|
|
44
43
|
}
|
|
44
|
+
exports.default = terbilang;
|
package/dist/helpers/axiosGet.js
CHANGED
|
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
|
|
|
13
13
|
const generateRelationId_1 = require("./generateRelationId");
|
|
14
14
|
const getCurrentDate_1 = require("./getCurrentDate");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
16
|
-
exports.default = (
|
|
16
|
+
exports.default = ({ url, headers, params, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
return yield axios_1.default.get(url, {
|
|
18
18
|
params,
|
|
19
19
|
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
|
|
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
|
|
|
13
13
|
const generateRelationId_1 = require("./generateRelationId");
|
|
14
14
|
const getCurrentDate_1 = require("./getCurrentDate");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
16
|
-
exports.default = (
|
|
16
|
+
exports.default = ({ url, headers, body, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
return yield axios_1.default.post(url, body, {
|
|
18
18
|
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
|
|
19
19
|
}).then((result) => __awaiter(void 0, void 0, void 0, function* () {
|
package/dist/helpers/axiosPut.js
CHANGED
|
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
|
|
|
13
13
|
const constants_1 = require("../constants");
|
|
14
14
|
const generateRelationId_1 = require("./generateRelationId");
|
|
15
15
|
const getCurrentDate_1 = require("./getCurrentDate");
|
|
16
|
-
exports.default = (
|
|
16
|
+
exports.default = ({ url, headers, body, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
return yield axios_1.default.put(url, body, {
|
|
18
18
|
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
|
|
19
19
|
}).then((result) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
3
|
const brokerage_1 = require("../constants/brokerage");
|
|
5
4
|
function default_1(request) {
|
|
6
5
|
switch (request.type.toLowerCase()) {
|
|
7
6
|
case brokerage_1.default.TYPE_BROKERAGE_FIX_AMOUNT.code:
|
|
8
7
|
return request.rate;
|
|
9
8
|
case brokerage_1.default.TYPE_BROKERAGE_PERCENTAGE.code:
|
|
10
|
-
return request.rate * request.amount;
|
|
9
|
+
return request.rate * request.amount / 100;
|
|
11
10
|
default: null;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
13
|
+
exports.default = default_1;
|
package/dist/helpers/loop.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function loop(
|
|
13
|
-
return __awaiter(this,
|
|
12
|
+
function loop(list, callback, result = []) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
if (list && list.length > 0) {
|
|
15
15
|
const [head, ...tail] = list;
|
|
16
16
|
return loop(tail, callback, [yield callback(head), ...result]);
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function loop(
|
|
13
|
-
return __awaiter(this,
|
|
12
|
+
function loop(list, callback, result = []) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
if (list && list.length > 0) {
|
|
15
15
|
const [head, ...tail] = list;
|
|
16
16
|
return loop(tail, callback, [...result, yield callback(head)]);
|