Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

english-ordinals

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

english-ordinals - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

2

dist/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc