Comparing version 3.3.2 to 3.4.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [3.4.0](https://github.com/mastermunj/to-words/compare/v3.3.2...v3.4.0) (2023-01-17) | ||
### Features | ||
* **locale:** add support to pt-BR locale ([b4061ef](https://github.com/mastermunj/to-words/commit/b4061ef0f55091e2fcea2834e893f1c14c860ce4)) | ||
### [3.3.2](https://github.com/mastermunj/to-words/compare/v3.3.1...v3.3.2) (2022-12-16) | ||
@@ -7,0 +14,0 @@ |
@@ -21,2 +21,3 @@ "use strict"; | ||
const mr_IN_1 = __importDefault(require("./locales/mr-IN")); | ||
const pt_BR_1 = __importDefault(require("./locales/pt-BR")); | ||
const tr_TR_1 = __importDefault(require("./locales/tr-TR")); | ||
@@ -71,2 +72,4 @@ const nl_SR_1 = __importDefault(require("./locales/nl-SR")); | ||
return mr_IN_1.default; | ||
case 'pt-BR': | ||
return pt_BR_1.default; | ||
case 'tr-TR': | ||
@@ -194,3 +197,3 @@ return tr_TR_1.default; | ||
convertInternal(number) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; | ||
const locale = this.getLocale(); | ||
@@ -234,3 +237,5 @@ if (locale.config.exactWordsMapping) { | ||
if ((_l = (_k = locale.config) === null || _k === void 0 ? void 0 : _k.splitWord) === null || _l === void 0 ? void 0 : _l.length) { | ||
words.push(locale.config.splitWord); | ||
if (!((_o = (_m = locale.config) === null || _m === void 0 ? void 0 : _m.noSplitWordAfter) === null || _o === void 0 ? void 0 : _o.find((word) => word === match.value))) { | ||
words.push(locale.config.splitWord); | ||
} | ||
} | ||
@@ -237,0 +242,0 @@ words.push(...this.convertInternal(remainder)); |
@@ -46,2 +46,3 @@ export interface CurrencyOptions { | ||
pluralWords?: string[]; | ||
noSplitWordAfter?: string[]; | ||
}; | ||
@@ -48,0 +49,0 @@ export interface LocaleInterface { |
{ | ||
"name": "to-words", | ||
"version": "3.3.2", | ||
"version": "3.4.0", | ||
"description": "Converts numbers (including decimal points) into words & currency.", | ||
@@ -44,26 +44,26 @@ "keywords": [ | ||
"devDependencies": { | ||
"@commitlint/cli": "^17.3.0", | ||
"@commitlint/config-conventional": "^17.3.0", | ||
"@types/jest": "^29.2.4", | ||
"@commitlint/cli": "^17.4.2", | ||
"@commitlint/config-conventional": "^17.4.2", | ||
"@types/jest": "^29.2.5", | ||
"@types/lodash": "^4.14.191", | ||
"@types/node": "^18.11.15", | ||
"@types/node": "^18.11.18", | ||
"@types/source-map-support": "^0.5.6", | ||
"@typescript-eslint/eslint-plugin": "^5.46.1", | ||
"@typescript-eslint/parser": "^5.46.1", | ||
"@typescript-eslint/eslint-plugin": "^5.48.2", | ||
"@typescript-eslint/parser": "^5.48.2", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.29.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^27.1.7", | ||
"eslint": "^8.32.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-jest": "^27.2.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"husky": "^8.0.2", | ||
"husky": "^8.0.3", | ||
"jest": "^29.3.1", | ||
"lint-staged": "^13.1.0", | ||
"lodash": "^4.17.21", | ||
"prettier": "^2.8.1", | ||
"rimraf": "^3.0.2", | ||
"prettier": "^2.8.3", | ||
"rimraf": "^4.1.0", | ||
"sort-package-json": "^1.57.0", | ||
"source-map-support": "^0.5.21", | ||
"standard-version": "^9.5.0", | ||
"ts-jest": "^29.0.3", | ||
"ts-jest": "^29.0.5", | ||
"typescript": "^4.9.4" | ||
@@ -70,0 +70,0 @@ }, |
@@ -123,2 +123,3 @@ # Number to Words | ||
| Suriname | Dutch | nl-SR | | ||
| Brazil | Portuguese | pt-BR | | ||
| Turkey | Turkish | tr-TR | | ||
@@ -125,0 +126,0 @@ |
@@ -16,2 +16,3 @@ import { ConstructorOf, ConverterOptions, LocaleInterface, NumberWordMap, ToWordsOptions } from './types'; | ||
import mrIn from './locales/mr-IN'; | ||
import ptBR from './locales/pt-BR'; | ||
import trTr from './locales/tr-TR'; | ||
@@ -72,2 +73,4 @@ import nlSr from './locales/nl-SR'; | ||
return mrIn; | ||
case 'pt-BR': | ||
return ptBR; | ||
case 'tr-TR': | ||
@@ -252,3 +255,5 @@ return trTr; | ||
if (locale.config?.splitWord?.length) { | ||
words.push(locale.config.splitWord); | ||
if (!locale.config?.noSplitWordAfter?.find((word) => word === match.value)) { | ||
words.push(locale.config.splitWord); | ||
} | ||
} | ||
@@ -255,0 +260,0 @@ words.push(...this.convertInternal(remainder)); |
@@ -51,2 +51,3 @@ export interface CurrencyOptions { | ||
pluralWords?: string[]; | ||
noSplitWordAfter?: string[]; | ||
}; | ||
@@ -53,0 +54,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
305101
92
7144
129