{
  "$schema": "../cases.schema.json",
  "format": 1,
  "domain": "pis",
  "title": {
    "en": "PIS/PASEP",
    "pt-BR": "PIS/PASEP"
  },
  "functions": [
    {
      "id": "pis.format",
      "level": "core",
      "summary": "Formats a PIS number as `000.00000.00-0`.",
      "description": "Formats a PIS as `000.00000.00-0`.\n\n- `options.pad` left-pads the value with zeros to 11 digits first.\n- `options.obfuscate` (default `false`) hides the first 3 digits and the check digit with `*`, after padding: `***.45678.90-*`. It works with `pad` and on a partial value. Like `pad`, it is read for truthiness: a non-boolean such as `1` hides the digits too, and `0` does not.\n- No authority publishes a masking rule for the PIS. The rule is an analogy with the one the Leis de Diretrizes Orçamentárias set for publishing a CPF (\"ocultar os três primeiros dígitos e os dois dígitos verificadores\", Lei nº 12.309/2010, art. 87, § 5º, repeated up to the LDO 2026, Lei nº 15.321/2025, art. 163), not a published norm.\n- `cns.format` and `passport.format` have no `obfuscate` option.\n- A number is read only when it is a safe non-negative integer. A negative, fractional, non-finite or unsafe number returns an empty string (2.4.0 read the digits of any number, sign and decimal point dropped).\n- A value with no digits (empty, or only letters and symbols) returns an empty string even with `options.pad`. Until 2.4.0 `pad` returned the full zero mask (`000.00000.00-0`).\n- Digits after the 11th are dropped.\n- Pending decision (findings §2 #2, #3): the reference (JS) formats only the characters an incomplete value has and returns an empty string for empty or invalid input. Other libraries return `null`.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        },
        {
          "name": "options",
          "type": "FormatPisOptions",
          "optional": true
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "pis.format#[\"55984775363\"]",
          "args": [
            "55984775363"
          ],
          "expect": {
            "returns": "559.84775.36-3"
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.format#[\"00000000000\"]",
          "args": [
            "00000000000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.format#[\"36365790380\"]",
          "args": [
            "36365790380"
          ],
          "expect": {
            "returns": "363.65790.38-0"
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.format#[\"73532010294\"]",
          "args": [
            "73532010294"
          ],
          "expect": {
            "returns": "735.32010.29-4"
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.format#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"0\"]",
          "args": [
            "0"
          ],
          "expect": {
            "returns": "0"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"00\"]",
          "args": [
            "00"
          ],
          "expect": {
            "returns": "00"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"000\"]",
          "args": [
            "000"
          ],
          "expect": {
            "returns": "000"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"0000\"]",
          "args": [
            "0000"
          ],
          "expect": {
            "returns": "000.0"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"00000\"]",
          "args": [
            "00000"
          ],
          "expect": {
            "returns": "000.00"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"000000\"]",
          "args": [
            "000000"
          ],
          "expect": {
            "returns": "000.000"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"0000000\"]",
          "args": [
            "0000000"
          ],
          "expect": {
            "returns": "000.0000"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"00000000\"]",
          "args": [
            "00000000"
          ],
          "expect": {
            "returns": "000.00000"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"000000000\"]",
          "args": [
            "000000000"
          ],
          "expect": {
            "returns": "000.00000.0"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"0000000000\"]",
          "args": [
            "0000000000"
          ],
          "expect": {
            "returns": "000.00000.00"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"000000000000\"]",
          "args": [
            "000000000000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a no formatted string"
        },
        {
          "id": "pis.format#[\"000.0\"]",
          "args": [
            "000.0"
          ],
          "expect": {
            "returns": "000.0"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.00\"]",
          "args": [
            "000.00"
          ],
          "expect": {
            "returns": "000.00"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.000\"]",
          "args": [
            "000.000"
          ],
          "expect": {
            "returns": "000.000"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.0000\"]",
          "args": [
            "000.0000"
          ],
          "expect": {
            "returns": "000.0000"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.00000\"]",
          "args": [
            "000.00000"
          ],
          "expect": {
            "returns": "000.00000"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.000000\"]",
          "args": [
            "000.000000"
          ],
          "expect": {
            "returns": "000.00000.0"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.00000.0\"]",
          "args": [
            "000.00000.0"
          ],
          "expect": {
            "returns": "000.00000.0"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.00000.00\"]",
          "args": [
            "000.00000.00"
          ],
          "expect": {
            "returns": "000.00000.00"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.00000.000\"]",
          "args": [
            "000.00000.000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.00000.00-0\"]",
          "args": [
            "000.00000.00-0"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000.00000.00-00\"]",
          "args": [
            "000.00000.00-00"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a formatted string"
        },
        {
          "id": "pis.format#[\"000#Error*&@#0000#Char!00000\"]",
          "args": [
            "000#Error*&@#0000#Char!00000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a malformed string"
        },
        {
          "id": "pis.format#[\"#-+Error#000000000000#Char!\"]",
          "args": [
            "#-+Error#000000000000#Char!"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a malformed string"
        },
        {
          "id": "pis.format#[\"000000#+_Error#Char!$#000000\"]",
          "args": [
            "000000#+_Error#Char!$#000000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a malformed string"
        },
        {
          "id": "pis.format#[1]",
          "args": [
            1
          ],
          "expect": {
            "returns": "1"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[10]",
          "args": [
            10
          ],
          "expect": {
            "returns": "10"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[100]",
          "args": [
            100
          ],
          "expect": {
            "returns": "100"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[1000]",
          "args": [
            1000
          ],
          "expect": {
            "returns": "100.0"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[10000]",
          "args": [
            10000
          ],
          "expect": {
            "returns": "100.00"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[100000]",
          "args": [
            100000
          ],
          "expect": {
            "returns": "100.000"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[1000000]",
          "args": [
            1000000
          ],
          "expect": {
            "returns": "100.0000"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[10000000]",
          "args": [
            10000000
          ],
          "expect": {
            "returns": "100.00000"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[100000000]",
          "args": [
            100000000
          ],
          "expect": {
            "returns": "100.00000.0"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[1000000000]",
          "args": [
            1000000000
          ],
          "expect": {
            "returns": "100.00000.00"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[10000000000]",
          "args": [
            10000000000
          ],
          "expect": {
            "returns": "100.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[100000000000]",
          "args": [
            100000000000
          ],
          "expect": {
            "returns": "100.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[1000000000000]",
          "args": [
            1000000000000
          ],
          "expect": {
            "returns": "100.00000.00-0"
          },
          "note": "JavaScript's own test: when it is a integer number"
        },
        {
          "id": "pis.format#[100.1]",
          "args": [
            100.1
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.1\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.11]",
          "args": [
            100.11
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.11\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.101]",
          "args": [
            100.101
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.101\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.1001]",
          "args": [
            100.1001
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.1001\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.10001]",
          "args": [
            100.10001
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.10001\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.100001]",
          "args": [
            100.100001
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.10000.1\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.1000001]",
          "args": [
            100.1000001
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.10000.01\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.10000001]",
          "args": [
            100.10000001
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.10000.00-1\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.100000001]",
          "args": [
            100.100000001
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number is not a safe non-negative integer, so it gives an empty string. 2.4.0 returned \"100.10000.00-0\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[\"0000000000000\"]",
          "args": [
            "0000000000000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test"
        },
        {
          "id": "pis.format#[\"00000000000000\"]",
          "args": [
            "00000000000000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test"
        },
        {
          "id": "pis.format#[\"000000000000000\"]",
          "args": [
            "000000000000000"
          ],
          "expect": {
            "returns": "000.00000.00-0"
          },
          "note": "JavaScript's own test"
        },
        {
          "id": "pis.format#[\"12345678901\",{\"obfuscate\":true}]",
          "args": [
            "12345678901",
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***.45678.90-*"
          },
          "note": "from the maintainer briefing, #567"
        },
        {
          "id": "pis.format#[\"12056412547\",{\"obfuscate\":true}]",
          "args": [
            "12056412547",
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***.56412.54-*"
          },
          "note": "JavaScript's own test: should hide the first 3 digits and the check digit when obfuscate is truthy"
        },
        {
          "id": "pis.format#[12056412547,{\"obfuscate\":true}]",
          "args": [
            12056412547,
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***.56412.54-*"
          },
          "note": "JavaScript's own test: should hide the first 3 digits and the check digit when obfuscate is truthy"
        },
        {
          "id": "pis.format#[\"1205\",{\"obfuscate\":true}]",
          "args": [
            "1205",
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***.5"
          },
          "note": "JavaScript's own test: should hide the first 3 digits and the check digit when obfuscate is truthy"
        },
        {
          "id": "pis.format#[\"1205\",{\"pad\":true,\"obfuscate\":true}]",
          "args": [
            "1205",
            {
              "pad": true,
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***.00001.20-*"
          },
          "note": "JavaScript's own test: should hide the first 3 digits and the check digit when obfuscate is truthy"
        },
        {
          "id": "pis.format#[\"12056412547\",{\"obfuscate\":false}]",
          "args": [
            "12056412547",
            {
              "obfuscate": false
            }
          ],
          "expect": {
            "returns": "120.56412.54-7"
          },
          "note": "JavaScript's own test: should behave exactly as without the option when obfuscate is falsy"
        },
        {
          "id": "pis.format#[\"1205\",{\"pad\":true,\"obfuscate\":false}]",
          "args": [
            "1205",
            {
              "pad": true,
              "obfuscate": false
            }
          ],
          "expect": {
            "returns": "000.00001.20-5"
          },
          "note": "JavaScript's own test: should behave exactly as without the option when obfuscate is falsy"
        },
        {
          "id": "pis.format#[-12345678901]",
          "args": [
            -12345678901
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a negative number is not a safe non-negative integer. 2.4.0 returned \"123.45678.90-1\""
        },
        {
          "id": "pis.format#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number (2^53)"
        },
        {
          "id": "pis.format#[100.1,{\"pad\":true}]",
          "args": [
            100.1,
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[100.1,{\"obfuscate\":true}]",
          "args": [
            100.1,
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.format#[\"\",{\"pad\":true}]",
          "args": [
            "",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string for a value without digits even when padding"
        },
        {
          "id": "pis.format#[\"abc\",{\"pad\":true}]",
          "args": [
            "abc",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string for a value without digits even when padding"
        },
        {
          "id": "pis.format#[\"12345678901\"]",
          "args": [
            "12345678901"
          ],
          "expect": {
            "returns": "123.45678.90-1"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "pis.format#[\"123456789\",{\"pad\":true}]",
          "args": [
            "123456789",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "001.23456.78-9"
          },
          "note": "JavaScript docs example"
        }
      ]
    },
    {
      "id": "pis.generate",
      "level": "core",
      "summary": "Generates a valid random Brazilian PIS number.",
      "description": "Generates a valid random PIS: 11 digits, unformatted.\n\n- No official source publishes the check-digit weights. The eSocial MOS gives 11 digits with the check digit, and the SIRC manual says the check digit uses modulus 11; the Caixa layouts ask only for a \"Número de PIS/PASEP válido\". The weights follow a community reference (brutils).",
      "params": [],
      "returns": "string",
      "cases": [
        {
          "id": "pis.generate#generated-is-valid",
          "args": [],
          "expect": {
            "satisfies": "pis.isValid"
          },
          "repeat": 5,
          "note": "every generated value must pass the lib's own validator"
        }
      ]
    },
    {
      "id": "pis.isValid",
      "level": "core",
      "summary": "Checks whether a PIS number is valid.",
      "description": "Validates a PIS/PASEP/NIT: 10 base digits and a modulus 11 check digit.\n\n- No official source publishes the check-digit weights. The eSocial MOS gives 11 digits with the check digit, and the SIRC manual says the check digit uses modulus 11; the Caixa layouts ask only for a \"Número de PIS/PASEP válido\". The weights follow a community reference (brutils).\n- The function ignores whitespace and the characters `.`, `-`, `/`, `(`, `)`, `,` and `*`, in any number and position. Any other character makes the value invalid. Exactly 11 digits are required once they are removed, and the check digit must match.\n- The check-digit weights are 3, 2, 9, 8, 7, 6, 5, 4, 3 and 2 over the first 10 digits, with modulus 11.\n- Only a string is read. Any other type returns `false`.\n- Pending decision (findings §1): the reference (JS) rejects a value whose digits are all the same as a reserved number. The other libraries accept them when the check digit matches.\n- Pending decision (findings §2 #1): the reference (JS) ignores those formatting characters and whitespace. Other libraries accept digits only.",
      "params": [
        {
          "name": "pis",
          "type": "string"
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "pis.isValid#[\"55984775363\"]",
          "args": [
            "55984775363"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"55984775364\"]",
          "args": [
            "55984775364"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"36365790380\"]",
          "args": [
            "36365790380"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"36365790381\"]",
          "args": [
            "36365790381"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"73532010294\"]",
          "args": [
            "73532010294"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"73532010295\"]",
          "args": [
            "73532010295"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"   \"]",
          "args": [
            "   "
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#[\"abc\"]",
          "args": [
            "abc"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 5 libs (go, javascript, python, ruby, rust)"
        },
        {
          "id": "pis.isValid#repeated-digits",
          "args": [
            "00000000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "a PIS made of one repeated digit is never valid (same rule as cpf/cnpj, where all libs agree)"
        },
        {
          "id": "pis.isValid#repeated-digits-9",
          "args": [
            "99999999999"
          ],
          "expect": {
            "returns": false
          },
          "note": "same rule as above"
        },
        {
          "id": "pis.isValid#[\"11111111111\"]",
          "args": [
            "11111111111"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"22222222222\"]",
          "args": [
            "22222222222"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"33333333333\"]",
          "args": [
            "33333333333"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"44444444444\"]",
          "args": [
            "44444444444"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"55555555555\"]",
          "args": [
            "55555555555"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"66666666666\"]",
          "args": [
            "66666666666"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"77777777777\"]",
          "args": [
            "77777777777"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"88888888888\"]",
          "args": [
            "88888888888"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when every digit is the same"
        },
        {
          "id": "pis.isValid#[\"1205641284799\"]",
          "args": [
            "1205641284799"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it sanitizes to more digits than the PIS length, even if the first 11 match a valid PIS"
        },
        {
          "id": "pis.isValid#[\"123456\"]",
          "args": [
            "123456"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false"
        },
        {
          "id": "pis.isValid#[\"12056Aabb412847\"]",
          "args": [
            "12056Aabb412847"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when contains letters or special characters"
        },
        {
          "id": "pis.isValid#[\"abcabcabcde\"]",
          "args": [
            "abcabcabcde"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when contains only letters or special characters"
        },
        {
          "id": "pis.isValid#[\"12056412547\"]",
          "args": [
            "12056412547"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when is an invalid PIS"
        },
        {
          "id": "pis.isValid#[\"12081636639\"]",
          "args": [
            "12081636639"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when is an invalid PIS"
        },
        {
          "id": "pis.isValid#[\"12056412847\"]",
          "args": [
            "12056412847"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid PIS without mask"
        },
        {
          "id": "pis.isValid#[\"120.5641.284-7\"]",
          "args": [
            "120.5641.284-7"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is valid PIS with mask"
        },
        {
          "id": "pis.isValid#[\"120/56874/10-7\"]",
          "args": [
            "120/56874/10-7"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is valid PIS with a slash mask"
        },
        {
          "id": "pis.isValid#[\"120 56874 10 7\"]",
          "args": [
            "120 56874 10 7"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is valid PIS with a whitespace mask"
        },
        {
          "id": "pis.isValid#[\"120.1213.266-0\"]",
          "args": [
            "120.1213.266-0"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid PIS with last digit 0"
        },
        {
          "id": "pis.isValid#[\"120.7041.469-0\"]",
          "args": [
            "120.7041.469-0"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid PIS with last digit 0"
        }
      ]
    },
    {
      "id": "pis.parse",
      "level": "extended",
      "summary": "Removes the formatting characters of a PIS number and returns only the digits.",
      "description": "Removes PIS formatting and keeps only digits, capped at 11 digits (the digits after the 11th are dropped).\n\n- A number is read only when it is a safe non-negative integer. A negative, fractional, non-finite or unsafe number returns an empty string (2.4.0 read the digits of any number, sign and decimal point dropped).\n- A value with no digits returns an empty string.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "pis.parse#masked",
          "args": [
            "123.45678.90-1"
          ],
          "expect": {
            "returns": "12345678901"
          }
        },
        {
          "id": "pis.parse#unmasked",
          "args": [
            "12345678901"
          ],
          "expect": {
            "returns": "12345678901"
          }
        },
        {
          "id": "pis.parse#strips-non-digits",
          "args": [
            "123#Error*&@#45678#Char!90-1"
          ],
          "expect": {
            "returns": "12345678901"
          }
        },
        {
          "id": "pis.parse#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          }
        },
        {
          "id": "pis.parse#caps-length",
          "args": [
            "12345678901123"
          ],
          "expect": {
            "returns": "12345678901"
          },
          "note": "reference truncates to the 11 characters of the document; asserted by the reference (JS) unit tests"
        },
        {
          "id": "pis.parse#[\"55984775363\"]",
          "args": [
            "55984775363"
          ],
          "expect": {
            "returns": "55984775363"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"55984775364\"]",
          "args": [
            "55984775364"
          ],
          "expect": {
            "returns": "55984775364"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"00000000000\"]",
          "args": [
            "00000000000"
          ],
          "expect": {
            "returns": "00000000000"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"36365790380\"]",
          "args": [
            "36365790380"
          ],
          "expect": {
            "returns": "36365790380"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"36365790381\"]",
          "args": [
            "36365790381"
          ],
          "expect": {
            "returns": "36365790381"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"73532010294\"]",
          "args": [
            "73532010294"
          ],
          "expect": {
            "returns": "73532010294"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"73532010295\"]",
          "args": [
            "73532010295"
          ],
          "expect": {
            "returns": "73532010295"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"559.84775.36-3\"]",
          "args": [
            "559.84775.36-3"
          ],
          "expect": {
            "returns": "55984775363"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"363.65790.38-0\"]",
          "args": [
            "363.65790.38-0"
          ],
          "expect": {
            "returns": "36365790380"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[\"735.32010.29-4\"]",
          "args": [
            "735.32010.29-4"
          ],
          "expect": {
            "returns": "73532010294"
          },
          "note": "consensus of 3 libs (python, ruby, rust)"
        },
        {
          "id": "pis.parse#[100.1]",
          "args": [
            100.1
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a fractional number gives an empty string. 2.4.0 returned \"1001\". JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.parse#[-1]",
          "args": [
            -1
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "pis.parse#[12345678901]",
          "args": [
            12345678901
          ],
          "expect": {
            "returns": "12345678901"
          },
          "note": "a safe non-negative integer is read as before"
        }
      ]
    }
  ]
}
