@hyper.software/common-helpers 1.0.23 → 1.0.25
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/README.md +0 -0
- package/lib/errors/CriticalError.d.ts +0 -0
- package/lib/errors/CriticalError.js +0 -0
- package/lib/errors/CriticalError.js.map +0 -0
- package/lib/errors/ValidationError.d.ts +0 -0
- package/lib/errors/ValidationError.js +0 -0
- package/lib/errors/ValidationError.js.map +0 -0
- package/lib/errors/ValidationErrorSilent.d.ts +0 -0
- package/lib/errors/ValidationErrorSilent.js +0 -0
- package/lib/errors/ValidationErrorSilent.js.map +0 -0
- package/lib/errors/ValidationErrorWithStatus.d.ts +0 -0
- package/lib/errors/ValidationErrorWithStatus.js +0 -0
- package/lib/errors/ValidationErrorWithStatus.js.map +0 -0
- package/lib/errors/ValidationErrorWithStatusSilent.d.ts +0 -0
- package/lib/errors/ValidationErrorWithStatusSilent.js +0 -0
- package/lib/errors/ValidationErrorWithStatusSilent.js.map +0 -0
- package/lib/errors/__mocks__/errors.mock.d.ts +0 -0
- package/lib/errors/__mocks__/errors.mock.js +0 -0
- package/lib/errors/__mocks__/errors.mock.js.map +0 -0
- package/lib/errors/__tests__/errorMappers.test.d.ts +0 -0
- package/lib/errors/__tests__/errorMappers.test.js +0 -0
- package/lib/errors/__tests__/errorMappers.test.js.map +0 -0
- package/lib/errors/__tests__/errors.test.d.ts +0 -0
- package/lib/errors/__tests__/errors.test.js +0 -0
- package/lib/errors/__tests__/errors.test.js.map +0 -0
- package/lib/errors/errorMappers.d.ts +0 -0
- package/lib/errors/errorMappers.js +0 -0
- package/lib/errors/errorMappers.js.map +0 -0
- package/lib/errors/errors.types.d.ts +0 -0
- package/lib/errors/errors.types.js +0 -0
- package/lib/errors/errors.types.js.map +0 -0
- package/lib/errors/index.d.ts +0 -0
- package/lib/errors/index.js +0 -0
- package/lib/errors/index.js.map +0 -0
- package/lib/express/__tests__/swaggerHelpers.test.d.ts +0 -0
- package/lib/express/__tests__/swaggerHelpers.test.js +0 -0
- package/lib/express/__tests__/swaggerHelpers.test.js.map +0 -0
- package/lib/express/middleware/aliveMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/aliveMiddleware/index.js +0 -0
- package/lib/express/middleware/aliveMiddleware/index.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/company.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/company.js +0 -0
- package/lib/express/middleware/companyMiddleware/company.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/companyApiRequest.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/companyApiRequest.js +0 -0
- package/lib/express/middleware/companyMiddleware/companyApiRequest.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/index.js +0 -0
- package/lib/express/middleware/companyMiddleware/index.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/index.types.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/index.types.js +0 -0
- package/lib/express/middleware/companyMiddleware/index.types.js.map +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/__tests__/expressErrorHandlerMiddleware.test.d.ts +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/__tests__/expressErrorHandlerMiddleware.test.js +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/__tests__/expressErrorHandlerMiddleware.test.js.map +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/index.js +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/index.js.map +0 -0
- package/lib/express/middleware/index.d.ts +0 -0
- package/lib/express/middleware/index.js +0 -0
- package/lib/express/middleware/index.js.map +0 -0
- package/lib/express/middleware/languageMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/languageMiddleware/index.js +0 -0
- package/lib/express/middleware/languageMiddleware/index.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/index.js +0 -0
- package/lib/express/middleware/partnerMiddleware/index.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/index.types.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/index.types.js +0 -0
- package/lib/express/middleware/partnerMiddleware/index.types.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/partner.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/partner.js +0 -0
- package/lib/express/middleware/partnerMiddleware/partner.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/partnerServiceRequest.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/partnerServiceRequest.js +0 -0
- package/lib/express/middleware/partnerMiddleware/partnerServiceRequest.js.map +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/index.js +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/index.js.map +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/types.d.ts +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/types.js +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/types.js.map +0 -0
- package/lib/express/middleware/translationsMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/translationsMiddleware/index.js +0 -0
- package/lib/express/middleware/translationsMiddleware/index.js.map +0 -0
- package/lib/express/swaggerControllersConfig.d.ts +0 -0
- package/lib/express/swaggerControllersConfig.js +0 -0
- package/lib/express/swaggerControllersConfig.js.map +0 -0
- package/lib/express/swaggerHelpers.d.ts +0 -0
- package/lib/express/swaggerHelpers.js +0 -0
- package/lib/express/swaggerHelpers.js.map +0 -0
- package/lib/express/swaggerUiController.d.ts +0 -0
- package/lib/express/swaggerUiController.js +0 -0
- package/lib/express/swaggerUiController.js.map +0 -0
- package/lib/express/swaggerUiTemplate.d.ts +0 -0
- package/lib/express/swaggerUiTemplate.js +0 -0
- package/lib/express/swaggerUiTemplate.js.map +0 -0
- package/lib/helpers/ExecuteOnce.d.ts +0 -0
- package/lib/helpers/ExecuteOnce.js +0 -0
- package/lib/helpers/ExecuteOnce.js.map +0 -0
- package/lib/helpers/UniversalConfig.d.ts +0 -0
- package/lib/helpers/UniversalConfig.js +0 -0
- package/lib/helpers/UniversalConfig.js.map +0 -0
- package/lib/helpers/__tests__/arrays.test.d.ts +0 -0
- package/lib/helpers/__tests__/arrays.test.js +0 -0
- package/lib/helpers/__tests__/arrays.test.js.map +0 -0
- package/lib/helpers/__tests__/emptyValues.test.d.ts +0 -0
- package/lib/helpers/__tests__/emptyValues.test.js +0 -0
- package/lib/helpers/__tests__/emptyValues.test.js.map +0 -0
- package/lib/helpers/__tests__/formatters.formatCurrency.test.d.ts +0 -0
- package/lib/helpers/__tests__/formatters.formatCurrency.test.js +0 -0
- package/lib/helpers/__tests__/formatters.formatCurrency.test.js.map +0 -0
- package/lib/helpers/__tests__/formatters.formatDate.test.d.ts +0 -0
- package/lib/helpers/__tests__/formatters.formatDate.test.js +0 -0
- package/lib/helpers/__tests__/formatters.formatDate.test.js.map +0 -0
- package/lib/helpers/__tests__/formatters.formatDouble.test.d.ts +0 -0
- package/lib/helpers/__tests__/formatters.formatDouble.test.js +0 -0
- package/lib/helpers/__tests__/formatters.formatDouble.test.js.map +0 -0
- package/lib/helpers/__tests__/navigation.test.d.ts +0 -0
- package/lib/helpers/__tests__/navigation.test.js +0 -0
- package/lib/helpers/__tests__/navigation.test.js.map +0 -0
- package/lib/helpers/__tests__/strings.test.d.ts +0 -0
- package/lib/helpers/__tests__/strings.test.js +0 -0
- package/lib/helpers/__tests__/strings.test.js.map +0 -0
- package/lib/helpers/__tests__/validation.test.d.ts +0 -0
- package/lib/helpers/__tests__/validation.test.js +0 -0
- package/lib/helpers/__tests__/validation.test.js.map +0 -0
- package/lib/helpers/arrays.d.ts +0 -0
- package/lib/helpers/arrays.js +0 -0
- package/lib/helpers/arrays.js.map +0 -0
- package/lib/helpers/clientLogger.d.ts +0 -0
- package/lib/helpers/clientLogger.js +0 -0
- package/lib/helpers/clientLogger.js.map +0 -0
- package/lib/helpers/constants/common.d.ts +0 -0
- package/lib/helpers/constants/common.js +0 -0
- package/lib/helpers/constants/common.js.map +0 -0
- package/lib/helpers/constants/fileUploads.d.ts +0 -0
- package/lib/helpers/constants/fileUploads.js +0 -0
- package/lib/helpers/constants/fileUploads.js.map +0 -0
- package/lib/helpers/constants/index.d.ts +0 -0
- package/lib/helpers/constants/index.js +0 -0
- package/lib/helpers/constants/index.js.map +0 -0
- package/lib/helpers/constants/integrations.d.ts +0 -0
- package/lib/helpers/constants/integrations.js +0 -0
- package/lib/helpers/constants/integrations.js.map +0 -0
- package/lib/helpers/constants/language.d.ts +0 -0
- package/lib/helpers/constants/language.js +0 -0
- package/lib/helpers/constants/language.js.map +0 -0
- package/lib/helpers/constants/swagger.d.ts +0 -0
- package/lib/helpers/constants/swagger.js +0 -0
- package/lib/helpers/constants/swagger.js.map +0 -0
- package/lib/helpers/constants/urls.d.ts +0 -0
- package/lib/helpers/constants/urls.js +0 -0
- package/lib/helpers/constants/urls.js.map +0 -0
- package/lib/helpers/constants/user.d.ts +0 -0
- package/lib/helpers/constants/user.js +0 -0
- package/lib/helpers/constants/user.js.map +0 -0
- package/lib/helpers/constants/validators.d.ts +0 -0
- package/lib/helpers/constants/validators.js +0 -0
- package/lib/helpers/constants/validators.js.map +0 -0
- package/lib/helpers/emptyValues.d.ts +0 -0
- package/lib/helpers/emptyValues.js +0 -0
- package/lib/helpers/emptyValues.js.map +0 -0
- package/lib/helpers/formatters.d.ts +0 -0
- package/lib/helpers/formatters.js +20 -40
- package/lib/helpers/formatters.js.map +1 -1
- package/lib/helpers/guards.d.ts +0 -0
- package/lib/helpers/guards.js +0 -0
- package/lib/helpers/guards.js.map +0 -0
- package/lib/helpers/index.d.ts +0 -0
- package/lib/helpers/index.js +0 -0
- package/lib/helpers/index.js.map +0 -0
- package/lib/helpers/isBrowser.d.ts +0 -0
- package/lib/helpers/isBrowser.js +0 -0
- package/lib/helpers/isBrowser.js.map +0 -0
- package/lib/helpers/math.d.ts +0 -0
- package/lib/helpers/math.js +0 -0
- package/lib/helpers/math.js.map +0 -0
- package/lib/helpers/moment.d.ts +0 -0
- package/lib/helpers/moment.js +0 -0
- package/lib/helpers/moment.js.map +0 -0
- package/lib/helpers/navigation.d.ts +0 -0
- package/lib/helpers/navigation.js +0 -0
- package/lib/helpers/navigation.js.map +0 -0
- package/lib/helpers/stringifySafe.d.ts +0 -0
- package/lib/helpers/stringifySafe.js +0 -0
- package/lib/helpers/stringifySafe.js.map +0 -0
- package/lib/helpers/strings.d.ts +0 -0
- package/lib/helpers/strings.js +0 -0
- package/lib/helpers/strings.js.map +0 -0
- package/lib/helpers/validation.d.ts +0 -0
- package/lib/helpers/validation.js +4 -24
- package/lib/helpers/validation.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/lib/interfaces.d.ts +1 -0
- package/lib/interfaces.js +15 -0
- package/lib/interfaces.js.map +1 -1
- package/lib/redux/analyticsMiddleware.d.ts +0 -0
- package/lib/redux/analyticsMiddleware.js +0 -0
- package/lib/redux/analyticsMiddleware.js.map +0 -0
- package/lib/redux/clientMiddleware.d.ts +0 -0
- package/lib/redux/clientMiddleware.js +0 -0
- package/lib/redux/clientMiddleware.js.map +0 -0
- package/lib/redux/emptyMiddleware.d.ts +0 -0
- package/lib/redux/emptyMiddleware.js +0 -0
- package/lib/redux/emptyMiddleware.js.map +0 -0
- package/lib/redux/index.d.ts +0 -0
- package/lib/redux/index.js +0 -0
- package/lib/redux/index.js.map +0 -0
- package/lib/services/bookingsService/bookingService.d.ts +17 -0
- package/lib/services/bookingsService/bookingService.js +100 -0
- package/lib/services/bookingsService/bookingService.js.map +1 -0
- package/lib/services/cookieService/cookieService.d.ts +0 -0
- package/lib/services/cookieService/cookieService.js +0 -0
- package/lib/services/cookieService/cookieService.js.map +0 -0
- package/lib/services/googleAnalyticsService/googleAnalyticsService.d.ts +0 -0
- package/lib/services/googleAnalyticsService/googleAnalyticsService.js +0 -0
- package/lib/services/googleAnalyticsService/googleAnalyticsService.js.map +0 -0
- package/lib/services/imageService/imageService.d.ts +0 -0
- package/lib/services/imageService/imageService.js +0 -0
- package/lib/services/imageService/imageService.js.map +0 -0
- package/lib/services/index.d.ts +0 -0
- package/lib/services/index.js +0 -0
- package/lib/services/index.js.map +0 -0
- package/lib/services/languageService/languageService.d.ts +0 -0
- package/lib/services/languageService/languageService.js +0 -0
- package/lib/services/languageService/languageService.js.map +0 -0
- package/lib/services/localstorageService/localstorageService.d.ts +0 -0
- package/lib/services/localstorageService/localstorageService.js +0 -0
- package/lib/services/localstorageService/localstorageService.js.map +0 -0
- package/lib/services/sessionStorageService/index.d.ts +0 -0
- package/lib/services/sessionStorageService/index.js +0 -0
- package/lib/services/sessionStorageService/index.js.map +0 -0
- package/lib/translations/getAllTranslations.d.ts +0 -0
- package/lib/translations/getAllTranslations.js +0 -0
- package/lib/translations/getAllTranslations.js.map +0 -0
- package/package.json +9 -21
package/README.md
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/errors/index.d.ts
CHANGED
|
File without changes
|
package/lib/errors/index.js
CHANGED
|
File without changes
|
package/lib/errors/index.js.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/helpers/arrays.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/arrays.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.DATE_FORMATS = exports.formatDate = exports.formatDouble = exports.findCurrencySymbol = exports.formatCurrency = void 0;
|
|
27
|
-
var
|
|
28
|
-
var
|
|
7
|
+
var currency_formatter_1 = __importDefault(require("currency-formatter"));
|
|
8
|
+
var numeral_1 = __importDefault(require("numeral"));
|
|
29
9
|
var languageService_1 = require("../services/languageService/languageService");
|
|
30
10
|
var validation_1 = require("./validation");
|
|
31
11
|
function formatCurrency(language, amount, currency, options) {
|
|
@@ -40,11 +20,11 @@ function findCurrencySymbol(code) {
|
|
|
40
20
|
if (code === 'CHF') {
|
|
41
21
|
return 'Fr';
|
|
42
22
|
}
|
|
43
|
-
return
|
|
23
|
+
return currency_formatter_1.default.findCurrency(code).symbol;
|
|
44
24
|
}
|
|
45
25
|
exports.findCurrencySymbol = findCurrencySymbol;
|
|
46
|
-
if (!
|
|
47
|
-
|
|
26
|
+
if (!numeral_1.default.locales.de) {
|
|
27
|
+
numeral_1.default.register('locale', 'de', {
|
|
48
28
|
delimiters: {
|
|
49
29
|
thousands: '.',
|
|
50
30
|
decimal: ',',
|
|
@@ -54,15 +34,15 @@ if (!numeral.locales.de) {
|
|
|
54
34
|
currency: {},
|
|
55
35
|
});
|
|
56
36
|
}
|
|
57
|
-
if (!
|
|
58
|
-
|
|
37
|
+
if (!numeral_1.default.locales.ch) {
|
|
38
|
+
numeral_1.default.register('locale', 'ch', {
|
|
59
39
|
abbreviations: {},
|
|
60
40
|
ordinal: function () { return ({}); },
|
|
61
41
|
currency: {},
|
|
62
42
|
});
|
|
63
43
|
}
|
|
64
|
-
if (!
|
|
65
|
-
|
|
44
|
+
if (!numeral_1.default.locales.es) {
|
|
45
|
+
numeral_1.default.register('locale', 'es', {
|
|
66
46
|
delimiters: {
|
|
67
47
|
thousands: ',',
|
|
68
48
|
decimal: '.',
|
|
@@ -72,8 +52,8 @@ if (!numeral.locales.es) {
|
|
|
72
52
|
currency: {},
|
|
73
53
|
});
|
|
74
54
|
}
|
|
75
|
-
if (!
|
|
76
|
-
|
|
55
|
+
if (!numeral_1.default.locales.fr) {
|
|
56
|
+
numeral_1.default.register('locale', 'fr', {
|
|
77
57
|
delimiters: {
|
|
78
58
|
thousands: ',',
|
|
79
59
|
decimal: '.',
|
|
@@ -83,8 +63,8 @@ if (!numeral.locales.fr) {
|
|
|
83
63
|
currency: {},
|
|
84
64
|
});
|
|
85
65
|
}
|
|
86
|
-
if (!
|
|
87
|
-
|
|
66
|
+
if (!numeral_1.default.locales.it) {
|
|
67
|
+
numeral_1.default.register('locale', 'it', {
|
|
88
68
|
delimiters: {
|
|
89
69
|
thousands: ',',
|
|
90
70
|
decimal: '.',
|
|
@@ -94,8 +74,8 @@ if (!numeral.locales.it) {
|
|
|
94
74
|
currency: {},
|
|
95
75
|
});
|
|
96
76
|
}
|
|
97
|
-
if (!
|
|
98
|
-
|
|
77
|
+
if (!numeral_1.default.locales.ro) {
|
|
78
|
+
numeral_1.default.register('locale', 'ro', {
|
|
99
79
|
delimiters: {
|
|
100
80
|
thousands: ',',
|
|
101
81
|
decimal: '.',
|
|
@@ -110,9 +90,9 @@ function formatDouble(value, options, locale) {
|
|
|
110
90
|
if ((0, validation_1.isEmpty)(value) || isNaN(value)) {
|
|
111
91
|
return null;
|
|
112
92
|
}
|
|
113
|
-
|
|
93
|
+
numeral_1.default.locale(locale);
|
|
114
94
|
if (Number.isInteger(value)) {
|
|
115
|
-
return
|
|
95
|
+
return (0, numeral_1.default)(value).format('0,0');
|
|
116
96
|
}
|
|
117
97
|
var maxDecimalsAfterComma = options && options.maxDecimalsAfterComma;
|
|
118
98
|
var exactDecimalsAfterComma = options && options.exactDecimalsAfterComma;
|
|
@@ -122,7 +102,7 @@ function formatDouble(value, options, locale) {
|
|
|
122
102
|
: decimalsAfterCommaInValue;
|
|
123
103
|
var finalNumberOfDecimalsAfterComma = exactDecimalsAfterComma || numberOfDecimalsAfterComma;
|
|
124
104
|
var decimals = '0'.repeat(finalNumberOfDecimalsAfterComma);
|
|
125
|
-
return
|
|
105
|
+
return (0, numeral_1.default)(value).format("0,0.".concat(decimals));
|
|
126
106
|
}
|
|
127
107
|
exports.formatDouble = formatDouble;
|
|
128
108
|
var moment_1 = require("./moment");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/helpers/formatters.ts"],"names":[],"mapp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A,UAAU,OAAA;AAAE,sGAAA,YAAY,OAAA"}
|
package/lib/helpers/guards.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/guards.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/helpers/index.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/index.js
CHANGED
|
File without changes
|
package/lib/helpers/index.js.map
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/helpers/isBrowser.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/helpers/math.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/math.js
CHANGED
|
File without changes
|
package/lib/helpers/math.js.map
CHANGED
|
File without changes
|
package/lib/helpers/moment.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/moment.js
CHANGED
|
File without changes
|