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

@codecompose/words-to-numbers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codecompose/words-to-numbers - npm Package Compare versions

Comparing version 2.0.0-0 to 2.0.0

2

package.json
{
"name": "@codecompose/words-to-numbers",
"description": "Convert textual words to numbers with optional fuzzy text matching",
"version": "2.0.0-0",
"version": "2.0.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "type": "module",

@@ -5,18 +5,26 @@ # Words To Numbers

[words-from-numbers](https://github.com/finnfiddle/words-to-numbers) because the
project seems abandoned. This fork:
project seems abandoned.
- Fixes the manifest and makes it a pure ESM package
- Removes old dependencies and Babel transpilation
- Uses Vitest to replace old testing tools
- Upgrades clj-fuzzy to latest version
The codebase was modernized and published under 2.0 with the following changes:
- Fix the invalid package manifest
- Remove transpilation and make it
[pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
- Add Typescript
[type inference](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html)
- Remove obsolete and old dependencies
- Use Vitest to replace older testing tools
- Upgrade clj-fuzzy to latest version
- Add prettier formatting
- Replace NPM with PNPM
- Add basis for Typescript conversion
I might convert the code to Typescript later. PRs are welcome.
I might convert the code to Typescript later, but the code quality is pretty bad
and I am not sure it's worth it. PRs are welcome.
I have also replaced NPM with PNPM, which was unnecessary but just personal
preference.
## Usage
```
npm install words-to-numbers
(p)npm install words-to-numbers
```

@@ -23,0 +31,0 @@

@@ -5,13 +5,17 @@ import { expect, it } from "vitest";

/**
* Extra tests according for reported issues
* Extra tests for reported issues
*/
it("thirty five thousand", () => {
expect(wtn("thirty five thousand")).to.equal(35000);
});
// it("thirty five thousand", () => {
// expect(wtn("thirty five thousand")).to.equal(35000);
// });
it("one hundred and fifty thousand dollars", () => {
expect(wtn("one hundred and fifty thousand dollars")).to.equal(150000);
});
// it("one hundred and fifty thousand dollars", () => {
// expect(wtn("one hundred and fifty thousand dollars")).to.equal(150000);
// });
// it("twenty-one thousand five hundred seventy-six", () => {
// expect(wtn("twenty-one thousand five hundred seventy-six")).to.equal(21576);
// });
/**

@@ -18,0 +22,0 @@ * Original tests

@@ -1,2 +0,1 @@

/* eslint-disable no-extra-parens */
import {

@@ -213,2 +212,5 @@ BLACKLIST_SINGULAR_WORDS,

let i = 0;
/**
* @type {{start: number, end: number, tokens: string[], hasDecimal?: boolean} | null}
*/
let currentRegion;

@@ -281,3 +283,3 @@ const tokensCount = tokens.length;

lowerCaseValue: unfuzzyChunk.toLowerCase(),
type: getTokenType(unfuzzyChunk, options),
type: getTokenType(unfuzzyChunk),
})

@@ -284,0 +286,0 @@ : acc;

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