english-ordinals
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export declare function getOrdinal(val: number): string; | ||
export declare function getOrdinal(val: number): string | undefined; |
@@ -7,6 +7,9 @@ "use strict"; | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getOrdinal = void 0; | ||
// only import the exact file required (other it creates a huge browser bundle) | ||
const n2words = require("../../rosaenlg-n2words/dist/n2words_EN.js"); | ||
const n2words_EN_js_1 = __importDefault(require("../../rosaenlg-n2words/dist/n2words_EN.js")); | ||
/* | ||
@@ -36,3 +39,3 @@ more than largely inspired from https://github.com/marlun78/number-to-cardinal/blob/master/src/makeOrdinal.js | ||
function getOrdinal(val) { | ||
const cardinal = n2words(val, { lang: 'en' }); | ||
const cardinal = (0, n2words_EN_js_1.default)(val, { lang: 'en' }); | ||
// Ends with *00 (100, 1000, etc.) or *teen (13, 14, 15, 16, 17, 18, 19) | ||
@@ -49,2 +52,3 @@ if (ENDS_WITH_DOUBLE_ZERO_PATTERN.test(cardinal) || ENDS_WITH_TEEN_PATTERN.test(cardinal)) { | ||
return cardinal.replace(ENDS_WITH_ZERO_THROUGH_TWELVE_PATTERN, (_match, numberWord) => { | ||
// 'as' due to TypeScript 5 | ||
return ordinalLessThanThirteen[numberWord]; | ||
@@ -51,0 +55,0 @@ }); |
@@ -1,1 +0,6 @@ | ||
declare module 'n2words'; | ||
/** | ||
* @license | ||
* Copyright 2023 Ludan Stoecklé | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
declare module '*'; |
@@ -0,1 +1,7 @@ | ||
"use strict"; | ||
/** | ||
* @license | ||
* Copyright 2023 Ludan Stoecklé | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
//# sourceMappingURL=interfaces.js.map |
{ | ||
"name": "english-ordinals", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Ordinal numbers in English: 1 => first etc.", | ||
@@ -55,5 +55,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"rosaenlg-n2words": "3.1.0" | ||
"rosaenlg-n2words": "3.2.0" | ||
}, | ||
"gitHead": "11645a24749c02832b29d6ef71cdf943f89ea81a" | ||
"gitHead": "e4e8082280b13351e9b82b8ff49beebf56103ea9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
7463
78
1
+ Addedrosaenlg-n2words@3.2.0(transitive)
- Removedrosaenlg-n2words@3.1.0(transitive)
Updatedrosaenlg-n2words@3.2.0