Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
09408b1
feat(cnae,ncm): add the pad option to formatCnae and formatNcm
hyanmandian Sep 13, 2026
4645f54
fix(holidays): add the GO and DF state entries, end PB 26/07 in 2015 …
hyanmandian Sep 13, 2026
7cb4fed
test(runtime): honour the vitest mockClear semantics and rethrow matc…
hyanmandian Sep 13, 2026
688359f
feat(business-days): follow the date-fns signatures and add subBusine…
hyanmandian Sep 13, 2026
898186f
fix(registro-profissional): read T and S as transfer suffixes after t…
hyanmandian Sep 13, 2026
3710dfa
test(ie): pin the 38 SINTEGRA worked examples and the prototype-key s…
hyanmandian Sep 13, 2026
e9e8eba
refactor(municipality): keep collapsing whitespace runs in name looku…
hyanmandian Sep 13, 2026
b6cb522
feat(capitalize): keep company designations, roman numerals and state…
hyanmandian Sep 13, 2026
c9f5a5e
fix(currency): coerce a non-string value without throwing and read th…
hyanmandian Sep 13, 2026
e10f878
refactor(words): always return lower case, drop the case option
hyanmandian Sep 13, 2026
6f2b2e8
feat(types): export the public types from the subpath entries
hyanmandian Sep 13, 2026
40563db
ci(tree-shaking): fail the job when the base measurement fails
hyanmandian Sep 13, 2026
01b7d32
docs: cite the annexes, decrees and manuals behind the identifiers an…
hyanmandian Sep 13, 2026
033d6bd
fix(municipality): return a fresh pair and overload the return type o…
hyanmandian Sep 13, 2026
f0abf92
ci(datasets): validate both bank outputs before writing either file
hyanmandian Sep 13, 2026
89cb3d5
fix(holidays): move the Santa Catarina state holidays to Sunday per t…
hyanmandian Sep 13, 2026
e935499
docs: describe the acervo codes of art. 473, the arrecadação result a…
hyanmandian Sep 13, 2026
03e5c11
fix(business-days): return false from isBusinessDay for a non-string …
hyanmandian Sep 13, 2026
edf4577
fix(types): re-export the option and state types from the calendar an…
hyanmandian Sep 13, 2026
02bd64f
fix(cep): reject with the typed errors for a bad providers list, a mi…
hyanmandian Sep 13, 2026
aeef62c
fix(email): cap the final domain label at 63 letters
hyanmandian Sep 13, 2026
ee2f02b
fix(boleto): keep the fator de vencimento inside the first cycle for …
hyanmandian Sep 13, 2026
cfc5ed0
fix(service-phone): drop 112 and 911 and add 141 per the Anatel Ato 4…
hyanmandian Sep 13, 2026
7d23f3a
fix(nfe-key): return an empty string from formatNfeKey for a value th…
hyanmandian Sep 13, 2026
40bc6a8
fix(cst): accept a separator only after the origin digit
hyanmandian Sep 13, 2026
c16f096
fix(pix): reject a dynamic payload that carries a Pix Saque facilitator
hyanmandian Sep 13, 2026
f7eb3bb
fix(caepf): reject a repeated base like CEI and CNO do
hyanmandian Sep 13, 2026
fac0769
fix(cns,cei): accept a run of separators like the other document formats
hyanmandian Sep 13, 2026
95f1958
refactor(format): read the obfuscate option truthily like pad
hyanmandian Sep 13, 2026
af8a8bd
ci(datasets): reject a zero bank code and parse the NCM dates strictly
hyanmandian Sep 13, 2026
75f875d
ci(release): hide the CI and build sections from the changelog
hyanmandian Sep 13, 2026
b86b153
test: pin the published worked examples and the boleto moeda leniency
hyanmandian Sep 13, 2026
1d3aeb0
docs: cite the acts and ajustes behind the fiscal and calendar utilities
hyanmandian Sep 13, 2026
4d44ec4
fix(types): re-export the bank and state types from the eight subpath…
hyanmandian Sep 13, 2026
1a27003
fix(package): resolve the subpath declarations under moduleResolution…
hyanmandian Sep 13, 2026
da567b5
ci(tree-shaking): treat any unexpected exit code as a comparison failure
hyanmandian Sep 13, 2026
811cb10
feat(cep): declare the unidade, estado and regiao fields of the ViaCE…
hyanmandian Sep 13, 2026
eee5e88
test(business-days): pin the non-string state code rejection for an a…
hyanmandian Sep 13, 2026
e35bc22
docs: describe every option used in the examples and correct the rema…
hyanmandian Sep 13, 2026
ddf63fc
ci(tree-shaking): mark a missing build as a comparison failure and de…
hyanmandian Sep 13, 2026
68bc902
docs: put every cited URL on its own citation line and fill the thin …
hyanmandian Sep 13, 2026
1397171
ci(datasets): decode entities and require a complete CFOP annex befor…
hyanmandian Sep 13, 2026
1882ed8
test(cep): skip the live Widenet check while the service is offline
hyanmandian Sep 13, 2026
882cf95
docs(cep): say a CEP that starts with 0 has to be a string when given…
hyanmandian Sep 13, 2026
6d47c14
fix(words): write the groups the way the official texts do, without c…
hyanmandian Sep 13, 2026
214da0d
fix(csosn): read only the bare 3 digits, the code has no printed grou…
hyanmandian Sep 13, 2026
3600310
docs(business-days): name the includeOptional and stateCode options i…
hyanmandian Sep 13, 2026
33e27be
feat(cnpj): accept a branch number in generateCnpj
hyanmandian Sep 13, 2026
e46aa21
feat(renavam): add generateRenavam
hyanmandian Sep 13, 2026
defbdf8
feat(legal-nature): expose the CONCLA category and add getLegalNature…
hyanmandian Sep 13, 2026
af21b77
feat(phone): accept 7 and 8 as mobile first digits under version 2
hyanmandian Sep 13, 2026
77cf05b
ci: reference the setup action with the self-repository syntax
hyanmandian Sep 13, 2026
e879cb4
docs: state the measured isValidCpf size and fix two comments in the …
hyanmandian Sep 13, 2026
b928819
fix(format): never throw on a value without a string conversion
hyanmandian Sep 14, 2026
e676688
feat(format): mask the new formatters progressively like formatCpf an…
hyanmandian Sep 14, 2026
5ef48fd
fix(lookups): read a code the same way whether it comes as a string o…
hyanmandian Sep 14, 2026
0e38f5e
fix(validators): accept the CPF mask separators at the printed groups…
hyanmandian Sep 14, 2026
58d561b
fix(api): align the new utils with the library conventions
hyanmandian Sep 14, 2026
2bc3a09
refactor(api): name the structured readers get*Info, as getBoletoInfo…
hyanmandian Sep 14, 2026
72856eb
fix(area-codes): return regionName and regionCode from getAreaCodeInf…
hyanmandian Sep 14, 2026
c2dfcfa
feat(parse): add the mask-stripping parse function of every new family
hyanmandian Sep 14, 2026
6d3bd15
refactor(format): drop the nullish guards the safe sanitizer made red…
hyanmandian Sep 14, 2026
d892765
refactor(caepf): read the value through the safe sanitizer instead of…
hyanmandian Sep 14, 2026
d313bcc
docs(municipalities): deprecate getCities and getMunicipality in favo…
hyanmandian Sep 14, 2026
a941076
test(business-days): keep the never-throw walk of differenceInBusines…
hyanmandian Sep 14, 2026
154644b
feat(capitalize): break words at apostrophes and touching punctuation…
hyanmandian Sep 14, 2026
110bc12
fix(processo-juridico): check the órgão and tribunal codes against Re…
hyanmandian Sep 15, 2026
7565d3d
fix(capitalize): keep the English possessive, single-letter designato…
hyanmandian Sep 15, 2026
ca8d37d
fix(generate): never throw on a prototype key or an object without to…
hyanmandian Sep 15, 2026
5c8a9d4
docs(words): cite the articles of Lei 14.822/2024 that carry each spe…
hyanmandian Sep 15, 2026
8cb0a29
fix(types): keep the @deprecated tag of the 2.3.0 aliases in the decl…
hyanmandian Sep 15, 2026
0ed0edb
build(api): commit the API Extractor baseline so check:api fails on a…
hyanmandian Sep 15, 2026
8368612
build(data): make an unchanged Bacen list a no-op and format before t…
hyanmandian Sep 15, 2026
4e087c9
build(package): ship CHANGELOG.md in the tarball
hyanmandian Sep 15, 2026
6a33dea
docs: final pass before the release
hyanmandian Sep 15, 2026
d37ffb5
build(deps): update the toolchain to TypeScript 7 and the latest devD…
hyanmandian Sep 17, 2026
5b39a10
refactor: replace the three recursions with loops
hyanmandian Sep 17, 2026
d048c01
fix(holidays): cite each state holiday's law and name the Consciência…
hyanmandian Sep 17, 2026
b96ef0e
refactor(types): name the sole-argument object types Params and accep…
hyanmandian Sep 17, 2026
bb52cda
feat(legal-nature): mark the eight retired codes as legacy with their…
hyanmandian Sep 17, 2026
85d7a2e
fix(license-plate): fall back to the default format instead of using …
hyanmandian Sep 17, 2026
f7922c7
feat(banks): keep the codes that left the Bacen list as legacy banks
hyanmandian Sep 17, 2026
f77c7ad
refactor: simplify the internals and drop the dead code, output uncha…
hyanmandian Sep 17, 2026
4613b6d
fix(lookups): read includeLegacy for truthiness in getBanks and getLe…
hyanmandian Sep 17, 2026
8170689
docs: final pass on the docs, README, package metadata and GitHub files
hyanmandian Sep 17, 2026
27581f2
fix(capitalize): write ME as the pronoun after a hyphen and before a …
hyanmandian Sep 17, 2026
8a2a38e
fix(scripts): keep a retired bank code legacy when the dataset falls …
hyanmandian Sep 17, 2026
b5742b6
refactor(banks): list only what the Bacen STR participants list publi…
hyanmandian Sep 17, 2026
6804088
docs: align the README, migration guide, changelog header and release…
hyanmandian Sep 17, 2026
4013eb3
fix(capitalize): read a designation written around a slash as the des…
hyanmandian Sep 17, 2026
2433f90
fix(fetch): reject a retries count that is not an integer
hyanmandian Sep 17, 2026
bb7c578
test: run the Deno shim hooks and deep equality without recursion, ad…
hyanmandian Sep 17, 2026
6d0dce2
refactor: share the check digit arithmetic and drop the guards the sa…
hyanmandian Sep 17, 2026
aec89a6
fix(municipalities): keep a state code that is not a string out of th…
hyanmandian Sep 17, 2026
bb91be4
docs(readme): state the Node.js 24 development requirement, apart fro…
hyanmandian Sep 17, 2026
dab9da7
test(deno): compare cyclic values once in the shim's deep equality
hyanmandian Sep 17, 2026
5dd2a97
docs(site): move the docsify site to v5
hyanmandian Sep 17, 2026
bffdcd2
docs: group the utilities reference by family
hyanmandian Sep 17, 2026
edbc98e
docs: bring the v1 to v2 migration guide up to 2.4.0
hyanmandian Sep 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"login": "matAlmeida",
"name": "Matheus Almeida",
"avatar_url": "https://avatars3.githubusercontent.com/u/12724212?v=4",
"profile": "http://matalmeida.me",
"profile": "https://github.com/matAlmeida",
"contributions": ["code", "doc", "test"]
},
{
Expand Down Expand Up @@ -100,7 +100,7 @@
"login": "rfoel",
"name": "Rafael Franco",
"avatar_url": "https://avatars3.githubusercontent.com/u/19496473?v=4",
"profile": "https://rfoel.com",
"profile": "https://github.com/rfoel",
"contributions": ["code", "doc"]
},
{
Expand Down Expand Up @@ -163,7 +163,7 @@
"login": "marceloabk",
"name": "Marcelo Cristiano",
"avatar_url": "https://avatars3.githubusercontent.com/u/11621153?v=4",
"profile": "http://www.engenhandosoftware.com.br/",
"profile": "https://github.com/marceloabk",
"contributions": ["code", "doc", "test"]
},
{
Expand Down
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Code owners for this repository.
#
# @hyanmandian is the sole maintainer, so one catch-all rule covers everything.
# GitHub requests a review from the owner on every pull request that touches a
# matching path; combined with "Require review from Code Owners" in the branch
# protection rules for `main`, it makes that review mandatory.

* @hyanmandian
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
attributes:
label: Package version
description: Which version of `@brazilian-utils/brazilian-utils` are you using?
placeholder: "2.3.0"
placeholder: "2.4.0"
validations:
required: true

Expand Down Expand Up @@ -77,5 +77,5 @@ body:
options:
- label: I searched existing issues and this hasn't been reported yet.
required: true
- label: I'm using a version listed in [SECURITY.md](../../SECURITY.md#supported-versions) as supported.
- label: I'm using a version listed in [SECURITY.md](https://github.com/brazilian-utils/javascript/blob/main/SECURITY.md#supported-versions) as supported.
required: false
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
- [ ] I updated the documentation if this adds/changes a utility, in **both**:
- [ ] `docs/utilities.md` (English)
- [ ] `docs/pt-br/utilities.md` (Portuguese)
- [ ] `npm check` passes locally (format, lint, types).
- [ ] `npm run check` passes locally (format, lint, types).
- [ ] I ran `npm run build:llms` if I touched `docs/utilities.md` (the Check workflow fails when `docs/llms.txt` is stale).
- [ ] This change does not introduce a breaking change, **or** I flagged it clearly below and it was discussed with maintainers beforehand.
- [ ] This change does not add any runtime dependency (this library is zero-runtime-dependency by design).

Expand Down
7 changes: 7 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# actionlint 1.7.12 does not know GitHub's self-repository `uses: $/...` syntax yet
# (https://github.com/rhysd/actionlint/issues/711); zizmor's self-repository audit and the GitHub
# docs recommend it over the workspace-relative `./...` form. Drop this once actionlint supports it.
paths:
.github/workflows/**/*.yml:
ignore:
- 'specifying action "\$/\.github/actions/setup" in invalid format because ref is missing'
19 changes: 10 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Run build
run: vp run build
Expand All @@ -52,7 +52,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Checkout base
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -69,26 +69,27 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
id: base
run: |
if [ -f base/scripts/tree-shaking.ts ]; then
node scripts/tree-shaking.ts --json head.json
(cd base && npm ci && npm run build && node scripts/tree-shaking.ts --json ../base.json --surviving ../head.json) || true
fi
if [ -f base.json ]; then
echo "measured=true" >> "$GITHUB_OUTPUT"
else
if [ ! -f base/scripts/tree-shaking.ts ]; then
echo "measured=false" >> "$GITHUB_OUTPUT"
exit 0
fi
node scripts/tree-shaking.ts --json head.json
(cd base && npm ci && npm run build && node scripts/tree-shaking.ts --json ../base.json --surviving ../head.json)
echo "measured=true" >> "$GITHUB_OUTPUT"

- name: Compare against base
if: ${{ github.event_name == 'pull_request' }}
id: compare
continue-on-error: true
run: |
if [ "${{ steps.base.outputs.measured }}" = "true" ]; then
code=2
echo "code=$code" >> "$GITHUB_OUTPUT"
set +e
node scripts/tree-shaking.ts --compare base.json --markdown tree-shaking.md
code=$?
set -e
case "$code" in 0 | 1) ;; *) code=2 ;; esac
echo "code=$code" >> "$GITHUB_OUTPUT"
exit "$code"
else
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Run checks
run: vp check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Rebuild datasets
run: npm run build:data
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/live-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Run live CEP tests
run: vp run test:live
continue-on-error: false
11 changes: 10 additions & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Mutation test every file
if: ${{ github.event_name != 'push' }}
run: npm run test:mutation

