Skip to content
Merged
4 changes: 2 additions & 2 deletions packages/cnpj-fmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ Every custom error includes the `CnpjFmt::Error` marker module. Domain failures

| Class | Inherits from | Category | Trigger condition |
|---|---|---|---|
| `CnpjFmt::TypeMismatchError` | `TypeError` (+ `include Error`) | API misuse | CNPJ input or option has the wrong data type |
| `CnpjFmt::InvalidArgumentCombinationError` | `ArgumentError` (+ `include Error`) | API misuse | Both an `options` instance/`Hash` and keyword arguments are passed at once |
| `CnpjFmt::TypeMismatchError` | `TypeError` (+ `include Error`) | API misuse | CNPJ input or option has the wrong data type |
| `CnpjFmt::InvalidLengthError` | `CnpjFmt::DomainError` | Domain error | Sanitized length is not exactly 14 (passed to `on_fail` as `DomainError`) |
| `CnpjFmt::OutOfRangeError` | `CnpjFmt::DomainError` | Domain error | `hidden_start` / `hidden_end` outside `0`–`13` |
| `CnpjFmt::ValidationError` | `CnpjFmt::DomainError` | Domain error | Key option contains a disallowed character |
Expand Down Expand Up @@ -431,7 +431,7 @@ After `require 'cnpj-fmt'`:
- **`CnpjFmt::CnpjFormatterOptions`**: Class holding options; supports merge via constructor, `set`, and keyword arguments.
- **`CnpjFmt::CNPJ_LENGTH`**: `14` (constant).
- **`CnpjFmt::VERSION`**: gem version string.
- **Errors**: `CnpjFmt::Error`, `CnpjFmt::DomainError`, `CnpjFmt::TypeMismatchError`, `CnpjFmt::InvalidArgumentCombinationError`, `CnpjFmt::InvalidLengthError`, `CnpjFmt::OutOfRangeError`, `CnpjFmt::ValidationError`.
- **Errors**: `CnpjFmt::Error`, `CnpjFmt::DomainError`, `CnpjFmt::InvalidArgumentCombinationError`, `CnpjFmt::TypeMismatchError`, `CnpjFmt::InvalidLengthError`, `CnpjFmt::OutOfRangeError`, `CnpjFmt::ValidationError`.

### Other available resources

Expand Down
4 changes: 2 additions & 2 deletions packages/cnpj-fmt/README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ Todo erro customizado inclui o módulo marcador `CnpjFmt::Error`. Falhas de dom

| Classe | Herda de | Categoria | Condição de disparo |
|---|---|---|---|
| `CnpjFmt::TypeMismatchError` | `TypeError` (+ `include Error`) | Uso incorreto da API | Entrada de CNPJ ou opção com tipo de dado incorreto |
| `CnpjFmt::InvalidArgumentCombinationError` | `ArgumentError` (+ `include Error`) | Uso incorreto da API | Instância/`Hash` de `options` e argumentos nomeados passados ao mesmo tempo |
| `CnpjFmt::TypeMismatchError` | `TypeError` (+ `include Error`) | Uso incorreto da API | Entrada de CNPJ ou opção com tipo de dado incorreto |
| `CnpjFmt::InvalidLengthError` | `CnpjFmt::DomainError` | Erro de domínio | Tamanho após sanitização não é exatamente 14 (passado ao `on_fail` como `DomainError`) |
| `CnpjFmt::OutOfRangeError` | `CnpjFmt::DomainError` | Erro de domínio | `hidden_start` / `hidden_end` fora de `0`–`13` |
| `CnpjFmt::ValidationError` | `CnpjFmt::DomainError` | Erro de domínio | Opção de chave contém caractere proibido |
Expand Down Expand Up @@ -416,7 +416,7 @@ Após `require 'cnpj-fmt'`:
- **`CnpjFmt::CnpjFormatterOptions`**: Classe que armazena opções; suporta mesclagem via construtor, `set` e argumentos nomeados.
- **`CnpjFmt::CNPJ_LENGTH`**: `14` (constante).
- **`CnpjFmt::VERSION`**: string de versão da gem.
- **Erros**: `CnpjFmt::Error`, `CnpjFmt::DomainError`, `CnpjFmt::TypeMismatchError`, `CnpjFmt::InvalidArgumentCombinationError`, `CnpjFmt::InvalidLengthError`, `CnpjFmt::OutOfRangeError`, `CnpjFmt::ValidationError`.
- **Erros**: `CnpjFmt::Error`, `CnpjFmt::DomainError`, `CnpjFmt::InvalidArgumentCombinationError`, `CnpjFmt::TypeMismatchError`, `CnpjFmt::InvalidLengthError`, `CnpjFmt::OutOfRangeError`, `CnpjFmt::ValidationError`.

