{
  "$schema": "../cases.schema.json",
  "format": 1,
  "domain": "iban",
  "title": {
    "en": "IBAN",
    "pt-BR": "IBAN"
  },
  "functions": [
    {
      "id": "iban.format",
      "level": "extended",
      "summary": "Formats an IBAN in the ISO 13616 print grouping, with blocks of 4 characters.",
      "description": "Formats an IBAN in the ISO 13616 print grouping: blocks of 4 characters separated by spaces, upper-cased. It does not validate the IBAN (use `iban.isValid`).\n\nStatements and bank forms show the IBAN in this form.\n\n- The function reads only letters and digits. The result is capped at the 29 characters of a Brazilian IBAN.\n- Every other character (a hyphen, a dot, extra whitespace) is dropped, so `BR15 0000-0000.0000/1093 2840 814P-2` gives the same result as the compact form. A value that is not a string gives an empty string.\n- A partial value is grouped as far as it goes (`BR15` gives `BR15`), so the function works as an input mask. The check digits and the layout are not checked, and an IBAN of another country is grouped the same way.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "iban.format#[\"BR1500000000000010932840814P2\"]",
          "args": [
            "BR1500000000000010932840814P2"
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P 2"
          }
        },
        {
          "id": "iban.format#lowercase",
          "args": [
            "br1500000000000010932840814p2"
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P 2"
          }
        },
        {
          "id": "iban.format#partial",
          "args": [
            "BR150"
          ],
          "expect": {
            "returns": "BR15 0"
          }
        },
        {
          "id": "iban.format#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          }
        },
        {
          "id": "iban.format#[\"B\"]",
          "args": [
            "B"
          ],
          "expect": {
            "returns": "B"
          },
          "note": "JavaScript's own test: should format a partial value as far as it goes"
        },
        {
          "id": "iban.format#[\"BR\"]",
          "args": [
            "BR"
          ],
          "expect": {
            "returns": "BR"
          },
          "note": "JavaScript's own test: should format a partial value as far as it goes"
        },
        {
          "id": "iban.format#[\"BR1\"]",
          "args": [
            "BR1"
          ],
          "expect": {
            "returns": "BR1"
          },
          "note": "JavaScript's own test: should format a partial value as far as it goes"
        },
        {
          "id": "iban.format#[\"BR15\"]",
          "args": [
            "BR15"
          ],
          "expect": {
            "returns": "BR15"
          },
          "note": "JavaScript's own test: should format a partial value as far as it goes"
        },
        {
          "id": "iban.format#[\"BR1500000000000010932840814P\"]",
          "args": [
            "BR1500000000000010932840814P"
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P"
          },
          "note": "JavaScript's own test: should format a partial value as far as it goes"
        },
        {
          "id": "iban.format#[\"BR1500 000000000010 932840814P2\"]",
          "args": [
            "BR1500 000000000010 932840814P2"
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P 2"
          },
          "note": "JavaScript's own test: should regroup a value that is already written in the print format"
        },
        {
          "id": "iban.format#[\"  BR15 0000 0000 0000 1093 2840 814P 2  \"]",
          "args": [
            "  BR15 0000 0000 0000 1093 2840 814P 2  "
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P 2"
          },
          "note": "JavaScript's own test: should trim the surrounding whitespace"
        },
        {
          "id": "iban.format#[\"BR1500000000000010932840814P-2\"]",
          "args": [
            "BR1500000000000010932840814P-2"
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P 2"
          },
          "note": "JavaScript's own test: should read only the letters and digits of a value with other characters, like formatCpf"
        },
        {
          "id": "iban.format#[\"BR15 0000-0000.0000/1093 2840 814P 2\"]",
          "args": [
            "BR15 0000-0000.0000/1093 2840 814P 2"
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P 2"
          },
          "note": "JavaScript's own test: should read only the letters and digits of a value with other characters, like formatCpf"
        },
        {
          "id": "iban.format#[\"BR15  0000\"]",
          "args": [
            "BR15  0000"
          ],
          "expect": {
            "returns": "BR15 0000"
          },
          "note": "JavaScript's own test: should read only the letters and digits of a value with other characters, like formatCpf"
        },
        {
          "id": "iban.format#[\"BR1500000000000010932840814P2EXTRACHARS\"]",
          "args": [
            "BR1500000000000010932840814P2EXTRACHARS"
          ],
          "expect": {
            "returns": "BR15 0000 0000 0000 1093 2840 814P 2"
          },
          "note": "JavaScript's own test: should cap the result to 29 characters"
        },
        {
          "id": "iban.format#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when the value is not a string"
        },
        {
          "id": "iban.format#[\"  BR15  0000 \"]",
          "args": [
            "  BR15  0000 "
          ],
          "expect": {
            "returns": "BR15 0000"
          },
          "note": "extra whitespace is dropped"
        }
      ]
    },
    {
      "id": "iban.getInfo",
      "level": "extended",
      "summary": "Splits a Brazilian IBAN into its fields.",
      "description": "Parses a Brazilian IBAN into its fields. Returns `null` whenever `iban.isValid` would return `false`.\n\n- Fields, all strings: `countryCode` (always `BR`), `checkDigits` (2 digits), `bankIspb` (8 characters, uppercase letters allowed since Resolução BCB 585/2026), `branch` (5 digits), `account` (10 digits), `accountType` (1 letter, usually `C` or `P`) and `owner` (`1` to `9`, then `A` to `Z`). Letters come upper-cased and the zero padding is kept.\n- The input rules are those of `iban.isValid`: the compact or grouped form, a run of mask characters between groups, any case. A value that is not a string gives `null`.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "IbanInfo?",
      "cases": [
        {
          "id": "iban.getInfo#[\"BR1500000000000010932840814P2\"]",
          "args": [
            "BR1500000000000010932840814P2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "15",
              "bankIspb": "00000000",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "P",
              "owner": "2"
            }
          }
        },
        {
          "id": "iban.getInfo#masked",
          "args": [
            "BR15 0000 0000 0000 1093 2840 814P 2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "15",
              "bankIspb": "00000000",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "P",
              "owner": "2"
            }
          }
        },
        {
          "id": "iban.getInfo#[\"BR3860701190000010000012345C1\"]",
          "args": [
            "BR3860701190000010000012345C1"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "38",
              "bankIspb": "60701190",
              "branch": "00001",
              "account": "0000012345",
              "accountType": "C",
              "owner": "1"
            }
          }
        },
        {
          "id": "iban.getInfo#wrong-check",
          "args": [
            "BR1500000000000010932840814P3"
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "iban.getInfo#not-brazilian",
          "args": [
            "DE89370400440532013000"
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "iban.getInfo#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "iban.getInfo#[\"br1500000000000010932840814p2\"]",
          "args": [
            "br1500000000000010932840814p2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "15",
              "bankIspb": "00000000",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "P",
              "owner": "2"
            }
          },
          "note": "JavaScript's own test: should return the parsed iban for a lowercase value"
        },
        {
          "id": "iban.getInfo#[\"BR1460746948000020001234567P2\"]",
          "args": [
            "BR1460746948000020001234567P2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "14",
              "bankIspb": "60746948",
              "branch": "00002",
              "account": "0001234567",
              "accountType": "P",
              "owner": "2"
            }
          },
          "note": "JavaScript's own test: should return the parsed iban for a valid IBAN with a poupança (P) account type and a non zero branch"
        },
        {
          "id": "iban.getInfo#[\"BR5400000000000010932840814D2\"]",
          "args": [
            "BR5400000000000010932840814D2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "54",
              "bankIspb": "00000000",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "D",
              "owner": "2"
            }
          },
          "note": "JavaScript's own test: should return the parsed iban for a valid IBAN with an account type letter other than C or P"
        },
        {
          "id": "iban.getInfo#[\"BR15000000000000109328408\"]",
          "args": [
            "BR15000000000000109328408"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when it is shorter than 29 characters"
        },
        {
          "id": "iban.getInfo#[\"BR1500000000000010932840814P2000\"]",
          "args": [
            "BR1500000000000010932840814P2000"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when it is longer than 29 characters"
        },
        {
          "id": "iban.getInfo#[\"BR150000000000001093284081412\"]",
          "args": [
            "BR150000000000001093284081412"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the account type is not a letter"
        },
        {
          "id": "iban.getInfo#[\"BR6900000000000010932840814P0\"]",
          "args": [
            "BR6900000000000010932840814P0"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the owner indicator is 0, which Resolução BCB 585/2026 art. 2 § 1 does not assign, even though the check digits match"
        },
        {
          "id": "iban.getInfo#[\"BR1500000000000010932840814X2\"]",
          "args": [
            "BR1500000000000010932840814X2"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the account type letter does not match the check digits"
        },
        {
          "id": "iban.getInfo#[\"BR1500000000000010932840814P_2\"]",
          "args": [
            "BR1500000000000010932840814P_2"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when it carries a character outside the print format"
        },
        {
          "id": "iban.getInfo#[\"BR15,0000,0000,0000,1093,2840,814P2\"]",
          "args": [
            "BR15,0000,0000,0000,1093,2840,814P2"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when it carries a character outside the print format"
        },
        {
          "id": "iban.getInfo#[\"BR15 000 00000 0000 1093 2840 814P 2\"]",
          "args": [
            "BR15 000 00000 0000 1093 2840 814P 2"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when a separator falls inside a group instead of at its boundary"
        },
        {
          "id": "iban.getInfo#[\"BR10 12AB 34CD 0000 1093 2840 814P 2\"]",
          "args": [
            "BR10 12AB 34CD 0000 1093 2840 814P 2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "10",
              "bankIspb": "12AB34CD",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "P",
              "owner": "2"
            }
          },
          "note": "JavaScript's own test: should return the fields for an ISPB with letters, which Resolução BCB 585/2026 allows"
        },
        {
          "id": "iban.getInfo#[\"BR15 0000 0000 0000 1093 2840  814P 2\"]",
          "args": [
            "BR15 0000 0000 0000 1093 2840  814P 2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "15",
              "bankIspb": "00000000",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "P",
              "owner": "2"
            }
          },
          "note": "a run of mask characters between groups reads as isValid does (new in 2.5.0, #615)"
        },
        {
          "id": "iban.getInfo#[\"BR15 0000 0000 0000 1093 2840 .-814P 2\"]",
          "args": [
            "BR15 0000 0000 0000 1093 2840 .-814P 2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "15",
              "bankIspb": "00000000",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "P",
              "owner": "2"
            }
          },
          "note": "a run of mask characters between groups reads as isValid does (new in 2.5.0, #615)"
        },
        {
          "id": "iban.getInfo#[\"BR15-0000-0000-0000-1093-2840-814P-2\"]",
          "args": [
            "BR15-0000-0000-0000-1093-2840-814P-2"
          ],
          "expect": {
            "returns": {
              "countryCode": "BR",
              "checkDigits": "15",
              "bankIspb": "00000000",
              "branch": "00001",
              "account": "0932840814",
              "accountType": "P",
              "owner": "2"
            }
          },
          "note": "JavaScript docs example: any of the mask characters"
        },
        {
          "id": "iban.getInfo#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when it is null"
        }
      ]
    },
    {
      "id": "iban.isValid",
      "level": "extended",
      "summary": "Checks whether a Brazilian IBAN is valid.",
      "description": "Validates a Brazilian IBAN. Any other country is invalid.\n\n- Layout, 29 characters: `BR`, 2 check digits (ISO 7064 MOD 97-10), 8-character ISPB (digits or letters), 5-digit branch, 10-digit account, 1-letter account type (usually `C` or `P`), 1 owner indicator (`1` to `9`, then `A` to `Z`).\n- Accepts the compact form or groups of 4 split by whitespace, `.`, `-` or `/`, in any case, with optional whitespace around the value. The separator is optional at each group boundary, so `BR15 000000000000 1093 2840 814P 2` is also valid. The separators are the interchangeable mask characters of the CPF and CNPJ, alone or in a run (ISO 13616 prints one space), so `BR1500000000000010932840814P-2` and `BR15 0000 0000 0000 1093 2840  814P 2` are the same IBAN. Until 2.4.0 a run of separators between two groups made the IBAN invalid.\n- A separator away from a group boundary, or any character outside letters, digits and those separators, makes the IBAN invalid (`BR15 000 00000 0000 1093 2840 814P 2`). The character is not stripped. A value that is not a string is invalid.\n- The layout is set by Resolução BCB 585/2026, art. 2º, which revoked Circular BCB 3.625/2013 and kept its layout. Art. 2º, III, makes the ISPB \"oito caracteres alfanuméricos\", so a letter in the ISPB is accepted, in any case. 2.4.0 accepted only digits there. Every other digit position still rejects a letter.\n- The account type follows the ISO 13616 registry pattern (a letter). Art. 2º, VI, calls it \"um caractere alfanumérico\"; the registry form is kept, so a digit there is rejected.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "iban.isValid#[\"BR1500000000000010932840814P2\"]",
          "args": [
            "BR1500000000000010932840814P2"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "iban.isValid#masked",
          "args": [
            "BR15 0000 0000 0000 1093 2840 814P 2"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "iban.isValid#lowercase",
          "args": [
            "br1500000000000010932840814p2"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "iban.isValid#wrong-check",
          "args": [
            "BR1500000000000010932840814P3"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "iban.isValid#not-brazilian",
          "args": [
            "DE89370400440532013000"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "iban.isValid#too-short",
          "args": [
            "BR15000000000000109328408"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "iban.isValid#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "iban.isValid#[\"BR15.0000.0000.0000.1093.2840.814P.2\"]",
          "args": [
            "BR15.0000.0000.0000.1093.2840.814P.2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a value whose ISO 13616 groups are split by any of the mask characters"
        },
        {
          "id": "iban.isValid#[\"BR15-0000-0000-0000-1093-2840-814P-2\"]",
          "args": [
            "BR15-0000-0000-0000-1093-2840-814P-2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a value whose ISO 13616 groups are split by any of the mask characters"
        },
        {
          "id": "iban.isValid#[\"BR15/0000/0000/0000/1093/2840/814P/2\"]",
          "args": [
            "BR15/0000/0000/0000/1093/2840/814P/2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a value whose ISO 13616 groups are split by any of the mask characters"
        },
        {
          "id": "iban.isValid#[\"BR15.0000-0000/0000 1093 2840 814P2\"]",
          "args": [
            "BR15.0000-0000/0000 1093 2840 814P2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a value whose ISO 13616 groups are split by any of the mask characters"
        },
        {
          "id": "iban.isValid#[\"BR1500000000000010932840814P-2\"]",
          "args": [
            "BR1500000000000010932840814P-2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a value split at one group boundary only"
        },
        {
          "id": "iban.isValid#[\"  BR15 0000 0000 0000 1093 2840 814P 2  \"]",
          "args": [
            "  BR15 0000 0000 0000 1093 2840 814P 2  "
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a value with surrounding whitespace"
        },
        {
          "id": "iban.isValid#[\"BR1460746948000020001234567P2\"]",
          "args": [
            "BR1460746948000020001234567P2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a valid IBAN with a poupança (P) account type"
        },
        {
          "id": "iban.isValid#[\"BR3860701190000010000012345C1\"]",
          "args": [
            "BR3860701190000010000012345C1"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a valid IBAN with a corrente (C) account type"
        },
        {
          "id": "iban.isValid#[\"BR5400000000000010932840814D2\"]",
          "args": [
            "BR5400000000000010932840814D2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a valid IBAN whose account type is a letter other than C or P"
        },
        {
          "id": "iban.isValid#[\"BR7800000000000010932840814S2\"]",
          "args": [
            "BR7800000000000010932840814S2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a valid IBAN whose account type is a letter other than C or P"
        },
        {
          "id": "iban.isValid#[\"BR4500000000000010000012345CA\"]",
          "args": [
            "BR4500000000000010000012345CA"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a valid IBAN whose owner indicator is the letter A (the LETTER_CODE_A boundary)"
        },
        {
          "id": "iban.isValid#[\"BR4900000000000010000012345CZ\"]",
          "args": [
            "BR4900000000000010000012345CZ"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a valid IBAN whose owner indicator is the letter Z (the highest transliterated letter)"
        },
        {
          "id": "iban.isValid#[\"BR1500000000000010932840814P2000\"]",
          "args": [
            "BR1500000000000010932840814P2000"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it is longer than 29 characters"
        },
        {
          "id": "iban.isValid#[\"BR150000000000001093284081412\"]",
          "args": [
            "BR150000000000001093284081412"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the account type is not a letter"
        },
        {
          "id": "iban.isValid#[\"BR6900000000000010932840814P0\"]",
          "args": [
            "BR6900000000000010932840814P0"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the owner indicator is 0, which Resolução BCB 585/2026 art. 2 § 1 does not assign, even though the check digits match"
        },
        {
          "id": "iban.isValid#[\"BR1500000000000010932840814X2\"]",
          "args": [
            "BR1500000000000010932840814X2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the account type letter does not match the check digits"
        },
        {
          "id": "iban.isValid#[\"BR170000000A000010000012345C2\"]",
          "args": [
            "BR170000000A000010000012345C2"
          ],
          "expect": {
            "returns": true
          },
          "note": "changed in 2.5.0 (#593): the letter is in the ISPB, which Resolução BCB 585/2026 art. 2º III makes alphanumeric; 2.4.0 rejected it. JavaScript's own test: should return true for an ISPB with letters"
        },
        {
          "id": "iban.isValid#[\"BR1500000000000010932840814P_2\"]",
          "args": [
            "BR1500000000000010932840814P_2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it carries a character outside the print format"
        },
        {
          "id": "iban.isValid#[\"BR15,0000,0000,0000,1093,2840,814P,2\"]",
          "args": [
            "BR15,0000,0000,0000,1093,2840,814P,2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it carries a character outside the print format"
        },
        {
          "id": "iban.isValid#[\"BR1500000000000010932840814P#2\"]",
          "args": [
            "BR1500000000000010932840814P#2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it carries a character outside the print format"
        },
        {
          "id": "iban.isValid#[\"BR15 000 00000 0000 1093 2840 814P 2\"]",
          "args": [
            "BR15 000 00000 0000 1093 2840 814P 2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when a separator falls inside a group instead of at its boundary"
        },
        {
          "id": "iban.isValid#[\"BR1 50000000000001093 2840 814P 2\"]",
          "args": [
            "BR1 50000000000001093 2840 814P 2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when a separator falls inside a group instead of at its boundary"
        },
        {
          "id": "iban.isValid#[\"BR15 0000 0000 0000 1093 2840 814 P2\"]",
          "args": [
            "BR15 0000 0000 0000 1093 2840 814 P2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when a separator falls inside a group instead of at its boundary"
        },
        {
          "id": "iban.isValid#[\"BR15 0000 0000 0000 1093 2840  814P 2\"]",
          "args": [
            "BR15 0000 0000 0000 1093 2840  814P 2"
          ],
          "expect": {
            "returns": true
          },
          "note": "changed in 2.5.0 (#615): a run of mask characters between groups is accepted, as isValidCpf reads its mask. JavaScript's own test: for groups separated by a run of mask characters"
        },
        {
          "id": "iban.isValid#[\"BR15 0000 0000 0000 1093 2840 .-814P 2\"]",
          "args": [
            "BR15 0000 0000 0000 1093 2840 .-814P 2"
          ],
          "expect": {
            "returns": true
          },
          "note": "changed in 2.5.0 (#615): a run of mask characters between groups is accepted, as isValidCpf reads its mask. JavaScript's own test: for groups separated by a run of mask characters"
        },
        {
          "id": "iban.isValid#[\"   \"]",
          "args": [
            "   "
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it contains only whitespace"
        },
        {
          "id": "iban.isValid#[\"BR1012AB34CD000010932840814P2\"]",
          "args": [
            "BR1012AB34CD000010932840814P2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for an ISPB with letters, the 'oito caracteres alfanuméricos' of Resolução BCB 585/2026 art. 2 III"
        },
        {
          "id": "iban.isValid#[\"br1012ab34cd000010932840814p2\"]",
          "args": [
            "br1012ab34cd000010932840814p2"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for an ISPB with letters, the 'oito caracteres alfanuméricos' of Resolução BCB 585/2026 art. 2 III"
        },
        {
          "id": "iban.isValid#[\"BR32000000000000A0000012345C2\"]",
          "args": [
            "BR32000000000000A0000012345C2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when a digit position (the branch) holds a letter instead, even if the check digits happen to match"
        },
        {
          "id": "iban.isValid#[\"BR320000000000001000001234AC2\"]",
          "args": [
            "BR320000000000001000001234AC2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when a digit position (the account) holds a letter instead, even if the check digits happen to match"
        },
        {
          "id": "iban.isValid#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when it is null (not a string)"
        }
      ]
    },
    {
      "id": "iban.parse",
      "level": "extended",
      "summary": "Removes IBAN formatting characters, upper-cases the result and returns the compact IBAN.",
      "description": "Removes IBAN formatting and keeps letters and digits upper-cased, capped at 29 characters.\n\n- A number is read only when it is a safe non-negative integer. A negative, fractional, non-finite or unsafe number gives an empty string (2.4.0 read the characters of any number, sign and decimal point dropped).\n- Every character that is not a letter or a digit is dropped and the letters are upper-cased.\n- A string is read as it is, so a value with no letter or digit, and a value that is neither a string nor a number, give an empty string.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "iban.parse#masked",
          "args": [
            "BR15 0000 0000 0000 1093 2840 814P 2"
          ],
          "expect": {
            "returns": "BR1500000000000010932840814P2"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "iban.parse#lowercase-mixed-separators",
          "args": [
            "br15-0000.0000/0000 1093 2840 814p-2"
          ],
          "expect": {
            "returns": "BR1500000000000010932840814P2"
          }
        },
        {
          "id": "iban.parse#caps-length",
          "args": [
            "BR1500000000000010932840814P2EXTRA"
          ],
          "expect": {
            "returns": "BR1500000000000010932840814P2"
          },
          "note": "reference truncates to 29 characters; asserted by the reference (JS) unit tests"
        },
        {
          "id": "iban.parse#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          }
        },
        {
          "id": "iban.parse#[\"BR15\"]",
          "args": [
            "BR15"
          ],
          "expect": {
            "returns": "BR15"
          },
          "note": "JavaScript's own test: should keep a partial IBAN as written"
        },
        {
          "id": "iban.parse#[-1]",
          "args": [
            -1
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string when it is a negative, fractional or unsafe number (#593 number rule)"
        },
        {
          "id": "iban.parse#[1.5]",
          "args": [
            1.5
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string when it is a negative, fractional or unsafe number (#593 number rule)"
        },
        {
          "id": "iban.parse#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string when it is a negative, fractional or unsafe number (#593 number rule)"
        },
        {
          "id": "iban.parse#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": ""
          },
          "note": "a value that is not a string or number gives an empty string"
        }
      ]
    }
  ]
}
