Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forked and released v2.0 #47

Open
0x80 opened this issue Mar 8, 2024 · 3 comments
Open

Forked and released v2.0 #47

0x80 opened this issue Mar 8, 2024 · 3 comments

Comments

@0x80
Copy link

0x80 commented Mar 8, 2024

My client's project depended on this and I didn't see an easy way to solve my transition to ESM to I have forked it and released version 2.0 with a big cleanup.

I have no desire to continue working on this, but in case anyone's interested you can find it here

https://github.com/0x80/words-to-numbers/releases/tag/v2.0.0

@csandman
Copy link

csandman commented Nov 8, 2024

Sorry to piggyback off of this, but I ended up forking your fork to further improve the project haha. I completely converted the source to TypeScript, removed the dependency on its-set (it uses lodash, and this package wasn't getting any use of it), and replaced the clj-fuzzy with a TypeScript supported alternative, @skyra/jaro-winkler. Also, I re-added CJS support by using tsup for bundling. Here's a link to my fork: https://github.com/insomnia-dev/words-to-numbers

During the conversion to TypeScript, I was able to clean up the code a decent bit, but the logic is still a bit confusing to me, so I'm not really the best person to fix the issues it has. I do think it's in a much better state to work on though!

@0x80
Copy link
Author

0x80 commented Nov 8, 2024

@csandman No need to apologize. All efforts towards improvement are welcome I think 👍

@csandman
Copy link

csandman commented Nov 8, 2024

@0x80 The weird thing is though, that after I converted to TypeScript, this test started failing:

/**
 * Failed after conversion to TypeScript (without any other changes)
 *
 * - Expected: `3000726`
 * - Received: `2.0000000000000004e+22`
 */
it("tree millyon sefen hunderd ant twinty sex", () => {
  expect(
    wtn("tree millyon sefen hunderd and twinty sex", { fuzzy: true })
  ).to.equal(3000726);
});

At first I thought I had broken something while modifying things, but then I tried just changing the file extensions in your fork to .ts, and it started failing without any other changes. I'll probably try and look into that, but it's not a case that I'd call super common anyway, so I'm not super worried about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants