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

@brazilian-utils/format-cnpj

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brazilian-utils/format-cnpj - npm Package Compare versions

Comparing version 0.1.5 to 0.1.7

2

dist/index.js

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

var r=14,e=[1,4],n=[7],i=[11];module.exports=function(u){if(!u)return"";var t=String(u).replace(/[^\d]/g,"");return t.slice(0,r).split("").reduce(function(r,u,c){var l=""+r+u;if(c!==t.length-1){if(e.includes(c))return l+".";if(n.includes(c))return l+"/";if(i.includes(c))return l+"-"}return l},"")};
function r(r){return r&&"object"==typeof r&&"default"in r?r.default:r}var e=r(require("@brazilian-utils/helper-only-numbers")),i=r(require("@brazilian-utils/helper-is-last-char")),u=14,n=[1,4],t=[7],l=[11];module.exports=function(r){if(!r)return"";var a=e(r);return a.slice(0,u).split("").reduce(function(r,e,u){var f=""+r+e;if(!i(u,a)){if(n.includes(u))return f+".";if(t.includes(u))return f+"/";if(l.includes(u))return f+"-"}return f},"")};
//# sourceMappingURL=index.js.map

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

var r=14,e=[1,4],n=[7],i=[11];export default function(t){if(!t)return"";var u=String(t).replace(/[^\d]/g,"");return u.slice(0,r).split("").reduce(function(r,t,c){var f=""+r+t;if(c!==u.length-1){if(e.includes(c))return f+".";if(n.includes(c))return f+"/";if(i.includes(c))return f+"-"}return f},"")};
import r from"@brazilian-utils/helper-only-numbers";import i from"@brazilian-utils/helper-is-last-char";var e=14,n=[1,4],t=[7],u=[11];export default function(l){if(!l)return"";var a=r(l);return a.slice(0,e).split("").reduce(function(r,e,l){var f=""+r+e;if(!i(l,a)){if(n.includes(l))return f+".";if(t.includes(l))return f+"/";if(u.includes(l))return f+"-"}return f},"")};
//# sourceMappingURL=index.m.js.map

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.formatCnpj=n()}(this,function(){var e=14,n=[1,4],r=[7],t=[11];return function(i){if(!i)return"";var u=String(i).replace(/[^\d]/g,"");return u.slice(0,e).split("").reduce(function(e,i,f){var o=""+e+i;if(f!==u.length-1){if(n.includes(f))return o+".";if(r.includes(f))return o+"/";if(t.includes(f))return o+"-"}return o},"")}});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("@brazilian-utils/helper-only-numbers"),require("@brazilian-utils/helper-is-last-char")):"function"==typeof define&&define.amd?define(["@brazilian-utils/helper-only-numbers","@brazilian-utils/helper-is-last-char"],r):e.formatCnpj=r(null,null)}(this,function(e,r){e=e&&e.hasOwnProperty("default")?e.default:e,r=r&&r.hasOwnProperty("default")?r.default:r;var n=14,i=[1,4],t=[7],u=[11];return function(l){if(!l)return"";var a=e(l);return a.slice(0,n).split("").reduce(function(e,n,l){var f=""+e+n;if(!r(l,a)){if(i.includes(l))return f+".";if(t.includes(l))return f+"/";if(u.includes(l))return f+"-"}return f},"")}});
//# sourceMappingURL=index.umd.js.map
{
"name": "@brazilian-utils/format-cnpj",
"description": "Return CNPJ formatted with mask.",
"version": "0.1.5",
"version": "0.1.7",
"main": "dist/index.js",

@@ -31,7 +31,7 @@ "umd:main": "dist/index.umd.js",

"devDependencies": {
"microbundle": "^0.4.4"
"microbundle": "^0.5.1"
},
"dependencies": {
"@brazilian-utils/helper-is-last-char": "^0.1.3",
"@brazilian-utils/helper-only-numbers": "^0.1.1"
"@brazilian-utils/helper-is-last-char": "^0.1.5",
"@brazilian-utils/helper-only-numbers": "^0.1.3"
},

@@ -38,0 +38,0 @@ "publishConfig": {

@@ -21,9 +21,9 @@ # @brazilian-utils/format-cnpj

```js
import formatcnpj from '@brazilian-utils/format-cnpj';
import formatCnpj from '@brazilian-utils/format-cnpj';
formatcnpj('46'); // 46
formatcnpj('468'); // 46.8
formatcnpj('468434'); // 46.843.4
formatcnpj('468434850'); // 46.843.485/0
formatcnpj('46843485000186'); // 46.843.485/0001-86
formatCnpj('46'); // 46
formatCnpj('468'); // 46.8
formatCnpj('468434'); // 46.843.4
formatCnpj('468434850'); // 46.843.485/0
formatCnpj('46843485000186'); // 46.843.485/0001-86
```

Sorry, the diff of this file is not supported yet

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