@becollective/utils 2.0.2 → 2.0.3
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/constants/currencies.d.ts +26 -0
- package/lib/constants/currencies.js +31 -26
- package/lib/constants.d.ts +18 -677
- package/lib/constants.js +21 -43
- package/lib/money.js +4 -4
- package/package.json +6 -1
- package/src/constants/currencies.ts +34 -26
- package/src/constants.ts +18 -40
- package/src/money.ts +1 -1
- package/tests/money.test.ts +1 -1
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
export declare const AUD: {
|
|
2
|
+
code: string;
|
|
3
|
+
name: string;
|
|
4
|
+
minorUnit: number;
|
|
5
|
+
symbol: string | undefined;
|
|
6
|
+
prefix: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const NZD: {
|
|
9
|
+
code: string;
|
|
10
|
+
name: string;
|
|
11
|
+
minorUnit: number;
|
|
12
|
+
symbol: string | undefined;
|
|
13
|
+
prefix: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const GBP: {
|
|
16
|
+
code: string;
|
|
17
|
+
name: string;
|
|
18
|
+
minorUnit: number;
|
|
19
|
+
symbol: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare const EUR: {
|
|
22
|
+
code: string;
|
|
23
|
+
name: string;
|
|
24
|
+
minorUnit: number;
|
|
25
|
+
symbol: string | undefined;
|
|
26
|
+
};
|
|
1
27
|
declare const _default: {
|
|
2
28
|
AUD: {
|
|
3
29
|
code: string;
|
|
@@ -3,34 +3,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EUR = exports.GBP = exports.NZD = exports.AUD = void 0;
|
|
6
7
|
const currency_symbol_map_1 = __importDefault(require("currency-symbol-map"));
|
|
7
8
|
// ISO reference: https://www.currency-iso.org/en/home/tables/table-a1.html. This is what Intl.NumberFormat() uses.
|
|
8
9
|
// These are the currently supported currencies on our platform
|
|
10
|
+
exports.AUD = {
|
|
11
|
+
code: 'AUD',
|
|
12
|
+
name: 'Australian Dollar',
|
|
13
|
+
minorUnit: 2, // The number of digits after the decimal separator.
|
|
14
|
+
symbol: (0, currency_symbol_map_1.default)('AUD'),
|
|
15
|
+
prefix: 'A', // To identify which currency when use the same symbol
|
|
16
|
+
};
|
|
17
|
+
exports.NZD = {
|
|
18
|
+
code: 'NZD',
|
|
19
|
+
name: 'New Zealand Dollar',
|
|
20
|
+
minorUnit: 2,
|
|
21
|
+
symbol: (0, currency_symbol_map_1.default)('NZD'),
|
|
22
|
+
prefix: 'NZ',
|
|
23
|
+
};
|
|
24
|
+
exports.GBP = {
|
|
25
|
+
code: 'GBP',
|
|
26
|
+
name: 'Pound Sterling',
|
|
27
|
+
minorUnit: 2,
|
|
28
|
+
symbol: (0, currency_symbol_map_1.default)('GBP'),
|
|
29
|
+
};
|
|
30
|
+
exports.EUR = {
|
|
31
|
+
code: 'EUR',
|
|
32
|
+
name: 'Euro',
|
|
33
|
+
minorUnit: 2,
|
|
34
|
+
symbol: (0, currency_symbol_map_1.default)('EUR'),
|
|
35
|
+
};
|
|
9
36
|
exports.default = {
|
|
10
|
-
AUD:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
symbol: (0, currency_symbol_map_1.default)('AUD'),
|
|
15
|
-
prefix: 'A', // To identify which currency when use the same symbol
|
|
16
|
-
},
|
|
17
|
-
NZD: {
|
|
18
|
-
code: 'NZD',
|
|
19
|
-
name: 'New Zealand Dollar',
|
|
20
|
-
minorUnit: 2,
|
|
21
|
-
symbol: (0, currency_symbol_map_1.default)('NZD'),
|
|
22
|
-
prefix: 'NZ',
|
|
23
|
-
},
|
|
24
|
-
GBP: {
|
|
25
|
-
code: 'GBP',
|
|
26
|
-
name: 'Pound Sterling',
|
|
27
|
-
minorUnit: 2,
|
|
28
|
-
symbol: (0, currency_symbol_map_1.default)('GBP'),
|
|
29
|
-
},
|
|
30
|
-
EUR: {
|
|
31
|
-
code: 'EUR',
|
|
32
|
-
name: 'Euro',
|
|
33
|
-
minorUnit: 2,
|
|
34
|
-
symbol: (0, currency_symbol_map_1.default)('EUR'),
|
|
35
|
-
},
|
|
37
|
+
AUD: exports.AUD,
|
|
38
|
+
NZD: exports.NZD,
|
|
39
|
+
GBP: exports.GBP,
|
|
40
|
+
EUR: exports.EUR
|
|
36
41
|
};
|
package/lib/constants.d.ts
CHANGED
|
@@ -1,677 +1,18 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
textColour: string;
|
|
20
|
-
};
|
|
21
|
-
surfCrest: {
|
|
22
|
-
backgroundColour: string;
|
|
23
|
-
textColour: string;
|
|
24
|
-
};
|
|
25
|
-
quarterSpanishWhite: {
|
|
26
|
-
backgroundColour: string;
|
|
27
|
-
textColour: string;
|
|
28
|
-
};
|
|
29
|
-
buttermilk: {
|
|
30
|
-
backgroundColour: string;
|
|
31
|
-
textColour: string;
|
|
32
|
-
};
|
|
33
|
-
fog: {
|
|
34
|
-
backgroundColour: string;
|
|
35
|
-
textColour: string;
|
|
36
|
-
};
|
|
37
|
-
mabel: {
|
|
38
|
-
backgroundColour: string;
|
|
39
|
-
textColour: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
currencies: {
|
|
43
|
-
AUD: {
|
|
44
|
-
code: string;
|
|
45
|
-
name: string;
|
|
46
|
-
minorUnit: number;
|
|
47
|
-
symbol: string | undefined;
|
|
48
|
-
prefix: string;
|
|
49
|
-
};
|
|
50
|
-
NZD: {
|
|
51
|
-
code: string;
|
|
52
|
-
name: string;
|
|
53
|
-
minorUnit: number;
|
|
54
|
-
symbol: string | undefined;
|
|
55
|
-
prefix: string;
|
|
56
|
-
};
|
|
57
|
-
GBP: {
|
|
58
|
-
code: string;
|
|
59
|
-
name: string;
|
|
60
|
-
minorUnit: number;
|
|
61
|
-
symbol: string | undefined;
|
|
62
|
-
};
|
|
63
|
-
EUR: {
|
|
64
|
-
code: string;
|
|
65
|
-
name: string;
|
|
66
|
-
minorUnit: number;
|
|
67
|
-
symbol: string | undefined;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
customFields: {
|
|
71
|
-
maxMongoStringLength: number;
|
|
72
|
-
maxFileSizeBytes: number;
|
|
73
|
-
emailReferenceHeadingString: string;
|
|
74
|
-
uploadBatchSize: number;
|
|
75
|
-
fNameReferenceHeadingString: string;
|
|
76
|
-
lNameReferenceHeadingString: string;
|
|
77
|
-
maxNumberOfRows: number;
|
|
78
|
-
templateFileName: string;
|
|
79
|
-
};
|
|
80
|
-
countries: {
|
|
81
|
-
BD: string;
|
|
82
|
-
BE: string;
|
|
83
|
-
BF: string;
|
|
84
|
-
BG: string;
|
|
85
|
-
BA: string;
|
|
86
|
-
BB: string;
|
|
87
|
-
WF: string;
|
|
88
|
-
BL: string;
|
|
89
|
-
BM: string;
|
|
90
|
-
BN: string;
|
|
91
|
-
BO: string;
|
|
92
|
-
BH: string;
|
|
93
|
-
BI: string;
|
|
94
|
-
BJ: string;
|
|
95
|
-
BT: string;
|
|
96
|
-
JM: string;
|
|
97
|
-
BV: string;
|
|
98
|
-
BW: string;
|
|
99
|
-
WS: string;
|
|
100
|
-
BQ: string;
|
|
101
|
-
BR: string;
|
|
102
|
-
BS: string;
|
|
103
|
-
JE: string;
|
|
104
|
-
BY: string;
|
|
105
|
-
BZ: string;
|
|
106
|
-
RU: string;
|
|
107
|
-
RW: string;
|
|
108
|
-
RS: string;
|
|
109
|
-
TL: string;
|
|
110
|
-
RE: string;
|
|
111
|
-
TM: string;
|
|
112
|
-
TJ: string;
|
|
113
|
-
RO: string;
|
|
114
|
-
TK: string;
|
|
115
|
-
GW: string;
|
|
116
|
-
GU: string;
|
|
117
|
-
GT: string;
|
|
118
|
-
GS: string;
|
|
119
|
-
GR: string;
|
|
120
|
-
GQ: string;
|
|
121
|
-
GP: string;
|
|
122
|
-
JP: string;
|
|
123
|
-
GY: string;
|
|
124
|
-
GG: string;
|
|
125
|
-
GF: string;
|
|
126
|
-
GE: string;
|
|
127
|
-
GD: string;
|
|
128
|
-
GB: string;
|
|
129
|
-
GA: string;
|
|
130
|
-
SV: string;
|
|
131
|
-
GN: string;
|
|
132
|
-
GM: string;
|
|
133
|
-
GL: string;
|
|
134
|
-
GI: string;
|
|
135
|
-
GH: string;
|
|
136
|
-
OM: string;
|
|
137
|
-
TN: string;
|
|
138
|
-
JO: string;
|
|
139
|
-
HR: string;
|
|
140
|
-
HT: string;
|
|
141
|
-
HU: string;
|
|
142
|
-
HK: string;
|
|
143
|
-
HN: string;
|
|
144
|
-
HM: string;
|
|
145
|
-
VE: string;
|
|
146
|
-
PR: string;
|
|
147
|
-
PS: string;
|
|
148
|
-
PW: string;
|
|
149
|
-
PT: string;
|
|
150
|
-
SJ: string;
|
|
151
|
-
PY: string;
|
|
152
|
-
IQ: string;
|
|
153
|
-
PA: string;
|
|
154
|
-
PF: string;
|
|
155
|
-
PG: string;
|
|
156
|
-
PE: string;
|
|
157
|
-
PK: string;
|
|
158
|
-
PH: string;
|
|
159
|
-
PN: string;
|
|
160
|
-
PL: string;
|
|
161
|
-
PM: string;
|
|
162
|
-
ZM: string;
|
|
163
|
-
EH: string;
|
|
164
|
-
EE: string;
|
|
165
|
-
EG: string;
|
|
166
|
-
ZA: string;
|
|
167
|
-
EC: string;
|
|
168
|
-
IT: string;
|
|
169
|
-
VN: string;
|
|
170
|
-
SB: string;
|
|
171
|
-
ET: string;
|
|
172
|
-
SO: string;
|
|
173
|
-
ZW: string;
|
|
174
|
-
SA: string;
|
|
175
|
-
ES: string;
|
|
176
|
-
ER: string;
|
|
177
|
-
ME: string;
|
|
178
|
-
MD: string;
|
|
179
|
-
MG: string;
|
|
180
|
-
MF: string;
|
|
181
|
-
MA: string;
|
|
182
|
-
MC: string;
|
|
183
|
-
UZ: string;
|
|
184
|
-
MM: string;
|
|
185
|
-
ML: string;
|
|
186
|
-
MO: string;
|
|
187
|
-
MN: string;
|
|
188
|
-
MH: string;
|
|
189
|
-
MK: string;
|
|
190
|
-
MU: string;
|
|
191
|
-
MT: string;
|
|
192
|
-
MW: string;
|
|
193
|
-
MV: string;
|
|
194
|
-
MQ: string;
|
|
195
|
-
MP: string;
|
|
196
|
-
MS: string;
|
|
197
|
-
MR: string;
|
|
198
|
-
IM: string;
|
|
199
|
-
UG: string;
|
|
200
|
-
TZ: string;
|
|
201
|
-
MY: string;
|
|
202
|
-
MX: string;
|
|
203
|
-
IL: string;
|
|
204
|
-
FR: string;
|
|
205
|
-
IO: string;
|
|
206
|
-
SH: string;
|
|
207
|
-
FI: string;
|
|
208
|
-
FJ: string;
|
|
209
|
-
FK: string;
|
|
210
|
-
FM: string;
|
|
211
|
-
FO: string;
|
|
212
|
-
NI: string;
|
|
213
|
-
NL: string;
|
|
214
|
-
NO: string;
|
|
215
|
-
NA: string;
|
|
216
|
-
VU: string;
|
|
217
|
-
NC: string;
|
|
218
|
-
NE: string;
|
|
219
|
-
NF: string;
|
|
220
|
-
NG: string;
|
|
221
|
-
NZ: string;
|
|
222
|
-
NP: string;
|
|
223
|
-
NR: string;
|
|
224
|
-
NU: string;
|
|
225
|
-
CK: string;
|
|
226
|
-
XK: string;
|
|
227
|
-
CI: string;
|
|
228
|
-
CH: string;
|
|
229
|
-
CO: string;
|
|
230
|
-
CN: string;
|
|
231
|
-
CM: string;
|
|
232
|
-
CL: string;
|
|
233
|
-
CC: string;
|
|
234
|
-
CA: string;
|
|
235
|
-
CG: string;
|
|
236
|
-
CF: string;
|
|
237
|
-
CD: string;
|
|
238
|
-
CZ: string;
|
|
239
|
-
CY: string;
|
|
240
|
-
CX: string;
|
|
241
|
-
CR: string;
|
|
242
|
-
CW: string;
|
|
243
|
-
CV: string;
|
|
244
|
-
CU: string;
|
|
245
|
-
SZ: string;
|
|
246
|
-
SY: string;
|
|
247
|
-
SX: string;
|
|
248
|
-
KG: string;
|
|
249
|
-
KE: string;
|
|
250
|
-
SS: string;
|
|
251
|
-
SR: string;
|
|
252
|
-
KI: string;
|
|
253
|
-
KH: string;
|
|
254
|
-
KN: string;
|
|
255
|
-
KM: string;
|
|
256
|
-
ST: string;
|
|
257
|
-
SK: string;
|
|
258
|
-
KR: string;
|
|
259
|
-
SI: string;
|
|
260
|
-
KP: string;
|
|
261
|
-
KW: string;
|
|
262
|
-
SN: string;
|
|
263
|
-
SM: string;
|
|
264
|
-
SL: string;
|
|
265
|
-
SC: string;
|
|
266
|
-
KZ: string;
|
|
267
|
-
KY: string;
|
|
268
|
-
SG: string;
|
|
269
|
-
SE: string;
|
|
270
|
-
SD: string;
|
|
271
|
-
DO: string;
|
|
272
|
-
DM: string;
|
|
273
|
-
DJ: string;
|
|
274
|
-
DK: string;
|
|
275
|
-
VG: string;
|
|
276
|
-
DE: string;
|
|
277
|
-
YE: string;
|
|
278
|
-
DZ: string;
|
|
279
|
-
US: string;
|
|
280
|
-
UY: string;
|
|
281
|
-
YT: string;
|
|
282
|
-
UM: string;
|
|
283
|
-
LB: string;
|
|
284
|
-
LC: string;
|
|
285
|
-
LA: string;
|
|
286
|
-
TV: string;
|
|
287
|
-
TW: string;
|
|
288
|
-
TT: string;
|
|
289
|
-
TR: string;
|
|
290
|
-
LK: string;
|
|
291
|
-
LI: string;
|
|
292
|
-
LV: string;
|
|
293
|
-
TO: string;
|
|
294
|
-
LT: string;
|
|
295
|
-
LU: string;
|
|
296
|
-
LR: string;
|
|
297
|
-
LS: string;
|
|
298
|
-
TH: string;
|
|
299
|
-
TF: string;
|
|
300
|
-
TG: string;
|
|
301
|
-
TD: string;
|
|
302
|
-
TC: string;
|
|
303
|
-
LY: string;
|
|
304
|
-
VA: string;
|
|
305
|
-
VC: string;
|
|
306
|
-
AE: string;
|
|
307
|
-
AD: string;
|
|
308
|
-
AG: string;
|
|
309
|
-
AF: string;
|
|
310
|
-
AI: string;
|
|
311
|
-
VI: string;
|
|
312
|
-
IS: string;
|
|
313
|
-
IR: string;
|
|
314
|
-
AM: string;
|
|
315
|
-
AL: string;
|
|
316
|
-
AO: string;
|
|
317
|
-
AQ: string;
|
|
318
|
-
AS: string;
|
|
319
|
-
AR: string;
|
|
320
|
-
AU: string;
|
|
321
|
-
AT: string;
|
|
322
|
-
AW: string;
|
|
323
|
-
IN: string;
|
|
324
|
-
AX: string;
|
|
325
|
-
AZ: string;
|
|
326
|
-
IE: string;
|
|
327
|
-
ID: string;
|
|
328
|
-
UA: string;
|
|
329
|
-
QA: string;
|
|
330
|
-
MZ: string;
|
|
331
|
-
};
|
|
332
|
-
languages: string[];
|
|
333
|
-
distanceUnits: {
|
|
334
|
-
km: {
|
|
335
|
-
long: string;
|
|
336
|
-
short: string;
|
|
337
|
-
};
|
|
338
|
-
mi: {
|
|
339
|
-
long: string;
|
|
340
|
-
short: string;
|
|
341
|
-
};
|
|
342
|
-
};
|
|
343
|
-
groups: {
|
|
344
|
-
maxNumberOfGroupMembers: number;
|
|
345
|
-
defaultOptions: {
|
|
346
|
-
details: string[];
|
|
347
|
-
requirements: string[];
|
|
348
|
-
industries: string[];
|
|
349
|
-
};
|
|
350
|
-
groupTypes: {
|
|
351
|
-
name: string;
|
|
352
|
-
value: string;
|
|
353
|
-
}[];
|
|
354
|
-
};
|
|
355
|
-
insuranceStatuses: {
|
|
356
|
-
INSURED: {
|
|
357
|
-
value: string;
|
|
358
|
-
label: string;
|
|
359
|
-
};
|
|
360
|
-
UNINSURED: {
|
|
361
|
-
value: string;
|
|
362
|
-
label: string;
|
|
363
|
-
};
|
|
364
|
-
AUSPICED: {
|
|
365
|
-
value: string;
|
|
366
|
-
label: string;
|
|
367
|
-
};
|
|
368
|
-
};
|
|
369
|
-
insuranceTypes: {
|
|
370
|
-
publicLiabilityAU: {
|
|
371
|
-
type: string;
|
|
372
|
-
label: string;
|
|
373
|
-
};
|
|
374
|
-
volunteerAccidentAU: {
|
|
375
|
-
type: string;
|
|
376
|
-
label: string;
|
|
377
|
-
};
|
|
378
|
-
publicLiabilityGB: {
|
|
379
|
-
type: string;
|
|
380
|
-
label: string;
|
|
381
|
-
};
|
|
382
|
-
volunteerAccidentGB: {
|
|
383
|
-
type: string;
|
|
384
|
-
label: string;
|
|
385
|
-
};
|
|
386
|
-
publicLiabilityNZ: {
|
|
387
|
-
type: string;
|
|
388
|
-
label: string;
|
|
389
|
-
};
|
|
390
|
-
volunteerAccidentNZ: {
|
|
391
|
-
type: string;
|
|
392
|
-
label: string;
|
|
393
|
-
};
|
|
394
|
-
publicLiabilityOthers: {
|
|
395
|
-
type: string;
|
|
396
|
-
label: string;
|
|
397
|
-
};
|
|
398
|
-
volunteerAccidentOthers: {
|
|
399
|
-
type: string;
|
|
400
|
-
label: string;
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
locales: {
|
|
404
|
-
europeanCountryCodes: string[];
|
|
405
|
-
regionOptions: {
|
|
406
|
-
au: {
|
|
407
|
-
name: string;
|
|
408
|
-
domain: string;
|
|
409
|
-
hostname: string;
|
|
410
|
-
trademark: string;
|
|
411
|
-
twitter: string;
|
|
412
|
-
facebook: string;
|
|
413
|
-
instagram: string;
|
|
414
|
-
linkedin: string;
|
|
415
|
-
privacyPolicyUrl: string;
|
|
416
|
-
termsAndConditionsUrl: string;
|
|
417
|
-
privacyPolicyVersion: number;
|
|
418
|
-
termsAndConditionsVersion: number;
|
|
419
|
-
address: string;
|
|
420
|
-
};
|
|
421
|
-
nz: {
|
|
422
|
-
name: string;
|
|
423
|
-
domain: string;
|
|
424
|
-
hostname: string;
|
|
425
|
-
trademark: string;
|
|
426
|
-
twitter: string;
|
|
427
|
-
facebook: string;
|
|
428
|
-
instagram: string;
|
|
429
|
-
linkedin: string;
|
|
430
|
-
privacyPolicyUrl: string;
|
|
431
|
-
termsAndConditionsUrl: string;
|
|
432
|
-
privacyPolicyVersion: number;
|
|
433
|
-
termsAndConditionsVersion: number;
|
|
434
|
-
address: string;
|
|
435
|
-
};
|
|
436
|
-
uk: {
|
|
437
|
-
name: string;
|
|
438
|
-
domain: string;
|
|
439
|
-
hostname: string;
|
|
440
|
-
trademark: string;
|
|
441
|
-
twitter: string;
|
|
442
|
-
facebook: string;
|
|
443
|
-
instagram: string;
|
|
444
|
-
linkedin: string;
|
|
445
|
-
privacyPolicyUrl: string;
|
|
446
|
-
termsAndConditionsUrl: string;
|
|
447
|
-
privacyPolicyVersion: number;
|
|
448
|
-
termsAndConditionsVersion: number;
|
|
449
|
-
address: string;
|
|
450
|
-
};
|
|
451
|
-
};
|
|
452
|
-
countryOptions: {
|
|
453
|
-
AU: {
|
|
454
|
-
financialYearEndDate: {
|
|
455
|
-
month: number;
|
|
456
|
-
date: number;
|
|
457
|
-
};
|
|
458
|
-
distanceUnit: {
|
|
459
|
-
long: string;
|
|
460
|
-
short: string;
|
|
461
|
-
};
|
|
462
|
-
regions: {
|
|
463
|
-
long: string;
|
|
464
|
-
short: string;
|
|
465
|
-
}[];
|
|
466
|
-
insuranceTypes: {
|
|
467
|
-
type: string;
|
|
468
|
-
label: string;
|
|
469
|
-
}[];
|
|
470
|
-
};
|
|
471
|
-
NZ: {
|
|
472
|
-
financialYearEndDate: {
|
|
473
|
-
month: number;
|
|
474
|
-
date: number;
|
|
475
|
-
};
|
|
476
|
-
distanceUnit: {
|
|
477
|
-
long: string;
|
|
478
|
-
short: string;
|
|
479
|
-
};
|
|
480
|
-
insuranceTypes: {
|
|
481
|
-
type: string;
|
|
482
|
-
label: string;
|
|
483
|
-
}[];
|
|
484
|
-
};
|
|
485
|
-
GB: {
|
|
486
|
-
financialYearEndDate: {
|
|
487
|
-
month: number;
|
|
488
|
-
date: number;
|
|
489
|
-
};
|
|
490
|
-
distanceUnit: {
|
|
491
|
-
long: string;
|
|
492
|
-
short: string;
|
|
493
|
-
};
|
|
494
|
-
insuranceTypes: {
|
|
495
|
-
type: string;
|
|
496
|
-
label: string;
|
|
497
|
-
}[];
|
|
498
|
-
};
|
|
499
|
-
IE: {
|
|
500
|
-
financialYearEndDate: {
|
|
501
|
-
month: number;
|
|
502
|
-
date: number;
|
|
503
|
-
};
|
|
504
|
-
distanceUnit: {
|
|
505
|
-
long: string;
|
|
506
|
-
short: string;
|
|
507
|
-
};
|
|
508
|
-
insuranceTypes: {
|
|
509
|
-
type: string;
|
|
510
|
-
label: string;
|
|
511
|
-
}[];
|
|
512
|
-
};
|
|
513
|
-
Others: {
|
|
514
|
-
insuranceTypes: {
|
|
515
|
-
type: string;
|
|
516
|
-
label: string;
|
|
517
|
-
}[];
|
|
518
|
-
};
|
|
519
|
-
};
|
|
520
|
-
};
|
|
521
|
-
notifications: {
|
|
522
|
-
types: (string | {
|
|
523
|
-
messengerUpdates: string;
|
|
524
|
-
volunteerUpdates: string;
|
|
525
|
-
groupMemberUpdates: string;
|
|
526
|
-
groupInvitations: string;
|
|
527
|
-
opportunityInvitations: string;
|
|
528
|
-
opportunitiesSharedWithMe: string;
|
|
529
|
-
licenseCertificateExpiryNotice: string;
|
|
530
|
-
certificates: string;
|
|
531
|
-
} | {
|
|
532
|
-
membershipApplications: string;
|
|
533
|
-
volunteerApplications: string;
|
|
534
|
-
opportunityUpdates: string;
|
|
535
|
-
timesheets: string;
|
|
536
|
-
partnerships: string;
|
|
537
|
-
endorsements: string;
|
|
538
|
-
socialCurrency: string;
|
|
539
|
-
groupUpdates: string;
|
|
540
|
-
licenseCertificateExpiryNotice: string;
|
|
541
|
-
})[];
|
|
542
|
-
typesMap: {
|
|
543
|
-
volunteer: {
|
|
544
|
-
messengerUpdates: string;
|
|
545
|
-
volunteerUpdates: string;
|
|
546
|
-
groupMemberUpdates: string;
|
|
547
|
-
groupInvitations: string;
|
|
548
|
-
opportunityInvitations: string;
|
|
549
|
-
opportunitiesSharedWithMe: string;
|
|
550
|
-
licenseCertificateExpiryNotice: string;
|
|
551
|
-
certificates: string;
|
|
552
|
-
};
|
|
553
|
-
manager: {
|
|
554
|
-
membershipApplications: string;
|
|
555
|
-
volunteerApplications: string;
|
|
556
|
-
opportunityUpdates: string;
|
|
557
|
-
timesheets: string;
|
|
558
|
-
partnerships: string;
|
|
559
|
-
endorsements: string;
|
|
560
|
-
socialCurrency: string;
|
|
561
|
-
groupUpdates: string;
|
|
562
|
-
licenseCertificateExpiryNotice: string;
|
|
563
|
-
};
|
|
564
|
-
acquired: string;
|
|
565
|
-
};
|
|
566
|
-
};
|
|
567
|
-
opportunities: {
|
|
568
|
-
types: string[];
|
|
569
|
-
typesMap: {
|
|
570
|
-
roleFixed: string;
|
|
571
|
-
roleFlexible: string;
|
|
572
|
-
ongoing: string;
|
|
573
|
-
};
|
|
574
|
-
typesV2: string[];
|
|
575
|
-
typesMapV2: {
|
|
576
|
-
shift: string;
|
|
577
|
-
flexible: string;
|
|
578
|
-
};
|
|
579
|
-
statuses: string[];
|
|
580
|
-
volunteer: {
|
|
581
|
-
shiftStatus: {
|
|
582
|
-
approved: string;
|
|
583
|
-
cancelled: string;
|
|
584
|
-
left: string;
|
|
585
|
-
};
|
|
586
|
-
ruleStatus: {
|
|
587
|
-
approved: string;
|
|
588
|
-
cancelled: string;
|
|
589
|
-
};
|
|
590
|
-
volunteerStatus: {
|
|
591
|
-
approved: string;
|
|
592
|
-
pending: string;
|
|
593
|
-
invited: string;
|
|
594
|
-
declined: string;
|
|
595
|
-
left: string;
|
|
596
|
-
};
|
|
597
|
-
};
|
|
598
|
-
checklist: {
|
|
599
|
-
key: string;
|
|
600
|
-
value: string;
|
|
601
|
-
}[];
|
|
602
|
-
defaultOptions: {
|
|
603
|
-
details: {
|
|
604
|
-
currentJobTitle: string;
|
|
605
|
-
dateOfBirth: string;
|
|
606
|
-
emergencyContactDetails: string;
|
|
607
|
-
gender: string;
|
|
608
|
-
homeAddress: string;
|
|
609
|
-
phoneNumber: string;
|
|
610
|
-
};
|
|
611
|
-
requirements: {
|
|
612
|
-
driversLicense: string;
|
|
613
|
-
firstAidCertificate: string;
|
|
614
|
-
orientation: string;
|
|
615
|
-
policeCheck: string;
|
|
616
|
-
training: string;
|
|
617
|
-
workingWithChildrenCheck: string;
|
|
618
|
-
};
|
|
619
|
-
suitability: {
|
|
620
|
-
families: string;
|
|
621
|
-
deafHardOfHearing: string;
|
|
622
|
-
intellectuallyDisabled: string;
|
|
623
|
-
largeGroups: string;
|
|
624
|
-
skilledVolunteers: string;
|
|
625
|
-
travellingShortTermVolunteers: string;
|
|
626
|
-
blindLowVision: string;
|
|
627
|
-
volunteersWithLimitedEnglish: string;
|
|
628
|
-
wheelchairUsers: string;
|
|
629
|
-
workingExperience: string;
|
|
630
|
-
employeeVolunteers: string;
|
|
631
|
-
socialPrescribing: string;
|
|
632
|
-
publicTransportUsers: string;
|
|
633
|
-
LGBTQIAPlusCommunity: string;
|
|
634
|
-
LongTermVolunteers: string;
|
|
635
|
-
};
|
|
636
|
-
};
|
|
637
|
-
};
|
|
638
|
-
qualificationTypes: string[];
|
|
639
|
-
licencesAndCertifications: string[];
|
|
640
|
-
educationalQualifications: string[];
|
|
641
|
-
surveys: {
|
|
642
|
-
participantStatuses: {
|
|
643
|
-
notSent: string;
|
|
644
|
-
sent: string;
|
|
645
|
-
reSent: string;
|
|
646
|
-
responded: string;
|
|
647
|
-
};
|
|
648
|
-
subscriptionDowngradeReasons: {
|
|
649
|
-
featureLack: string;
|
|
650
|
-
expense: string;
|
|
651
|
-
difficulty: string;
|
|
652
|
-
technicalIssues: string;
|
|
653
|
-
other: string;
|
|
654
|
-
};
|
|
655
|
-
};
|
|
656
|
-
subscriptions: {
|
|
657
|
-
tierValues: {
|
|
658
|
-
none: number;
|
|
659
|
-
standard: number;
|
|
660
|
-
plus: number;
|
|
661
|
-
pro: number;
|
|
662
|
-
};
|
|
663
|
-
};
|
|
664
|
-
rules: {
|
|
665
|
-
daysOfTheWeek: {
|
|
666
|
-
label: string;
|
|
667
|
-
value: import("rrule").Weekday;
|
|
668
|
-
selected: boolean;
|
|
669
|
-
}[];
|
|
670
|
-
frequencyOptions: {
|
|
671
|
-
value: number;
|
|
672
|
-
label: string;
|
|
673
|
-
description: string;
|
|
674
|
-
}[];
|
|
675
|
-
};
|
|
676
|
-
};
|
|
677
|
-
export default constants;
|
|
1
|
+
export * as allowedHtmlTags from './constants/allowedHtmlTags';
|
|
2
|
+
export * as avatarColours from './constants/avatarColours';
|
|
3
|
+
export * as countries from './constants/countries';
|
|
4
|
+
export * as customFields from './constants/customFields';
|
|
5
|
+
export * as languages from './constants/languages';
|
|
6
|
+
export * as currencies from './constants/currencies';
|
|
7
|
+
export * as distanceUnits from './constants/distancesUnits';
|
|
8
|
+
export * as groups from './constants/groups';
|
|
9
|
+
export * as insuranceStatuses from './constants/insuranceStatuses';
|
|
10
|
+
export * as insuranceTypes from './constants/insuranceTypes';
|
|
11
|
+
export * as locales from './constants/locales';
|
|
12
|
+
export * as notifications from './constants/notifications';
|
|
13
|
+
export * as opportunities from './constants/opportunities';
|
|
14
|
+
export * as rules from './constants/rules';
|
|
15
|
+
export * as subscriptions from './constants/subscriptions';
|
|
16
|
+
export * as surveys from './constants/surveys';
|
|
17
|
+
export * as qualificationTypes from './constants/qualificationTypes';
|
|
18
|
+
export { licencesAndCertifications, educationalQualifications } from './constants/qualificationTypes';
|
package/lib/constants.js
CHANGED
|
@@ -32,47 +32,25 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
currencies: currencies_1.default,
|
|
61
|
-
customFields: customFields_1.default,
|
|
62
|
-
countries: countries_1.default,
|
|
63
|
-
languages: languages_1.default,
|
|
64
|
-
distanceUnits: distancesUnits_1.default,
|
|
65
|
-
groups: groups_1.default,
|
|
66
|
-
insuranceStatuses: insuranceStatuses_1.default,
|
|
67
|
-
insuranceTypes: insuranceTypes_1.default,
|
|
68
|
-
locales: locales_1.default,
|
|
69
|
-
notifications: notifications_1.default,
|
|
70
|
-
opportunities: opportunities_1.default,
|
|
71
|
-
qualificationTypes: qualificationTypes_1.default,
|
|
72
|
-
licencesAndCertifications: qualificationTypes_1.licencesAndCertifications,
|
|
73
|
-
educationalQualifications: qualificationTypes_1.educationalQualifications,
|
|
74
|
-
surveys: surveys_1.default,
|
|
75
|
-
subscriptions: subscriptions_1.default,
|
|
76
|
-
rules: rules_1.default,
|
|
77
|
-
};
|
|
78
|
-
exports.default = exports.constants;
|
|
36
|
+
exports.educationalQualifications = exports.licencesAndCertifications = exports.qualificationTypes = exports.surveys = exports.subscriptions = exports.rules = exports.opportunities = exports.notifications = exports.locales = exports.insuranceTypes = exports.insuranceStatuses = exports.groups = exports.distanceUnits = exports.currencies = exports.languages = exports.customFields = exports.countries = exports.avatarColours = exports.allowedHtmlTags = void 0;
|
|
37
|
+
exports.allowedHtmlTags = __importStar(require("./constants/allowedHtmlTags"));
|
|
38
|
+
exports.avatarColours = __importStar(require("./constants/avatarColours"));
|
|
39
|
+
exports.countries = __importStar(require("./constants/countries"));
|
|
40
|
+
exports.customFields = __importStar(require("./constants/customFields"));
|
|
41
|
+
exports.languages = __importStar(require("./constants/languages"));
|
|
42
|
+
exports.currencies = __importStar(require("./constants/currencies"));
|
|
43
|
+
exports.distanceUnits = __importStar(require("./constants/distancesUnits"));
|
|
44
|
+
exports.groups = __importStar(require("./constants/groups"));
|
|
45
|
+
exports.insuranceStatuses = __importStar(require("./constants/insuranceStatuses"));
|
|
46
|
+
exports.insuranceTypes = __importStar(require("./constants/insuranceTypes"));
|
|
47
|
+
exports.locales = __importStar(require("./constants/locales"));
|
|
48
|
+
exports.notifications = __importStar(require("./constants/notifications"));
|
|
49
|
+
exports.opportunities = __importStar(require("./constants/opportunities"));
|
|
50
|
+
exports.rules = __importStar(require("./constants/rules"));
|
|
51
|
+
exports.subscriptions = __importStar(require("./constants/subscriptions"));
|
|
52
|
+
exports.surveys = __importStar(require("./constants/surveys"));
|
|
53
|
+
exports.qualificationTypes = __importStar(require("./constants/qualificationTypes"));
|
|
54
|
+
var qualificationTypes_1 = require("./constants/qualificationTypes");
|
|
55
|
+
Object.defineProperty(exports, "licencesAndCertifications", { enumerable: true, get: function () { return qualificationTypes_1.licencesAndCertifications; } });
|
|
56
|
+
Object.defineProperty(exports, "educationalQualifications", { enumerable: true, get: function () { return qualificationTypes_1.educationalQualifications; } });
|
package/lib/money.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeMoneyString = exports.getCurrencyFromCurrencyCode = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@becollective/utils/constants");
|
|
5
5
|
// We should probably throw and error on bad input instead of falling back to a default.
|
|
6
6
|
// We're making an assumption that whoever is calling this function can safely work
|
|
7
7
|
// with AUD. But this assumption removes a lot of error handling elsewhere.
|
|
8
8
|
const getCurrencyFromCurrencyCode = (currencyCode) => {
|
|
9
|
-
if (typeof currencyCode !== 'string' || !currencies[currencyCode]) {
|
|
9
|
+
if (typeof currencyCode !== 'string' || !constants_1.currencies[currencyCode]) {
|
|
10
10
|
console.error(new Error(`Invalid currencyCode: ${currencyCode}. Falling back to 'AUD'.`));
|
|
11
|
-
return currencies.AUD;
|
|
11
|
+
return constants_1.currencies.AUD;
|
|
12
12
|
}
|
|
13
|
-
return currencies[currencyCode];
|
|
13
|
+
return constants_1.currencies[currencyCode];
|
|
14
14
|
};
|
|
15
15
|
exports.getCurrencyFromCurrencyCode = getCurrencyFromCurrencyCode;
|
|
16
16
|
const makeMoneyString = ({ amount: inputAmount, currencyCode, rounded = false, showCurrencyCode = false }) => {
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@becollective/utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Common utilities",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/index.js",
|
|
9
|
+
"./lib/*": "./lib/*.js",
|
|
10
|
+
"./*": "./lib/*.js"
|
|
11
|
+
},
|
|
7
12
|
"scripts": {
|
|
8
13
|
"test": "npm run build && NODE_ENV=localtest jest --config jestconfig.json --detectOpenHandles --verbose --forceExit",
|
|
9
14
|
"build": "tsc",
|
|
@@ -3,31 +3,39 @@ import getSymbol from 'currency-symbol-map';
|
|
|
3
3
|
// ISO reference: https://www.currency-iso.org/en/home/tables/table-a1.html. This is what Intl.NumberFormat() uses.
|
|
4
4
|
|
|
5
5
|
// These are the currently supported currencies on our platform
|
|
6
|
+
export const AUD = {
|
|
7
|
+
code: 'AUD',
|
|
8
|
+
name: 'Australian Dollar',
|
|
9
|
+
minorUnit: 2, // The number of digits after the decimal separator.
|
|
10
|
+
symbol: getSymbol('AUD'),
|
|
11
|
+
prefix: 'A', // To identify which currency when use the same symbol
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const NZD = {
|
|
15
|
+
code: 'NZD',
|
|
16
|
+
name: 'New Zealand Dollar',
|
|
17
|
+
minorUnit: 2,
|
|
18
|
+
symbol: getSymbol('NZD'),
|
|
19
|
+
prefix: 'NZ',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const GBP = {
|
|
23
|
+
code: 'GBP',
|
|
24
|
+
name: 'Pound Sterling',
|
|
25
|
+
minorUnit: 2,
|
|
26
|
+
symbol: getSymbol('GBP'),
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const EUR = {
|
|
30
|
+
code: 'EUR',
|
|
31
|
+
name: 'Euro',
|
|
32
|
+
minorUnit: 2,
|
|
33
|
+
symbol: getSymbol('EUR'),
|
|
34
|
+
};
|
|
35
|
+
|
|
6
36
|
export default {
|
|
7
|
-
AUD
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
symbol: getSymbol('AUD'),
|
|
12
|
-
prefix: 'A', // To identify which currency when use the same symbol
|
|
13
|
-
},
|
|
14
|
-
NZD: {
|
|
15
|
-
code: 'NZD',
|
|
16
|
-
name: 'New Zealand Dollar',
|
|
17
|
-
minorUnit: 2,
|
|
18
|
-
symbol: getSymbol('NZD'),
|
|
19
|
-
prefix: 'NZ',
|
|
20
|
-
},
|
|
21
|
-
GBP: {
|
|
22
|
-
code: 'GBP',
|
|
23
|
-
name: 'Pound Sterling',
|
|
24
|
-
minorUnit: 2,
|
|
25
|
-
symbol: getSymbol('GBP'),
|
|
26
|
-
},
|
|
27
|
-
EUR: {
|
|
28
|
-
code: 'EUR',
|
|
29
|
-
name: 'Euro',
|
|
30
|
-
minorUnit: 2,
|
|
31
|
-
symbol: getSymbol('EUR'),
|
|
32
|
-
},
|
|
37
|
+
AUD,
|
|
38
|
+
NZD,
|
|
39
|
+
GBP,
|
|
40
|
+
EUR
|
|
33
41
|
};
|
package/src/constants.ts
CHANGED
|
@@ -1,42 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
export * as allowedHtmlTags from './constants/allowedHtmlTags';
|
|
2
|
+
export * as avatarColours from './constants/avatarColours';
|
|
3
|
+
export * as countries from './constants/countries';
|
|
4
|
+
export * as customFields from './constants/customFields';
|
|
5
|
+
export * as languages from './constants/languages';
|
|
6
|
+
export * as currencies from './constants/currencies';
|
|
7
|
+
export * as distanceUnits from './constants/distancesUnits';
|
|
8
|
+
export * as groups from './constants/groups';
|
|
9
|
+
export * as insuranceStatuses from './constants/insuranceStatuses';
|
|
10
|
+
export * as insuranceTypes from './constants/insuranceTypes';
|
|
11
|
+
export * as locales from './constants/locales';
|
|
12
|
+
export * as notifications from './constants/notifications';
|
|
13
|
+
export * as opportunities from './constants/opportunities';
|
|
14
|
+
export * as rules from './constants/rules';
|
|
15
|
+
export * as subscriptions from './constants/subscriptions';
|
|
16
|
+
export * as surveys from './constants/surveys';
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
export * as qualificationTypes from './constants/qualificationTypes';
|
|
19
|
+
export { licencesAndCertifications, educationalQualifications } from './constants/qualificationTypes';
|
|
19
20
|
|
|
20
|
-
export const constants = {
|
|
21
|
-
allowedHtmlTags,
|
|
22
|
-
avatarColours,
|
|
23
|
-
currencies,
|
|
24
|
-
customFields,
|
|
25
|
-
countries,
|
|
26
|
-
languages,
|
|
27
|
-
distanceUnits,
|
|
28
|
-
groups,
|
|
29
|
-
insuranceStatuses,
|
|
30
|
-
insuranceTypes,
|
|
31
|
-
locales,
|
|
32
|
-
notifications,
|
|
33
|
-
opportunities,
|
|
34
|
-
qualificationTypes,
|
|
35
|
-
licencesAndCertifications,
|
|
36
|
-
educationalQualifications,
|
|
37
|
-
surveys,
|
|
38
|
-
subscriptions,
|
|
39
|
-
rules,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default constants;
|
package/src/money.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { currencies } from '@becollective/utils/constants';
|
|
2
2
|
|
|
3
3
|
// We should probably throw and error on bad input instead of falling back to a default.
|
|
4
4
|
// We're making an assumption that whoever is calling this function can safely work
|
package/tests/money.test.ts
CHANGED