{
  "$schema": "../cases.schema.json",
  "format": 1,
  "domain": "cest",
  "title": {
    "en": "CEST",
    "pt-BR": "CEST"
  },
  "functions": [
    {
      "id": "cest.format",
      "level": "extended",
      "summary": "Formats a CEST as `NN.NNN.NN`.",
      "description": "Formats a CEST with the mask `NN.NNN.NN` (segment, item, specification), the form the annexes print. Only the structure changes (use `cest.isValid` to check the code).\n\n- The mask is progressive: a partial value is masked as far as it goes (`01001` gives `01.001`). Characters that are not digits are dropped, and digits after the 7th are ignored.\n- `options.pad` first left-pads the value with zeros to 7 digits. Without it, a number that lost its leading zero shifts the mask: `100100` gives `10.010.0`, and `01.001.00` with `pad`.\n- A value with no digits, and `null` or `undefined`, gives an empty string even with `pad`.\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.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        },
        {
          "name": "options",
          "type": "FormatCestOptions",
          "optional": true
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "cest.format#[\"01001\"]",
          "args": [
            "01001"
          ],
          "expect": {
            "returns": "01.001"
          },
          "note": "from the maintainer briefing, #564 (progressive mask)"
        },
        {
          "id": "cest.format#[-2899900]",
          "args": [
            -2899900
          ],
          "expect": {
            "returns": ""
          },
          "note": "from the maintainer briefing, #564"
        },
        {
          "id": "cest.format#[\"0100100\"]",
          "args": [
            "0100100"
          ],
          "expect": {
            "returns": "01.001.00"
          },
          "note": "JavaScript's own test: should format a CEST given as digits"
        },
        {
          "id": "cest.format#[2899900]",
          "args": [
            2899900
          ],
          "expect": {
            "returns": "28.999.00"
          },
          "note": "JavaScript's own test: should format a CEST given as a number"
        },
        {
          "id": "cest.format#[\"17.024.05\"]",
          "args": [
            "17.024.05"
          ],
          "expect": {
            "returns": "17.024.05"
          },
          "note": "JavaScript's own test: should leave a CEST that already has the mask as it is"
        },
        {
          "id": "cest.format#[\"0\"]",
          "args": [
            "0"
          ],
          "expect": {
            "returns": "0"
          },
          "note": "JavaScript's own test: should mask a partial value progressively by default"
        },
        {
          "id": "cest.format#[\"01\"]",
          "args": [
            "01"
          ],
          "expect": {
            "returns": "01"
          },
          "note": "JavaScript's own test: should mask a partial value progressively by default"
        },
        {
          "id": "cest.format#[\"010\"]",
          "args": [
            "010"
          ],
          "expect": {
            "returns": "01.0"
          },
          "note": "JavaScript's own test: should mask a partial value progressively by default"
        },
        {
          "id": "cest.format#[\"010010\"]",
          "args": [
            "010010"
          ],
          "expect": {
            "returns": "01.001.0"
          },
          "note": "JavaScript's own test: should mask a partial value progressively by default"
        },
        {
          "id": "cest.format#[100100]",
          "args": [
            100100
          ],
          "expect": {
            "returns": "10.010.0"
          },
          "note": "JavaScript's own test: should not pad a number by default, so a lost leading zero shifts the mask"
        },
        {
          "id": "cest.format#[\"0000000\"]",
          "args": [
            "0000000"
          ],
          "expect": {
            "returns": "00.000.00"
          },
          "note": "JavaScript's own test: should not check the code against the annexes"
        },
        {
          "id": "cest.format#[\"01001009999\"]",
          "args": [
            "01001009999"
          ],
          "expect": {
            "returns": "01.001.00"
          },
          "note": "JavaScript's own test: should not add digits after the CEST length"
        },
        {
          "id": "cest.format#[\"\",{\"pad\":true}]",
          "args": [
            "",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "a value without digits gives an empty string even with pad. JavaScript's own test: should left pad a short value with zeros up to the 7 digits"
        },
        {
          "id": "cest.format#[\"1\",{\"pad\":true}]",
          "args": [
            "1",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "00.000.01"
          },
          "note": "JavaScript's own test: should left pad a short value with zeros up to the 7 digits"
        },
        {
          "id": "cest.format#[\"100100\",{\"pad\":true}]",
          "args": [
            "100100",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "01.001.00"
          },
          "note": "JavaScript's own test: should left pad a short value with zeros up to the 7 digits"
        },
        {
          "id": "cest.format#[\"2899900\",{\"pad\":true}]",
          "args": [
            "2899900",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "28.999.00"
          },
          "note": "JavaScript's own test: should left pad a short value with zeros up to the 7 digits"
        },
        {
          "id": "cest.format#[100100,{\"pad\":true}]",
          "args": [
            100100,
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "01.001.00"
          },
          "note": "JavaScript's own test: should left pad a number the same way as its digits"
        },
        {
          "id": "cest.format#[\"01001\",{\"pad\":false}]",
          "args": [
            "01001",
            {
              "pad": false
            }
          ],
          "expect": {
            "returns": "01.001"
          },
          "note": "JavaScript's own test: should mask progressively for an explicit false"
        },
        {
          "id": "cest.format#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string for an empty value, and for null and undefined even under pad"
        },
        {
          "id": "cest.format#[\"abc0100100\"]",
          "args": [
            "abc0100100"
          ],
          "expect": {
            "returns": "01.001.00"
          },
          "note": "JavaScript's own test: should read only the digits of a value with other characters, like formatCpf"
        },
        {
          "id": "cest.format#[\"01-001/00\"]",
          "args": [
            "01-001/00"
          ],
          "expect": {
            "returns": "01.001.00"
          },
          "note": "JavaScript's own test: should read only the digits of a value with other characters, like formatCpf"
        },
        {
          "id": "cest.format#[289990.1]",
          "args": [
            289990.1
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cest.format#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cest.format#[-2899900,{\"pad\":true}]",
          "args": [
            -2899900,
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cest.format#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string for null and undefined"
        },
        {
          "id": "cest.format#[null,{\"pad\":true}]",
          "args": [
            null,
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string for null and undefined even under pad, instead of a zero-filled code"
        },
        {
          "id": "cest.format#[\"abc\",{\"pad\":true}]",
          "args": [
            "abc",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "an input with no digit stays empty under pad"
        }
      ]
    },
    {
      "id": "cest.get",
      "level": "extended",
      "summary": "Looks up a CEST in Convênio ICMS 142/18.",
      "description": "Looks up a CEST in the annexes of Convênio ICMS 142/18 and returns its code, description and segment. Returns `null` exactly when `cest.isValid` is `false`.\n\n- Same input rules as `cest.isValid` (including a run of separators between the groups, `05..001.00`): a revoked item, an unknown code and a value not in an accepted form return `null`.\n- `code` is the 7 digits, without mask. `description` is the wording in force of the annex. `segment` is the name of the segment in Anexo I.\n- Returns a new object on every call.\n- The NCM/SH codes the annexes pair each CEST with are not part of the entry.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "Cest?",
      "cases": [
        {
          "id": "cest.get#[\"05.001.00\"]",
          "args": [
            "05.001.00"
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "from the maintainer briefing, #564"
        },
        {
          "id": "cest.get#[\"0500100\"]",
          "args": [
            "0500100"
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "JavaScript's own test: should return the entry for a known code written as 7 digits"
        },
        {
          "id": "cest.get#[\"01.001.00\"]",
          "args": [
            "01.001.00"
          ],
          "expect": {
            "returns": {
              "code": "0100100",
              "description": "Catalisadores em colmeia cerâmica ou metálica para conversão catalítica de gases de escape de veículos e outros catalisadores",
              "segment": "Autopeças"
            }
          },
          "note": "JavaScript's own test: should return the entry for a code in the NN.NNN.NN form the annexes print"
        },
        {
          "id": "cest.get#[500100]",
          "args": [
            500100
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "JavaScript's own test: should left pad a bare code to 7 digits, as a number or as a string"
        },
        {
          "id": "cest.get#[\"500100\"]",
          "args": [
            "500100"
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "JavaScript's own test: should left pad a bare code to 7 digits, as a number or as a string"
        },
        {
          "id": "cest.get#[2899900]",
          "args": [
            2899900
          ],
          "expect": {
            "returns": {
              "code": "2899900",
              "description": "Outros produtos comercializados pelo sistema de marketing direto porta-a-porta a consumidor final não relacionados em outros itens deste anexo",
              "segment": "Venda de mercadorias pelo sistema porta a porta"
            }
          },
          "note": "JavaScript's own test: should left pad a bare code to 7 digits, as a number or as a string"
        },
        {
          "id": "cest.get#[\"5.001.00\"]",
          "args": [
            "5.001.00"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should not pad a masked code"
        },
        {
          "id": "cest.get#[\" 05.001.00 \"]",
          "args": [
            " 05.001.00 "
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "JavaScript's own test: should accept any single documented separator and the whitespace around a code"
        },
        {
          "id": "cest.get#[\"\\t05 001-00\\n\"]",
          "args": [
            "\t05 001-00\n"
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "JavaScript's own test: should accept any single documented separator and the whitespace around a code"
        },
        {
          "id": "cest.get#[\"05/00100\"]",
          "args": [
            "05/00100"
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "JavaScript's own test: should accept any single documented separator and the whitespace around a code"
        },
        {
          "id": "cest.get#[\"16.001.00\"]",
          "args": [
            "16.001.00"
          ],
          "expect": {
            "returns": {
              "code": "1600100",
              "description": "Pneus novos, dos tipos utilizados em automóveis de passageiros (incluídos os veículos de uso misto - camionetas e os automóveis de corrida)",
              "segment": "Pneumáticos, câmaras de ar e protetores de borracha"
            }
          },
          "note": "JavaScript's own test: should name the segment by its code, not by its item number in Anexo I (segments 16 and 28)"
        },
        {
          "id": "cest.get#[\"09.004.00\"]",
          "args": [
            "09.004.00"
          ],
          "expect": {
            "returns": {
              "code": "0900400",
              "description": "“Starter”",
              "segment": "Lâmpadas, reatores e “starter”"
            }
          },
          "note": "JavaScript's own test: should keep the annex punctuation, without the trailing one (09.004.00 and 13.009.00)"
        },
        {
          "id": "cest.get#[\"03.001.00\"]",
          "args": [
            "03.001.00"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a revoked item (03.001.00, 17.049.08 and 20.035.01)"
        },
        {
          "id": "cest.get#[\"17.049.08\"]",
          "args": [
            "17.049.08"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a revoked item (03.001.00, 17.049.08 and 20.035.01)"
        },
        {
          "id": "cest.get#[\"20.035.01\"]",
          "args": [
            "20.035.01"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a revoked item (03.001.00, 17.049.08 and 20.035.01)"
        },
        {
          "id": "cest.get#[\"0000000\"]",
          "args": [
            "0000000"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for an unknown code and for a segment that does not exist (15 and 18)"
        },
        {
          "id": "cest.get#[\"15.001.00\"]",
          "args": [
            "15.001.00"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for an unknown code and for a segment that does not exist (15 and 18)"
        },
        {
          "id": "cest.get#[\"18.001.00\"]",
          "args": [
            "18.001.00"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for an unknown code and for a segment that does not exist (15 and 18)"
        },
        {
          "id": "cest.get#[\"05001000\"]",
          "args": [
            "05001000"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a code longer than 7 digits"
        },
        {
          "id": "cest.get#[50010000]",
          "args": [
            50010000
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a code longer than 7 digits"
        },
        {
          "id": "cest.get#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a string that is not a documented form"
        },
        {
          "id": "cest.get#[\"abc0500100\"]",
          "args": [
            "abc0500100"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a string that is not a documented form"
        },
        {
          "id": "cest.get#[\"05..001.00\"]",
          "args": [
            "05..001.00"
          ],
          "expect": {
            "returns": {
              "code": "0500100",
              "description": "Cimento",
              "segment": "Cimentos"
            }
          },
          "note": "a run of separators between the groups is accepted. JavaScript's own test: should accept a group boundary written with a run of separators"
        },
        {
          "id": "cest.get#[\"050.01.00\"]",
          "args": [
            "050.01.00"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a string that is not a documented form"
        },
        {
          "id": "cest.get#[-500100]",
          "args": [
            -500100
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a number that is not a non-negative safe integer"
        },
        {
          "id": "cest.get#[50010.5]",
          "args": [
            50010.5
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a number that is not a non-negative safe integer"
        },
        {
          "id": "cest.get#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a number that is not a non-negative safe integer"
        }
      ]
    },
    {
      "id": "cest.isValid",
      "level": "extended",
      "summary": "Checks whether a CEST is in force.",
      "description": "Checks whether a CEST is listed in the annexes of Convênio ICMS 142/18 (Anexos II to XXVI of the consolidated text, last amended by Convênio ICMS 180/24).\n\n- A CEST has 7 digits: the first two digits are the segment, digits 3 to 5 are the item and the last two are the specification of the item (cláusula sexta, IV of the Convênio).\n- Accepted string forms: 7 digits, or `NN.NNN.NN` with any run of separators (space, `.`, `-` or `/`) between the groups, or none, and optional surrounding whitespace. Any other string is invalid: its digits are not picked out.\n- Bare digits are left-padded with zeros to 7, as a string or as a number, because segments 01 to 09 start with zero: `100100`, `\"100100\"` and `\"0100100\"` are the same code. A masked value is read as written.\n- A number is read only when it is a safe non-negative integer. A negative, fractional, non-finite or unsafe number is invalid.\n- Revoked items are invalid, for example 01.110.00, 03.001.00, 03.002.00, 03.004.00, 03.010.03, 03.014.00, 03.016.00, 10.023.00, 17.049.08, 17.049.09 and 20.035.01.\n- The table has 1,040 codes in 25 segments (Anexo I). Segments 15, 18 and 27 do not exist.\n- The NCM/SH column of the annexes is not loaded, and there is no CEST×NCM cross-check. By cláusula sétima, the description is what decides.\n- Whether a state applies ICMS-ST to the code depends on state law and is out of scope. MVA/PMPF and Anexo XXVII are out of scope too.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "cest.isValid#[\"01.001.00\"]",
          "args": [
            "01.001.00"
          ],
          "expect": {
            "returns": true
          },
          "note": "from the maintainer briefing, #564"
        },
        {
          "id": "cest.isValid#[100100]",
          "args": [
            100100
          ],
          "expect": {
            "returns": true
          },
          "note": "from the maintainer briefing, #564 (read as 0100100)"
        },
        {
          "id": "cest.isValid#[\"03.001.00\"]",
          "args": [
            "03.001.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"01.110.00\"]",
          "args": [
            "01.110.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"03.002.00\"]",
          "args": [
            "03.002.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"03.004.00\"]",
          "args": [
            "03.004.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"03.010.03\"]",
          "args": [
            "03.010.03"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"03.014.00\"]",
          "args": [
            "03.014.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"03.016.00\"]",
          "args": [
            "03.016.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"10.023.00\"]",
          "args": [
            "10.023.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"17.049.08\"]",
          "args": [
            "17.049.08"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"17.049.09\"]",
          "args": [
            "17.049.09"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"20.035.01\"]",
          "args": [
            "20.035.01"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (revoked)"
        },
        {
          "id": "cest.isValid#[\"27.001.00\"]",
          "args": [
            "27.001.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #564 (segment 27 does not exist)"
        },
        {
          "id": "cest.isValid#[\"0100100\"]",
          "args": [
            "0100100"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should validate a CEST without a mask"
        },
        {
          "id": "cest.isValid#[\"28.999.00\"]",
          "args": [
            "28.999.00"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should validate a CEST in the NN.NNN.NN form"
        },
        {
          "id": "cest.isValid#[\"100100\"]",
          "args": [
            "100100"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should validate a bare code that lost its leading zero, as a number or as a string"
        },
        {
          "id": "cest.isValid#[\"03.021.00\"]",
          "args": [
            "03.021.00"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should validate the specifications of an item (03.021.00 to 03.021.06)"
        },
        {
          "id": "cest.isValid#[\"03.021.06\"]",
          "args": [
            "03.021.06"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should validate the specifications of an item (03.021.00 to 03.021.06)"
        },
        {
          "id": "cest.isValid#[\"03.021.07\"]",
          "args": [
            "03.021.07"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should validate the specifications of an item (03.021.00 to 03.021.06)"
        },
        {
          "id": "cest.isValid#[\"0000000\"]",
          "args": [
            "0000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject an unknown code"
        },
        {
          "id": "cest.isValid#[\"9999999\"]",
          "args": [
            "9999999"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject an unknown code"
        },
        {
          "id": "cest.isValid#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject a value that is not a documented form"
        },
        {
          "id": "cest.isValid#[\"abc0100100\"]",
          "args": [
            "abc0100100"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject a value that is not a documented form"
        },
        {
          "id": "cest.isValid#[\"01.001.00.\"]",
          "args": [
            "01.001.00."
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject a value that is not a documented form"
        },
        {
          "id": "cest.isValid#[\"1.001.00\"]",
          "args": [
            "1.001.00"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject a value that is not a documented form"
        },
        {
          "id": "cest.isValid#[-100100]",
          "args": [
            -100100
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject a number that is not a non-negative safe integer"
        },
        {
          "id": "cest.isValid#[10010.5]",
          "args": [
            10010.5
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should reject a number that is not a non-negative safe integer"
        },
        {
          "id": "cest.isValid#whitespace-only",
          "args": [
            "       "
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "cest.isValid#[\"05..001.00\"]",
          "args": [
            "05..001.00"
          ],
          "expect": {
            "returns": true
          },
          "note": "a run of separators between the groups is accepted. same rule as cest.get"
        }
      ]
    },
    {
      "id": "cest.parse",
      "level": "extended",
      "summary": "Removes the formatting characters of a CEST and returns only the digits.",
      "description": "Removes CEST formatting and keeps only digits, capped at 7.\n\n- The function does not left-pad the value. It keeps a partial code as written, so the leading zero of segments 01 to 09 has to be written out. `cest.isValid` and `cest.get` do pad bare digits.\n- Returns an empty string when there is no digit at all (`null` and `undefined` included).\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.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "cest.parse#[\"01.001.00\"]",
          "args": [
            "01.001.00"
          ],
          "expect": {
            "returns": "0100100"
          },
          "note": "JavaScript's own test: should remove the CEST mask characters"
        },
        {
          "id": "cest.parse#[\"CEST 28-999/00 \"]",
          "args": [
            "CEST 28-999/00 "
          ],
          "expect": {
            "returns": "2899900"
          },
          "note": "JavaScript's own test: should remove every character that is not a digit"
        },
        {
          "id": "cest.parse#[\"01001009876\"]",
          "args": [
            "01001009876"
          ],
          "expect": {
            "returns": "0100100"
          },
          "note": "JavaScript's own test: should ignore the digits after the CEST length"
        },
        {
          "id": "cest.parse#[2899900]",
          "args": [
            2899900
          ],
          "expect": {
            "returns": "2899900"
          },
          "note": "JavaScript's own test: should read a number as the string of its digits, without padding it"
        },
        {
          "id": "cest.parse#[100100]",
          "args": [
            100100
          ],
          "expect": {
            "returns": "100100"
          },
          "note": "JavaScript's own test: should read a number as the string of its digits, without padding it"
        },
        {
          "id": "cest.parse#[\"28.999\"]",
          "args": [
            "28.999"
          ],
          "expect": {
            "returns": "28999"
          },
          "note": "JavaScript's own test: should keep a partial code as written"
        },
        {
          "id": "cest.parse#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should keep a partial code as written"
        },
        {
          "id": "cest.parse#[28999.00001]",
          "args": [
            28999.00001
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cest.parse#[-1]",
          "args": [
            -1
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cest.parse#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        }
      ]
    }
  ]
}
