any-number-to-words
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -1,2 +0,9 @@ | ||
export default class { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
class _default { | ||
constructor(settings) { | ||
@@ -96,2 +103,5 @@ this.settings = settings; | ||
} | ||
} | ||
exports.default = _default; | ||
module.exports = exports.default; |
@@ -1,9 +0,40 @@ | ||
import Engine from "./engine.js"; | ||
import { parseNumberString } from "./utils.js"; | ||
import defaultLocale from "./locales/en-us.js"; | ||
export { default as enUS } from "./locales/en-us.js"; | ||
export { default as bnBD } from "./locales/bn-bd.js"; | ||
export { default as hiIN } from "./locales/hi-in.js"; | ||
export class Converter { | ||
constructor(locale = defaultLocale) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "enUS", { | ||
enumerable: true, | ||
get: function () { | ||
return _enUs.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "bnBD", { | ||
enumerable: true, | ||
get: function () { | ||
return _bnBd.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "hiIN", { | ||
enumerable: true, | ||
get: function () { | ||
return _hiIn.default; | ||
} | ||
}); | ||
exports.Converter = void 0; | ||
var _engine = _interopRequireDefault(require("./engine.js")); | ||
var _utils = require("./utils.js"); | ||
var _enUs = _interopRequireDefault(require("./locales/en-us.js")); | ||
var _bnBd = _interopRequireDefault(require("./locales/bn-bd.js")); | ||
var _hiIn = _interopRequireDefault(require("./locales/hi-in.js")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
class Converter { | ||
constructor(locale = _enUs.default) { | ||
this.locale = locale; | ||
@@ -13,4 +44,4 @@ } | ||
toWords(number, settings = {}) { | ||
const numberParsed = parseNumberString(`${number}`); | ||
const engine = new Engine(this.locale); | ||
const numberParsed = (0, _utils.parseNumberString)(`${number}`); | ||
const engine = new _engine.default(this.locale); | ||
const mergedLocale = { ...this.locale, | ||
@@ -32,2 +63,4 @@ ...settings | ||
} | ||
} | ||
exports.Converter = Converter; |
@@ -1,2 +0,8 @@ | ||
export default { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _default = { | ||
names: { | ||
@@ -17,2 +23,4 @@ zeroTo99: ["শূন্য", "এক", "দুই", "তিন", "চার", "পাঁচ", "ছয়", "সাত", "আট", "নয়", "দশ", "এগারো", "বারো", "তেরো", "চৌদ্দ", "পনেরো", "ষোলো", "সতেরো", "আঠারো", "উনিশ", "বিশ", "একুশ", "বাইশ", "তেইশ", "চব্বিশ", "পঁচিশ", "ছাব্বিশ", "সাতাশ", "আটাশ", "ঊনত্রিশ", "ত্রিশ", "একত্রিশ", "বত্রিশ", "তেত্রিশ", "চৌত্রিশ", "পঁয়ত্রিশ", "ছত্রিশ", "সাঁইত্রিশ", "আটত্রিশ", "ঊনচল্লিশ", "চল্লিশ", "একচল্লিশ", "বিয়াল্লিশ", "তেতাল্লিশ", "চুয়াল্লিশ", "পঁয়তাল্লিশ", "ছেচল্লিশ", "সাতচল্লিশ", "আটচল্লিশ", "ঊনপঞ্চাশ", "পঞ্চাশ", "একান্ন", "বাহান্ন", "তিপ্পান্ন", "চুয়ান্ন", "পঞ্চান্ন", "ছাপ্পান্ন", "সাতান্ন", "আটান্ন", "ঊনষাট", "ষাট", "একষট্টি", "বাষট্টি", "তেষট্টি", "চৌষট্টি", "পঁয়ষট্টি", "ছেষট্টি", "সাতষট্টি", "আটষট্টি", "ঊনসত্তর", "সত্তর", "একাত্তর", "বাহাত্তর", "তিয়াত্তর", "চুয়াত্তর", "পঁচাত্তর", "ছিয়াত্তর", "সাতাত্তর", "আটাত্তর", "ঊনআশি", "আশি", "একাশি", "বিরাশি", "তিরাশি", "চুরাশি", "পঁচাশি", "ছিয়াশি", "সাতাশি", "আটাশি", "ঊননব্বই", "নব্বই", "একানব্বই", "বিরানব্বই", "তিরানব্বই", "চুরানব্বই", "পঁচানব্বই", "ছিয়ানব্বই", "সাতানব্বই", "আটানব্বই", "নিরানব্বই"], | ||
comma: false | ||
}; | ||
}; | ||
exports.default = _default; | ||
module.exports = exports.default; |
@@ -1,2 +0,8 @@ | ||
export default { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _default = { | ||
names: { | ||
@@ -134,2 +140,4 @@ zeroTo99: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven", "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three", "thirty-four", "thirty-five", "thirty-six", "thirty-seven", "thirty-eight", "thirty-nine", "forty", "forty-one", "forty-two", "forty-three", "forty-four", "forty-five", "forty-six", "forty-seven", "forty-eight", "forty-nine", "fifty", "fifty-one", "fifty-two", "fifty-three", "fifty-four", "fifty-five", "fifty-six", "fifty-seven", "fifty-eight", "fifty-nine", "sixty", "sixty-one", "sixty-two", "sixty-three", "sixty-four", "sixty-five", "sixty-six", "sixty-seven", "sixty-eight", "sixty-nine", "seventy", "seventy-one", "seventy-two", "seventy-three", "seventy-four", "seventy-five", "seventy-six", "seventy-seven", "seventy-eight", "seventy-nine", "eighty", "eighty-one", "eighty-two", "eighty-three", "eighty-four", "eighty-five", "eighty-six", "eighty-seven", "eighty-eight", "eighty-nine", "ninety", "ninety-one", "ninety-two", "ninety-three", "ninety-four", "ninety-five", "ninety-six", "ninety-seven", "ninety-eight", "ninety-nine"], | ||
comma: false | ||
}; | ||
}; | ||
exports.default = _default; | ||
module.exports = exports.default; |
@@ -1,2 +0,8 @@ | ||
export default { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _default = { | ||
names: { | ||
@@ -20,2 +26,4 @@ zeroTo99: ["शून्य", "एक", "दो", "तीन", "चार", "पाँच", "छः", "सात", "आठ", "नौ", "दस", "ग्यारह", "बारह", "तेरह", "चौदह", "पंद्रह", "सोलह", "सत्रह", "अट्ठारह", "उन्नीस", "बीस", "इक्कीस", "बाईस", "तेईस", "चौबिस", "पच्चीस", "छब्बीस", "सत्ताईस", "अट्ठाईस", "उनतीस", "तीस", "इकतीस", "बत्तीस", "तैंतीस", "चौंतीस", "पैंतीस", "छत्तीस", "सैंतीस", "अड़तीस", "उनतालीस", "चालीस", "इकतालीस", "बयालीस", "तैंतालीस", "चौंतालीस", "पैंतालीस", "छियालीस", "सैंतालीस", "अड़तालीस", "उनचास", "पचास", "इक्यावन", "बावन", "तिरेपन", "चौवन", "पचपन", "छप्पन", "सत्तावन", "अट्ठावन", "उनसठ", "साठ", "इकसठ", "बासठ", "तिरेसठ", "चौंसठ", "पैंसठ", "छयासठ", "सरसठ", "अड़सठ", "उनहत्तर", "सत्तर", "इकहत्तर", "बहत्तर", "तिहत्तर", "चौहत्तर", "पचहत्तर", "छिहत्तर", "सतहत्तर", "अठहत्तर", "उन्यासी", "अस्सी", "इक्यासी", "बयासी", "तिरासी", "चौरासी", "पचासी", "छियासी", "सत्तासी", "अठासी", "नवासी", "नब्बे", "इक्यानवे", "बानवे", "तिरानवे", "चौरानवे", "पचानवे", "छियानवे", "सत्तानवे", "अट्ठानवे", "निन्यानवे"], | ||
comma: false | ||
}; | ||
}; | ||
exports.default = _default; | ||
module.exports = exports.default; |
@@ -1,2 +0,9 @@ | ||
export function parseNumberString(str) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.parseNumberString = parseNumberString; | ||
function parseNumberString(str) { | ||
const numberPattern = /^(?<sign>[+\-])?(?<number>\d+(\.\d*)?|\.\d+)([eE](?<exponent>[+\-]?\d+))?$/; | ||
@@ -3,0 +10,0 @@ const match = str.match(numberPattern); |
{ | ||
"name": "any-number-to-words", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "A string based number to word converter that can convert pretty large numbers to words in several locales. String is it's limit.", | ||
@@ -5,0 +5,0 @@ "main": "cjs/index.js", |
@@ -81,2 +81,5 @@ # Any number to words | ||
## Change Log | ||
#### Version 2.0.5 | ||
* Added `babel.config.json` file which I forgot to add. | ||
#### Version 2.0.4 | ||
@@ -83,0 +86,0 @@ * Fixed the bug of not translating minus sign for non en-us locales. |
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
33028
16
610
105