@typeolymp/utils 0.2.0 → 0.2.2
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/build/enums/NotificationType.d.ts +3 -0
- package/build/enums/NotificationType.js +8 -0
- package/build/enums/NotificationType.js.map +1 -0
- package/build/parsers/formatPrice.d.ts +2 -0
- package/build/parsers/formatPrice.js +8 -0
- package/build/parsers/formatPrice.js.map +1 -0
- package/build/parsers/getCurrencyByLocale.d.ts +2 -0
- package/build/parsers/getCurrencyByLocale.js +14 -0
- package/build/parsers/getCurrencyByLocale.js.map +1 -0
- package/build/parsers/getPricing.d.ts +5 -0
- package/build/parsers/getPricing.js +18 -0
- package/build/parsers/getPricing.js.map +1 -0
- package/build/parsers/index.d.ts +3 -0
- package/build/parsers/index.js +3 -0
- package/build/parsers/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationType = void 0;
|
|
4
|
+
var NotificationType;
|
|
5
|
+
(function (NotificationType) {
|
|
6
|
+
NotificationType["UPGRADE_ACCOUNT_REQUEST"] = "upgradeAccountRequest";
|
|
7
|
+
})(NotificationType = exports.NotificationType || (exports.NotificationType = {}));
|
|
8
|
+
//# sourceMappingURL=NotificationType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationType.js","sourceRoot":"","sources":["../../src/enums/NotificationType.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,qEAAiD,CAAA;AACnD,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatPrice = void 0;
|
|
4
|
+
var formatPrice = function (locale, currency, price) {
|
|
5
|
+
return new Intl.NumberFormat(locale, { style: "currency", currency: currency }).format(price);
|
|
6
|
+
};
|
|
7
|
+
exports.formatPrice = formatPrice;
|
|
8
|
+
//# sourceMappingURL=formatPrice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatPrice.js","sourceRoot":"","sources":["../../src/parsers/formatPrice.ts"],"names":[],"mappings":";;;AAEO,IAAM,WAAW,GAAG,UACzB,MAAc,EACd,QAAkB,EAClB,KAAa;IAEb,OAAA,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AAA5E,CAA4E,CAAC;AALlE,QAAA,WAAW,eAKuD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCurrencyByLocale = void 0;
|
|
4
|
+
var enums_1 = require("../enums");
|
|
5
|
+
var getCurrencyByLocale = function (locale) {
|
|
6
|
+
var _a;
|
|
7
|
+
var map = (_a = {},
|
|
8
|
+
_a[enums_1.Locale.NL_NL] = enums_1.Currency.EUR,
|
|
9
|
+
_a[enums_1.Locale.NL_BE] = enums_1.Currency.EUR,
|
|
10
|
+
_a);
|
|
11
|
+
return map[locale];
|
|
12
|
+
};
|
|
13
|
+
exports.getCurrencyByLocale = getCurrencyByLocale;
|
|
14
|
+
//# sourceMappingURL=getCurrencyByLocale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrencyByLocale.js","sourceRoot":"","sources":["../../src/parsers/getCurrencyByLocale.ts"],"names":[],"mappings":";;;AAAA,kCAA4C;AAErC,IAAM,mBAAmB,GAAG,UAAC,MAAc;;IAChD,IAAM,GAAG;QACP,GAAC,cAAM,CAAC,KAAK,IAAG,gBAAQ,CAAC,GAAG;QAC5B,GAAC,cAAM,CAAC,KAAK,IAAG,gBAAQ,CAAC,GAAG;WAC7B,CAAC;IAEF,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC,CAAC;AAPW,QAAA,mBAAmB,uBAO9B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPricing = void 0;
|
|
4
|
+
var enums_1 = require("../enums");
|
|
5
|
+
var getPricing = function (currency) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
var plans = (_a = {},
|
|
8
|
+
_a[enums_1.Plan.HOBBY] = { EUR: 0, GBP: 0, USD: 0 },
|
|
9
|
+
_a[enums_1.Plan.PROFESSIONAL] = { EUR: 14.95, GBP: 12.95, USD: 15.95 },
|
|
10
|
+
_a);
|
|
11
|
+
var pricing = (_b = {},
|
|
12
|
+
_b[enums_1.Plan.HOBBY] = plans.hobby[currency],
|
|
13
|
+
_b[enums_1.Plan.PROFESSIONAL] = plans.professional[currency],
|
|
14
|
+
_b);
|
|
15
|
+
return pricing;
|
|
16
|
+
};
|
|
17
|
+
exports.getPricing = getPricing;
|
|
18
|
+
//# sourceMappingURL=getPricing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPricing.js","sourceRoot":"","sources":["../../src/parsers/getPricing.ts"],"names":[],"mappings":";;;AAAA,kCAA0C;AAEnC,IAAM,UAAU,GAAG,UAAC,QAAkB;;IAC3C,IAAM,KAAK;QACT,GAAC,YAAI,CAAC,KAAK,IAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QACxC,GAAC,YAAI,CAAC,YAAY,IAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE;WAC5D,CAAC;IAEF,IAAM,OAAO;QACX,GAAC,YAAI,CAAC,KAAK,IAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnC,GAAC,YAAI,CAAC,YAAY,IAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC;WAClD,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"}
|
package/build/parsers/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
export * from "./formatPrice";
|
|
1
2
|
export * from "./getCountryByLocale";
|
|
2
3
|
export * from "./getCourseTranslationByLocale";
|
|
4
|
+
export * from "./getCurrencyByLocale";
|
|
3
5
|
export * from "./getKeyboardLayoutByLocale";
|
|
4
6
|
export * from "./getLanguageCodeByLocale";
|
|
5
7
|
export * from "./getCountryCodeByLocale";
|
|
6
8
|
export * from "./getNativeLanguageByLocale";
|
|
9
|
+
export * from "./getPricing";
|
package/build/parsers/index.js
CHANGED
|
@@ -14,10 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./formatPrice"), exports);
|
|
17
18
|
__exportStar(require("./getCountryByLocale"), exports);
|
|
18
19
|
__exportStar(require("./getCourseTranslationByLocale"), exports);
|
|
20
|
+
__exportStar(require("./getCurrencyByLocale"), exports);
|
|
19
21
|
__exportStar(require("./getKeyboardLayoutByLocale"), exports);
|
|
20
22
|
__exportStar(require("./getLanguageCodeByLocale"), exports);
|
|
21
23
|
__exportStar(require("./getCountryCodeByLocale"), exports);
|
|
22
24
|
__exportStar(require("./getNativeLanguageByLocale"), exports);
|
|
25
|
+
__exportStar(require("./getPricing"), exports);
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/parsers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,iEAA+C;AAC/C,8DAA4C;AAC5C,4DAA0C;AAC1C,2DAAyC;AACzC,8DAA4C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/parsers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,8DAA4C;AAC5C,4DAA0C;AAC1C,2DAAyC;AACzC,8DAA4C;AAC5C,+CAA6B"}
|