# On `main` the dashboard reporter also publishes the score to dashboard.stryker-mutator.io;
# pull requests keep the local reporters only, so a fork never needs the key.
- name: Mutation test every file and publish the score
if: ${{ github.event_name == 'push' }}
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: npm run test:mutation -- --reporters clear-text,progress,html,json,dashboard

- name: Upload the mutation report
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup
with:
node-version: 24

Expand All @@ -104,6 +104,7 @@ jobs:
cat tree-shaking.md >> "$GITHUB_STEP_SUMMARY"

- name: Ensure npm supports staged publishing and OIDC (npm >= 11.15)
# zizmor: ignore[adhoc-packages] npm is pinned to an exact version and is not a package.json dependency
run: npm install -g npm@12.0.2

- name: Stage on npm
Expand All @@ -126,7 +127,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Generate the CycloneDX SBOM of the published package
# The package has no runtime dependencies, so the SBOM describes the package itself;
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
Expand All @@ -85,7 +85,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
Expand All @@ -110,7 +110,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Run tests in ${{ matrix.browser }}
run: vp test --browser.enabled --browser.name=${{ matrix.browser }}
Expand All @@ -127,7 +127,7 @@ jobs:
persist-credentials: false

- name: Setup
uses: ./.github/actions/setup
uses: $/.github/actions/setup