### Outros recursos disponíveis

Expand Down
2 changes: 1 addition & 1 deletion packages/cnpj-gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ After `require 'cnpj-gen'`:
- **`CnpjGen::CNPJ_PREFIX_MAX_LENGTH`**: `12` (constant).
- **`CnpjGen::CNPJ_TYPE_VALUES`**: `%w[alphabetic alphanumeric numeric]` — allowed `type` values.
- **`CnpjGen::VERSION`**: gem version string.
- **Errors**: `CnpjGen::Error`, `CnpjGen::DomainError`, `CnpjGen::TypeMismatchError`, `CnpjGen::InvalidArgumentCombinationError`, `CnpjGen::ValidationError`.
- **Errors**: `CnpjGen::Error`, `CnpjGen::DomainError`, `CnpjGen::InvalidArgumentCombinationError`, `CnpjGen::TypeMismatchError`, `CnpjGen::ValidationError`.

### Error handling

Expand Down
2 changes: 1 addition & 1 deletion packages/cnpj-gen/README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Após `require 'cnpj-gen'`:
- **`CnpjGen::CNPJ_PREFIX_MAX_LENGTH`**: `12` (constante).
- **`CnpjGen::CNPJ_TYPE_VALUES`**: `%w[alphabetic alphanumeric numeric]` — valores permitidos para `type`.
- **`CnpjGen::VERSION`**: string da versão da gem.
- **Erros**: `CnpjGen::Error`, `CnpjGen::DomainError`, `CnpjGen::TypeMismatchError`, `CnpjGen::InvalidArgumentCombinationError`, `CnpjGen::ValidationError`.
- **Erros**: `CnpjGen::Error`, `CnpjGen::DomainError`, `CnpjGen::InvalidArgumentCombinationError`, `CnpjGen::TypeMismatchError`, `CnpjGen::ValidationError`.

### Tratamento de erros

Expand Down
4 changes: 2 additions & 2 deletions packages/cnpj-val/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ Every custom error includes the `CnpjVal::Error` marker module. Domain failures

| Class | Inherits from | Category | Trigger condition |
|---|---|---|---|
| `CnpjVal::TypeMismatchError` | `TypeError` (+ `include Error`) | API misuse | CNPJ input or option has the wrong data type |
| `CnpjVal::InvalidArgumentCombinationError` | `ArgumentError` (+ `include Error`) | API misuse | Both an `options` instance/`Hash` and keyword arguments are passed at once |
| `CnpjVal::TypeMismatchError` | `TypeError` (+ `include Error`) | API misuse | CNPJ input or option has the wrong data type |
| `CnpjVal::ValidationError` | `CnpjVal::DomainError` | Domain error | `type` is not one of the allowed values |

#### `CnpjVal::Error` (marker module)
Expand Down Expand Up @@ -337,7 +337,7 @@ After `require 'cnpj-val'`:
- **`CnpjVal::CNPJ_LENGTH`**: `14` (constant).
- **`CnpjVal::VERSION`**: gem version string.
- **Type markers**: `CnpjVal::CnpjInput`, `CnpjVal::CnpjType`, `CnpjVal::CnpjValidatorOptionsInput`.
- **Errors**: `CnpjVal::Error`, `CnpjVal::DomainError`, `CnpjVal::TypeMismatchError`, `CnpjVal::InvalidArgumentCombinationError`, `CnpjVal::ValidationError`.
- **Errors**: `CnpjVal::Error`, `CnpjVal::DomainError`, `CnpjVal::InvalidArgumentCombinationError`, `CnpjVal::TypeMismatchError`, `CnpjVal::ValidationError`.

