New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

js-brasil

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-brasil - npm Package Compare versions

Comparing version

to
1.4.0

dist/test/utils.js

6

dist/src/utils.js

@@ -73,6 +73,8 @@ "use strict";

function currencyToNumber(input) {
var vals = input.split(' ');
if (vals.length === 2) {
input = input.replace(/ /g, '');
if (input.indexOf('$') !== -1) {
var vals = input.split('$');
input = vals[1];
}
input = input.replace('%', '');
input = input.replace(/\./g, '').replace(',', '.');

@@ -79,0 +81,0 @@ return parseFloat(input);

{
"name": "js-brasil",
"version": "1.3.3",
"version": "1.4.0",
"description": "Javascript Utils para Brasil (cpf, cnpj...)",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -76,8 +76,12 @@ export function isPresent(obj: any): boolean {

export function currencyToNumber(input){
const vals = input.split(' ');
if(vals.length===2){
input = input.replace(/ /g,'');
if(input.indexOf('$')!==-1){
const vals = input.split('$');
input = vals[1];
}
input = input.replace('%','');
input = input.replace(/\./g,'').replace(',','.');
return parseFloat(input);
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display