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

@softwarerero/numbertoword

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@softwarerero/numbertoword - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

1

numberToWord.en.js

@@ -9,2 +9,3 @@ const H = require('./helpers.js')

if (unit === 3) return `thirteen`
if (unit === 5) return `fifteen`
if (unit === 8) return `eighteen`

@@ -11,0 +12,0 @@ return `${UNITS[unit]}teen`

@@ -9,3 +9,12 @@ const H = require('./helpers.js')

const DECADES3 = ['treinta', 'cuarenta', 'cincuenta', 'sesenta', 'setenta', 'ochenta', 'noventa']
const decade1 = (unit, units) => unit >= 5 ? `${DECADES1[6]}${units(unit, this)}` : DECADES1[unit]
// const decade1 = (unit, units) => unit >= 5 ? `${DECADES1[6]}${units(unit, this)}` : DECADES1[unit]
const decade1 = (unit, units) => {
console.log('decade1', unit, units, unit >= 5, DECADES1[6])
return unit >= 6 ? `${DECADES1[6]}${units(unit, this)}` : DECADES1[unit]
// unit >= 5 ? `DECADES1[6] : DECADES1[unit]
// if ()
// return `${DECADES1[6]}${units(unit, this)}`
// console.log(DECADES1[unit])
// return DECADES1[unit]
}

@@ -12,0 +21,0 @@ const deacadesAnd = (decade, unit) => unit > 0 ? `${DECADES3[decade]} y ${units(unit)}` : DECADES3[decade]

14

package.json
{
"name": "@softwarerero/numbertoword",
"version": "1.0.4",
"license": "MIT",
"version": "1.0.5",
"license": "ISC",
"description": "Convert numbers to words",
"repository": "https://github.com/softwarerero/numberToWord",
"scripts": {
"test": "mocha",
"testw": "mocha --watch"
},
"repository": {

@@ -15,4 +10,7 @@ "type": "git",

},
"scripts": {
"test": "node_modules/mocha/bin/mocha",
"testw": "node_modules/mocha/bin/mocha --watch"
},
"author": "El Softwarerero",
"license": "ISC",
"devDependencies": {

@@ -19,0 +17,0 @@ "mocha": "^6.2.1"

@@ -14,3 +14,3 @@ const assert = require('assert')

describe.only('numberToWord', () => {
describe('numberToWord', () => {
const equal = (no, text, language) => () => assert.equal(numberToWord(no, language), text)

@@ -17,0 +17,0 @@

@@ -16,2 +16,3 @@ const assert = require('assert')

it('11', equal(11, 'elf'))
it('15', equal(15, 'fünfzehn'))
it('18', equal(18, 'achtzehn'))

@@ -53,2 +54,3 @@ it('20', equal(20, 'zwanzig'))

it('1900020', equal(1900020, 'eine million neun hundert tausend zwanzig'))
it('1515015', equal(15015015, 'fünfzehn millionen fünfzehn tausend fünfzehn'))
})

@@ -55,0 +57,0 @@

@@ -16,2 +16,3 @@ const assert = require('assert')

it('11', equal(11, 'eleven'))
it('15', equal(15, 'fifteen'))
it('18', equal(18, 'eighteen'))

@@ -52,2 +53,3 @@ it('20', equal(20, 'twenty'))

it('1220000', equal(1220000, 'one million two hundred and twenty thousand'))
it('1515015', equal(15015015, 'fifteen millions fifteen thousand fifteen'))
})

@@ -54,0 +56,0 @@

@@ -16,2 +16,3 @@ const assert = require('assert')

it('11', equal(11, 'once'))
it('15', equal(15, 'quince'))
it('18', equal(18, 'dieciocho'))

@@ -54,2 +55,3 @@ it('20', equal(20, 'veinte'))

it('1220000', equal(1220000, 'un millon doscientosveinte mil'))
it('1515015', equal(15015015, 'quince millones quince mil quince'))
})

@@ -56,0 +58,0 @@

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