- name: Run tests in Safari
run: vp test --browser.enabled --browser.name=safari --browser.headless=false
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ node_modules
dist
coverage
.stryker-tmp
reports
# Every report is generated (stryker, coverage, jscpd) except the API Extractor baseline, which is
# committed so that `npm run check:api` compares the public API against the reviewed one instead of
# writing a new file on every run.
reports/*
!reports/api/
reports/api/*
!reports/api/brazilian-utils.api.md
9 changes: 4 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The entries are generated by [release-please](https://github.com/googleapis/release-please) from the
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) history, and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.0](https://github.com/brazilian-utils/javascript/compare/2.2.0...2.3.0) (2026-04-09)
## [2.3.0](https://github.com/brazilian-utils/javascript/compare/2.2.0...2.3.0) (2026-04-08)

### Features

Expand Down Expand Up @@ -193,5 +194,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- 🎡 adjust travis config ([0ec107f](https://github.com/brazilian-utils/javascript/commit/0ec107f1ebee536e15a6bb991750342457bf1a44))
- 🎡 rename travis file ([25da01e](https://github.com/brazilian-utils/javascript/commit/25da01e5c700c17c3e88217c4bf272f5eef5639a))

[Unreleased]: https://github.com/brazilian-utils/javascript/compare/2.3.0...HEAD
Loading
Loading