Releases: VitorLuizC/brazilian-values
Version 0.7.4
Minor Changes
-
Add
formatToCPFOrCNPJ
to formatters. It formats astring
value containing numbers to CPF or CNPJ depending on its length.formatToCPFOrCNPJ('00000000') //=> '000.000.00' formatToCPFOrCNPJ('366.418.768-70') //=> '366.418.768-70' formatToCPFOrCNPJ('32284981000138') //=> '32.284.981/0001-38' formatToCPFOrCNPJ('00.0.000.00.00--00-00') //=> '00.000.000/0000-00'
All the changes
Versio 0.7.3
Minor Changes
-
Fix unit test importing bundled module instead of the source.
-
Reduce bundle size transpiling in TS instead of Babel.
-
Create a
tsconfig.bundle.json
just for bundle purposes and lettsconfig.json
more generic.
All the changes
Version 0.7.2
Minor Changes
-
Accept
99.999-999
as valid CEP format inisCEP
function.Thanks to @mathvaleriano for issue #26.
-
Upgrade
ava
to 3.1.0.
All the changes
Version 0.7.1
Minor Changes
-
Add sumary to
README.md
docs.Thanks a lot to @brunosalgueiro PR #24.
-
Upgrade devDependencies and fix their breaking changes.
All the changes
Version 0.7.0
Minor Changes (Features)
-
Create
formatToCapitalized
formatter to capitalize words in a text.formatToCapitalized('SERVIDOR PÚBLICO MUNICIPAL') //=> 'Servidor Público Municipal' formatToCapitalized(' os PrimEIROS HOMens da tERra', { wordsToKeepLowerCase: ['os', 'da'] }) //=> 'Os Primeiros Homens da Terra' formatToCapitalized('nova tv foi lançada', { wordsToKeepUpperCase: ['tv'] }) //=> 'Nova TV Foi Lançada'
Thanks a lot to @ymoreiratiti for issue #20 and PR #21.
All the changes
Version 0.6.0
Minor Changes (Features)
-
Create
isDDD
validator to check if value is a brazilian valid DDD (direct dialing at a distance) code.isDDD('19') //=> true isDDD('23') //=> false isDDD('255') //=> false
-
Create
isPhone
validator to check if value matches common brazilian phone number, optionally with DDI, DDD and the ninth digit. If DDD is defined it'll be validated withisDDD
.isPhone('+55 (11) 9 8273-1182') //=> true isPhone('11 39723768') //=> true isPhone('(23) 3972-3768') //=> false isPhone('(13) 6 5093-2093') //=> false
Thanks to @giulianon for issue #19.
Other Changes
-
Upgrade development dependencies (
ava
,rollup-plugin-typescript2
andtypescript
). -
Add License and bundlephobia.com badges to README.
All the changes
Version 0.5.2
Fixes
-
Fixed validation strategy that ignores invalid characters on
isCNPJ
,isCPF
andisCEP
.Thanks to @lucasbemol for issue #18.
-
Fixed
formatToDateTime
TSDoc example.
Changes
-
Upgrade development dependencies (
ava
,rollup-plugin-typescript2
andtypescript
). -
Keep consistent code style on tests.
All the changes
Version 0.5.1
Fixes
-
Fixed
formatToDateTime
example on README (pt-BR & en).Thanks to @rogeriomq for PR #17.
Changes
- Upgrade development dependencies (ava, bili, rollup-plugin-typescript2, ts-node and typescript).
Version 0.5.0
Breaking Changes
-
ESM bundles were renamed (due to
Bili
upgrade).- ESM bundle
dist/brazilian-values.mjs
is nowdist/brazilian-values.esm.js
;
- ESM bundle
-
README docs are now in portuguese, but you can switch to english.
Minor Changes (Features)
-
Create
formatToDateTime
formatter to formatDate
instance into brazilian formatted date and time,DD/MM/YYYY HH:mm
.new Date(1996, 2, 28, 20, 43) => '28/03/1996 20:48'
-
Create
isCEP
validator to check if value is a CEP.'02998-050' => true '912821-982' => false
-
Upgrade development dependencies (
ava
,bili
,rollup-plugin-typescript2
,ts-node
andtypescript
).
All the changes
Version 0.4.0
Breaking Changes
- Bundles and the main module were renamed (due to
Bili
upgrade).- Main module
index.js
is nowbrazilian-values.js
; - TS type definitions
types/index.d.ts
is nowtypes/brazilian-values.d.ts
; - CommonJS bundle
dist/brazilian-values.cjs.js
is nowdist/brazilian-values.js
; - ESM bundle
dist/brazilian-values.es.js
is nowdist/brazilian-values.mjs
; - UMD bundle
dist/brazilian-values.js
is nowdist/brazilian-values.umd.js
; - UMD minified bundle
dist/brazilian-values.min.js
is nowdist/brazilian-values.umd.min.js
;
- Main module
Minor Changes (Features)
-
Create
formatToNumber
function to format numbers into brazilian formatted numbers.2289.1323 => '2.289,1323'
-
Create
formatToList
function to format arrays of string elements into brazilian formatted lists.['Vitor', 'Lucas', 'Milena'] => 'Vitor, Lucas e Milena'
-
Create
parseToNumber
function to parse brazilian formatted numbers into numbers.'2.289,1323' => 2289.1323
-
Create
parseToArray
function to parse brazilian formatted lists into arrays of string elements.'Vitor, Lucas e Milena' => ['Vitor', 'Lucas', 'Milena']
-
Upgrade development dependencies (
ava
,bili
,rollup-plugin-typescript2
,ts-node
andtypescript
). -
Bili
configuration was moved to its own TS module and changed to matches4.x.x
specs.