Brazilian Values Versions Save

🇧🇷 Funções de formatação, conversão e validação para valores, documentos e outras unidades usadas no Brasil. Como CEP, CNPJ, CPF, BRL (R$), datas, números etc.

0.13.0

11 months ago

Minor Changes

  • Add formatToHiddenDigits format to hide digits using received range and hider character.

    formatToHiddenDigits('00.000-000')
    //=> '**.*00-000'
    
    formatToHiddenDigits('03/04/2002', { hider: '-' })
    //=> '--/-4/2002'
    
    formatToHiddenDigits('111.111.111-11', { range: [4, 9] })
    //=> '111.***.***-11'
    
    formatToHiddenDigits('12.345.678-9', { hider: '#', range: 5 })
    //=> '##.###.678-9'
    
    formatToHiddenDigits('52.715.348/0001-69', { hider: '@', range: -9 })
    //=> '52.715.@@@/@@@@-@@'
    

    Thanks to @dchueri for PR #61.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.12.0...0.13.0

0.12.0

1 year ago

Minor Changes

  • Add isCAEPF validator that checks if value is a valid CAEPF.

    isCAEPF('45723174000122')
    //=> true
    
    isCAEPF('457.231.740/001-22')
    //=> false
    
    isCAEPF('45.723.174/0001-22')
    //=> false
    
    isCAEPF('411407182')
    //=> false
    
    isCAEPF('111.111.111/111-11')
    //=> false
    
  • Add formatToCAEPF formatter that formats a text containing numbers to CAEPF.

    formatToCAEPF('128781')
    //=> '128.781'
    
    formatToCAEPF('32284981000150')
    //=> '322.849.810/001-50'
    
    formatToCAEPF('00.0.000.00.00--00-00')
    //=> '000.000.000/000-00'
    

    Thanks to @kramer2005 for PR #54.

  • Add support for nodenext module type (for TS consumers).

Patch Changes

  • Fix typo in getRemaining helper function name.

  • Fix typo in isCEP english docs.

  • Fix isCNPJ TSDocs wrongly saying it formats to CPF.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.11.0-beta.0...0.12.0

0.11.0-beta.0

1 year ago

Minor Changes

  • Add support to Node.js using type: "module" and/or .mjs files.

    Thanks to @guilhermetelles for helping and testing.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.10.1...0.11.0-beta.0

0.10.1

3 years ago

Patch Changes

  • Fix a bug in NPM that doesn't published dist/ and types/ directories.

    Thanks to @guilhermetelles for pointed me that.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.10.0...0.10.1

0.10.0

3 years ago

Minor Changes

  • Add support to date with time in parseToDate parser function.

    parseToDate('28/03/1996')
    //=> Date('1996-03-28T03:00:00.000Z')
    
    parseToDate('28/03/1996 20:00')
    //=> Date('1996-03-28T23:00:00.000Z')
    
    parseToDate('28/03/1996 20:00:00')
    //=> Date('1996-03-28T23:00:00.000Z')
    
    parseToDate('31/02/2018')
    //=> throws Error('Value "31/02/2018" is an invalid date.')
    

    Thanks to @mechamobau for PR #41 that fixed issue #23.

Patch Changes

  • Upgrade devDependencies.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.9.1...0.10.0

0.9.1

3 years ago

Patch Changes

  • Add isCPFOrCNPJ docs to both portuguese and english README.md docs.
  • Move Docker section to Contribuindo.
  • Create a new summary with <details>/<summary> elements.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.9.0...0.9.1

0.9.0

3 years ago

Minor Changes

  • Add isCPFOrCNPJ validator that checks if value ir either a valid CPF or a valid CNPJ.

    isCPFOrCNPJ('366.418.768-70')
    //=> true
    
    isCPFOrCNPJ('45.723.174/0001-10')
    //=> true
    
    isCPFOrCNPJ('411407182')
    //=> false
    
    isCPFOrCNPJ('11.111.111/1111-11')
    //=> false
    

    Thanks to @roziscoding for PR #39 that fixed issue #27.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.8.0...0.9.0

0.8.0

3 years ago

Minor Changes

  • Add option to disable trim trailing white-spaces on formatToCapitalized (it fixes #38).

    formatToCapitalized(' com espaços no início e no fim ', {
      trimTrailingWhiteSpaces: false
    })
    //=> ' Com Espaços no Início e no Fim '
    

    Thanks to @guitexa for issue #38.

  • Removed banner (a comment with library, author and license information) from bundles due to egoist/bili#346.

All the changes

https://github.com/VitorLuizC/brazilian-values/compare/0.7.6...0.8.0

0.7.6

3 years ago

Patch Changes

  • Upgrade devDependencies.

0.7.5

3 years ago

Patch Changes

  • Upgrade devDependencies.