### Other available resources

Expand Down
4 changes: 2 additions & 2 deletions packages/cnpj-val/README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ Todo erro customizado inclui o módulo marcador `CnpjVal::Error`. Falhas de dom

| Classe | Herda de | Categoria | Condição de disparo |
|---|---|---|---|
| `CnpjVal::TypeMismatchError` | `TypeError` (+ `include Error`) | Uso incorreto da API | Entrada CNPJ ou opção com tipo de dado incorreto |
| `CnpjVal::InvalidArgumentCombinationError` | `ArgumentError` (+ `include Error`) | Uso incorreto da API | Instância/`Hash` de `options` e argumentos nomeados passados ao mesmo tempo |
| `CnpjVal::TypeMismatchError` | `TypeError` (+ `include Error`) | Uso incorreto da API | Entrada CNPJ ou opção com tipo de dado incorreto |
| `CnpjVal::ValidationError` | `CnpjVal::DomainError` | Erro de domínio | `type` fora dos valores permitidos |

#### `CnpjVal::Error` (módulo marcador)
Expand Down Expand Up @@ -324,7 +324,7 @@ Após `require 'cnpj-val'`:
- **`CnpjVal::CNPJ_LENGTH`**: `14` (constante).
- **`CnpjVal::VERSION`**: string de versão da gem.
- **Marcadores de tipo**: `CnpjVal::CnpjInput`, `CnpjVal::CnpjType`, `CnpjVal::CnpjValidatorOptionsInput`.
- **Erros**: `CnpjVal::Error`, `CnpjVal::DomainError`, `CnpjVal::TypeMismatchError`, `CnpjVal::InvalidArgumentCombinationError`, `CnpjVal::ValidationError`.
- **Erros**: `CnpjVal::Error`, `CnpjVal::DomainError`, `CnpjVal::InvalidArgumentCombinationError`, `CnpjVal::TypeMismatchError`, `CnpjVal::ValidationError`.

### Outros recursos disponíveis

Expand Down
17 changes: 17 additions & 0 deletions packages/cpf-fmt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
# cpf-fmt

## 1.0.0

### 🚀 Stable Version Released!

Utility module to format CPF (Brazilian individual taxpayer ID) strings. Main features:

- **Multiple interfaces**: supports `CpfFmt.cpf_fmt` and `CpfFmt::CpfFormatter` with shared `CpfFmt::CpfFormatterOptions` defaults; an `options` argument (instance or `Hash`) is never merged with keyword overrides — passing both at once raises `InvalidArgumentCombinationError`.
- **Numeric CPF**: formats 11-digit input; strips non-digits before delimiter insertion (`XXX.XXX.XXX-XX`).
- **Flexible input**: accepts a `String` or `Array<String>` and concatenates sequence items before sanitization.
- **Customizable output**: configurable `dot_key` and `dash_key` delimiters for flexible layouts.
- **Privacy masking**: `hidden`, `hidden_key`, `hidden_start`, and `hidden_end` mask sensitive digit ranges in the formatted string.
- **Post-format transforms**: optional `escape` (HTML) and `encode` (URL) applied after successful formatting.
- **Structured errors**: `CpfFmt::Error` marker with misuse leaves (`TypeMismatchError`, `InvalidArgumentCombinationError`), domain leaves (`InvalidLengthError`, `OutOfRangeError`, `ValidationError` under `DomainError`); `on_fail` receives `(original_input, DomainError)` (length failures pass `InvalidLengthError`).
- **Strict options merging**: `CpfFormatterOptions.new`/`#set` fold positional `Hash`/instance layers left to right, then apply keyword overrides with the highest precedence, filling any still-unresolved option with its `DEFAULT_*` value; property setters never accept `nil` directly — pass the matching `DEFAULT_*` constant (or use `#set_hidden_range`) to reset explicitly.

For detailed usage and API reference, see the [README](./README.md).
Loading