{
  "$schema": "../cases.schema.json",
  "format": 1,
  "domain": "cbo",
  "title": {
    "en": "CBO",
    "pt-BR": "CBO"
  },
  "functions": [
    {
      "id": "cbo.format",
      "level": "extended",
      "summary": "Formats a CBO code with the mask `NNNN-NN`.",
      "description": "Formats a CBO code with the mask `NNNN-NN`. Only the structure changes (use `cbo.isValid` to check the code against the table).\n\n- The mask is applied as far as the digits go, which is what an input being typed into needs.\n- `options.pad` (default `false`) first left-pads the value with zeros to 6 digits. A number is treated as the string of its digits, so it is padded only with `pad`.\n- A string is read for its digits: other characters are dropped and digits after the last one of the mask are ignored.\n- Returns an empty string when there is no digit at all, also with `pad`. `null` and `undefined` return an empty string too.\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.\n- New in 2.5.0 (#615), so every masked classification code has its formatter.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        },
        {
          "name": "options",
          "type": "FormatCboOptions",
          "optional": true
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "cbo.format#[\"212405\"]",
          "args": [
            "212405"
          ],
          "expect": {
            "returns": "2124-05"
          },
          "note": "JavaScript's own test: should format a CBO code given as digits"
        },
        {
          "id": "cbo.format#[212405]",
          "args": [
            212405
          ],
          "expect": {
            "returns": "2124-05"
          },
          "note": "JavaScript's own test: should format a CBO code given as a number"
        },
        {
          "id": "cbo.format#[\"2124-05\"]",
          "args": [
            "2124-05"
          ],
          "expect": {
            "returns": "2124-05"
          },
          "note": "JavaScript's own test: should format a CBO code that already has the mask"
        },
        {
          "id": "cbo.format#[\"999999\"]",
          "args": [
            "999999"
          ],
          "expect": {
            "returns": "9999-99"
          },
          "note": "JavaScript's own test: should not validate whether the code exists in the official table"
        },
        {
          "id": "cbo.format#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string for an empty value"
        },
        {
          "id": "cbo.format#[\"2\"]",
          "args": [
            "2"
          ],
          "expect": {
            "returns": "2"
          },
          "note": "JavaScript's own test: should mask a partial value progressively by default"
        },
        {
          "id": "cbo.format#[\"2124\"]",
          "args": [
            "2124"
          ],
          "expect": {
            "returns": "2124"
          },
          "note": "JavaScript's own test: should mask a partial value progressively by default"
        },
        {
          "id": "cbo.format#[\"21240\"]",
          "args": [
            "21240"
          ],
          "expect": {
            "returns": "2124-0"
          },
          "note": "JavaScript's own test: should mask a partial value progressively by default"
        },
        {
          "id": "cbo.format#[21]",
          "args": [
            21
          ],
          "expect": {
            "returns": "21"
          },
          "note": "JavaScript's own test: should mask a partial number progressively by default"
        },
        {
          "id": "cbo.format#[10205]",
          "args": [
            10205
          ],
          "expect": {
            "returns": "1020-5"
          },
          "note": "JavaScript's own test: should mask a partial number progressively by default"
        },
        {
          "id": "cbo.format#[\"2124059999\"]",
          "args": [
            "2124059999"
          ],
          "expect": {
            "returns": "2124-05"
          },
          "note": "JavaScript's own test: should not add digits after the CBO length"
        },
        {
          "id": "cbo.format#[\"\",{\"pad\":true}]",
          "args": [
            "",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: pad option should left pad a short code with zeros up to the full CBO length"
        },
        {
          "id": "cbo.format#[\"5\",{\"pad\":true}]",
          "args": [
            "5",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "0000-05"
          },
          "note": "JavaScript's own test: pad option should left pad a short code with zeros up to the full CBO length"
        },
        {
          "id": "cbo.format#[\"10205\",{\"pad\":true}]",
          "args": [
            "10205",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "0102-05"
          },
          "note": "JavaScript's own test: pad option should left pad a short code with zeros up to the full CBO length"
        },
        {
          "id": "cbo.format#[\"212405\",{\"pad\":true}]",
          "args": [
            "212405",
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "2124-05"
          },
          "note": "JavaScript's own test: pad option should left pad a short code with zeros up to the full CBO length"
        },
        {
          "id": "cbo.format#[5,{\"pad\":true}]",
          "args": [
            5,
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "0000-05"
          },
          "note": "JavaScript's own test: pad option should left pad a number the same way as its digits"
        },
        {
          "id": "cbo.format#[10205,{\"pad\":true}]",
          "args": [
            10205,
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": "0102-05"
          },
          "note": "JavaScript's own test: pad option should left pad a number the same way as its digits"
        },
        {
          "id": "cbo.format#[\"10205\",{\"pad\":false}]",
          "args": [
            "10205",
            {
              "pad": false
            }
          ],
          "expect": {
            "returns": "1020-5"
          },
          "note": "JavaScript's own test: pad option should mask progressively for an explicit false"
        },
        {
          "id": "cbo.format#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should return an empty string for null and undefined, even under pad"
        },
        {
          "id": "cbo.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"
        },
        {
          "id": "cbo.format#[\"abc212405\"]",
          "args": [
            "abc212405"
          ],
          "expect": {
            "returns": "2124-05"
          },
          "note": "JavaScript's own test: should read only the digits of a value with other characters, like formatCpf"
        },
        {
          "id": "cbo.format#[\"21.24/05\"]",
          "args": [
            "21.24/05"
          ],
          "expect": {
            "returns": "2124-05"
          },
          "note": "JavaScript's own test: should read only the digits of a value with other characters, like formatCpf"
        },
        {
          "id": "cbo.format#[-212405]",
          "args": [
            -212405
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cbo.format#[2124.05]",
          "args": [
            2124.05
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cbo.format#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        },
        {
          "id": "cbo.format#[-212405,{\"pad\":true}]",
          "args": [
            -212405,
            {
              "pad": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: when it is a negative, fractional or unsafe number"
        }
      ]
    },
    {
      "id": "cbo.get",
      "level": "extended",
      "summary": "Looks up a CBO code in the official CBO 2002 table.",
      "description": "Looks up a CBO code in the CBO 2002 occupation table and returns its `code` and official title (`description`).\n\n- Same input rules as `cbo.isValid`. The returned code is the 6 bare digits.\n- Returns `null` for an unknown code or a value not written in one of the accepted forms. A run of separators between the groups is accepted, as in `cbo.isValid` (`2124--05` gives the entry; until 2.4.0 it gave `null`).\n- It returns `null` exactly when `cbo.isValid` returns `false`. The table and its titles follow the current MTE release (10/07/2026). 106 titles changed from 2.4.0, and codes the MTE retired return `null`.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "Cbo?",
      "cases": [
        {
          "id": "cbo.get#[\"212405\"]",
          "args": [
            "212405"
          ],
          "expect": {
            "returns": {
              "code": "212405",
              "description": "Analista de desenvolvimento de sistemas"
            }
          }
        },
        {
          "id": "cbo.get#masked",
          "args": [
            "2124-05"
          ],
          "expect": {
            "returns": {
              "code": "212405",
              "description": "Analista de desenvolvimento de sistemas"
            }
          },
          "note": "from the maintainer briefing, #599"
        },
        {
          "id": "cbo.get#leading-zero",
          "args": [
            "0102-05"
          ],
          "expect": {
            "returns": {
              "code": "010205",
              "description": "Oficial da aeronáutica"
            }
          }
        },
        {
          "id": "cbo.get#nonexistent",
          "args": [
            "223150"
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "cbo.get#[\"000000\"]",
          "args": [
            "000000"
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "cbo.get#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "cbo.get#[212405]",
          "args": [
            212405
          ],
          "expect": {
            "returns": {
              "code": "212405",
              "description": "Analista de desenvolvimento de sistemas"
            }
          },
          "note": "JavaScript's own test: should return the occupation for a code given as a number"
        },
        {
          "id": "cbo.get#[\"102-05\"]",
          "args": [
            "102-05"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should not pad a masked value, which already carries its separators"
        },
        {
          "id": "cbo.get#[\"142135\"]",
          "args": [
            "142135"
          ],
          "expect": {
            "returns": {
              "code": "142135",
              "description": "Oficial de proteção de dados pessoais (dpo)"
            }
          },
          "note": "JavaScript's own test: should resolve a code the official CSV carries and the community mirror did not (142135)"
        },
        {
          "id": "cbo.get#[\"2124--05\"]",
          "args": [
            "2124--05"
          ],
          "expect": {
            "returns": {
              "code": "212405",
              "description": "Analista de desenvolvimento de sistemas"
            }
          },
          "note": "changed in 2.5.0 (#615): a run of separators between the groups is accepted (2.4.0 gave null). JavaScript's own test: should accept a group boundary written with a run of separators (2124--05), as isValidCpf does"
        },
        {
          "id": "cbo.get#[\"2124 05\"]",
          "args": [
            "2124 05"
          ],
          "expect": {
            "returns": {
              "code": "212405",
              "description": "Analista de desenvolvimento de sistemas"
            }
          },
          "note": "JavaScript's own test: should accept a group boundary written with a run of separators (2124--05), as isValidCpf does"
        },
        {
          "id": "cbo.get#[\"21240\"]",
          "args": [
            "21240"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a padded short value no occupation carries and for a wider value"
        },
        {
          "id": "cbo.get#[\"2124055\"]",
          "args": [
            "2124055"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a padded short value no occupation carries and for a wider value"
        },
        {
          "id": "cbo.get#[\"      \"]",
          "args": [
            "      "
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for whitespace only"
        },
        {
          "id": "cbo.get#[\"2124abc05\"]",
          "args": [
            "2124abc05"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a string that is not written in a documented form"
        },
        {
          "id": "cbo.get#[\"21-2405\"]",
          "args": [
            "21-2405"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a string that is not written in a documented form"
        },
        {
          "id": "cbo.get#[-212405]",
          "args": [
            -212405
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a number that is not a non-negative safe integer"
        },
        {
          "id": "cbo.get#[2124.05]",
          "args": [
            2124.05
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null for a number that is not a non-negative safe integer"
        },
        {
          "id": "cbo.get#[\"782325\"]",
          "args": [
            "782325"
          ],
          "expect": {
            "returns": {
              "code": "782325",
              "description": "Motorista de transporte por aplicativos"
            }
          },
          "note": "added in the MTE release of 10/07/2026 (#599)"
        },
        {
          "id": "cbo.get#[\"142360\"]",
          "args": [
            "142360"
          ],
          "expect": {
            "returns": {
              "code": "142360",
              "description": "Analista de sucesso do cliente - customer success"
            }
          },
          "note": "added in the MTE release of 10/07/2026 (#599)"
        },
        {
          "id": "cbo.get#[\"225157\"]",
          "args": [
            "225157"
          ],
          "expect": {
            "returns": {
              "code": "225157",
              "description": "Médico emergencista"
            }
          },
          "note": "added in the MTE release of 10/07/2026 (#599)"
        },
        {
          "id": "cbo.get#[\"322705\"]",
          "args": [
            "322705"
          ],
          "expect": {
            "returns": {
              "code": "322705",
              "description": "Técnico em acupuntura"
            }
          },
          "note": "#599: Técnico em acupuntura moved to this code"
        },
        {
          "id": "cbo.get#[\"121010\"]",
          "args": [
            "121010"
          ],
          "expect": {
            "returns": {
              "code": "121010",
              "description": "Diretor geral de empresa e organizações (exceto do terceiro setor)"
            }
          },
          "note": "changed in 2.5.0 (#599): title renamed in the MTE release of 10/07/2026 (2.4.0: \"… (exceto de interesse público)\")"
        },
        {
          "id": "cbo.get#[\"214535\"]",
          "args": [
            "214535"
          ],
          "expect": {
            "returns": {
              "code": "214535",
              "description": "Tecnólogo em produção sucroalcooleira"
            }
          },
          "note": "changed in 2.5.0 (#599): title renamed in the MTE release of 10/07/2026 (2.4.0: \"Tecnólogo em produção sulcroalcooleira\")"
        },
        {
          "id": "cbo.get#[\"225142\"]",
          "args": [
            "225142"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 returned its entry"
        },
        {
          "id": "cbo.get#[\"322105\"]",
          "args": [
            "322105"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 returned its entry"
        },
        {
          "id": "cbo.get#[\"322115\"]",
          "args": [
            "322115"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 returned its entry"
        },
        {
          "id": "cbo.get#[\"322120\"]",
          "args": [
            "322120"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 returned its entry"
        },
        {
          "id": "cbo.get#[\"322125\"]",
          "args": [
            "322125"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 returned its entry"
        },
        {
          "id": "cbo.get#[\"782820\"]",
          "args": [
            "782820"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 returned its entry"
        }
      ]
    },
    {
      "id": "cbo.isValid",
      "level": "extended",
      "summary": "Checks whether a CBO code exists in the official CBO 2002 table.",
      "description": "Checks whether a CBO code exists in the official CBO 2002 occupation table.\n\n- Accepts the 6 digits, the `NNNN-NN` mask or a non-negative integer. A masked string may have any run of separators (space, `.`, `-` or `/`) between the groups: `2124--05` is valid. Until 2.4.0 the mask had a single separator and `2124--05` was rejected.\n- Separators are accepted only at the boundary between the groups: `2124-0-5` and `21-2405` are invalid. Surrounding whitespace is ignored.\n- Bare digits (string or number) are left-padded with zeros to 6. A masked value is read as written.\n- Any other string is rejected. The function does not pick out its digits.\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- The table follows the current release of the MTE, the \"Estrutura CBO (CSV)\" files of 10/07/2026 with 2,725 occupations. 2.4.0 used the older gov.br CSV of 06/06/2025 (2,694 occupations).\n- A code the MTE retired is no longer valid. 225142, 322105, 322115, 322120, 322125 and 782820 were valid in 2.4.0 and are invalid now. Some moved to new codes: Técnico em acupuntura is now 322705.\n- 37 occupations were added, among them 782325 (Motorista de transporte por aplicativos), 142360 and 225157.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "cbo.isValid#[\"212405\"]",
          "args": [
            "212405"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "cbo.isValid#masked",
          "args": [
            "2124-05"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "cbo.isValid#leading-zero",
          "args": [
            "010205"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "cbo.isValid#nonexistent",
          "args": [
            "223150"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "cbo.isValid#zeros",
          "args": [
            "000000"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "cbo.isValid#too-short",
          "args": [
            "21240"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "cbo.isValid#letters",
          "args": [
            "abcdef"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "cbo.isValid#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "cbo.isValid#[212405]",
          "args": [
            212405
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should validate a CBO code given as a number"
        },
        {
          "id": "cbo.isValid#[10205]",
          "args": [
            10205
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should pad a value with leading zeros before looking it up, as a number or as a string"
        },
        {
          "id": "cbo.isValid#[\"10205\"]",
          "args": [
            "10205"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should pad a value with leading zeros before looking it up, as a number or as a string"
        },
        {
          "id": "cbo.isValid#[\"102-05\"]",
          "args": [
            "102-05"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should not pad a masked value, which already carries its separators"
        },
        {
          "id": "cbo.isValid#[\"0102-05\"]",
          "args": [
            "0102-05"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should not pad a masked value, which already carries its separators"
        },
        {
          "id": "cbo.isValid#[\" 212405 \"]",
          "args": [
            " 212405 "
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should validate a CBO code with surrounding whitespace"
        },
        {
          "id": "cbo.isValid#[\"142135\"]",
          "args": [
            "142135"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should accept a code the official CSV carries and the community mirror did not (142135)"
        },
        {
          "id": "cbo.isValid#[\"2124--05\"]",
          "args": [
            "2124--05"
          ],
          "expect": {
            "returns": true
          },
          "note": "changed in 2.5.0 (#615): a run of separators between the groups is accepted (2.4.0 rejected it). JavaScript's own test: should accept a group boundary written with a run of separators (2124--05), as isValidCpf does"
        },
        {
          "id": "cbo.isValid#[\"2124 05\"]",
          "args": [
            "2124 05"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should accept a group boundary written with a run of separators (2124--05), as isValidCpf does"
        },
        {
          "id": "cbo.isValid#[\"2124055\"]",
          "args": [
            "2124055"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for a padded short value no occupation carries and for a wider value"
        },
        {
          "id": "cbo.isValid#[\"      \"]",
          "args": [
            "      "
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for whitespace only"
        },
        {
          "id": "cbo.isValid#[\"2124.05\"]",
          "args": [
            "2124.05"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should accept the separators the mask uses between the two groups"
        },
        {
          "id": "cbo.isValid#[\"2124/05\"]",
          "args": [
            "2124/05"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should accept the separators the mask uses between the two groups"
        },
        {
          "id": "cbo.isValid#[\"2124abc05\"]",
          "args": [
            "2124abc05"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for a string that is not written in a documented form"
        },
        {
          "id": "cbo.isValid#[\"21-2405\"]",
          "args": [
            "21-2405"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for a string that is not written in a documented form"
        },
        {
          "id": "cbo.isValid#[\"+212405\"]",
          "args": [
            "+212405"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for a string that is not written in a documented form"
        },
        {
          "id": "cbo.isValid#[-212405]",
          "args": [
            -212405
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for a number that is not a non-negative safe integer"
        },
        {
          "id": "cbo.isValid#[2124.05]",
          "args": [
            2124.05
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for a number that is not a non-negative safe integer"
        },
        {
          "id": "cbo.isValid#[\"782325\"]",
          "args": [
            "782325"
          ],
          "expect": {
            "returns": true
          },
          "note": "from the maintainer briefing, #599. JavaScript's own test: should accept an occupation the MTE added after the older gov.br release (782325, Motorista de transporte por aplicativos)"
        },
        {
          "id": "cbo.isValid#[\"142360\"]",
          "args": [
            "142360"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should accept an occupation the MTE added after the older gov.br release (782325, Motorista de transporte por aplicativos), which also asserts 142360"
        },
        {
          "id": "cbo.isValid#[\"225157\"]",
          "args": [
            "225157"
          ],
          "expect": {
            "returns": true
          },
          "note": "added in the MTE release of 10/07/2026 (#599): Médico emergencista"
        },
        {
          "id": "cbo.isValid#[\"322705\"]",
          "args": [
            "322705"
          ],
          "expect": {
            "returns": true
          },
          "note": "#599: Técnico em acupuntura, the new code of an occupation that was 3221xx"
        },
        {
          "id": "cbo.isValid#[\"322105\"]",
          "args": [
            "322105"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #599. changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 accepted it. JavaScript's own test: should reject an occupation the MTE has dropped (322105 and 782820)"
        },
        {
          "id": "cbo.isValid#[\"782820\"]",
          "args": [
            "782820"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 accepted it. JavaScript's own test: should reject an occupation the MTE has dropped (322105 and 782820)"
        },
        {
          "id": "cbo.isValid#[\"225142\"]",
          "args": [
            "225142"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 accepted it"
        },
        {
          "id": "cbo.isValid#[\"322115\"]",
          "args": [
            "322115"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 accepted it"
        },
        {
          "id": "cbo.isValid#[\"322120\"]",
          "args": [
            "322120"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 accepted it"
        },
        {
          "id": "cbo.isValid#[\"322125\"]",
          "args": [
            "322125"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#599): the MTE dropped this code from the current CBO release (10/07/2026); 2.4.0 accepted it"
        },
        {
          "id": "cbo.isValid#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false for a number that is not a non-negative safe integer (2 ** 53)"
        },
        {
          "id": "cbo.isValid#[\"2124-0-5\"]",
          "args": [
            "2124-0-5"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should accept a group boundary written with a run of separators (2124--05), as isValidCpf does"
        }
      ]
    },
    {
      "id": "cbo.parse",
      "level": "extended",
      "summary": "Removes the formatting characters of a CBO code and returns only the digits.",
      "description": "Removes CBO formatting and keeps only digits, capped at 6 digits.\n\n- It does not left-pad anything. A leading zero must be written out.\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 (2.4.0 read the digits of any number, sign and decimal point dropped).",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "cbo.parse#masked",
          "args": [
            "2124-05"
          ],
          "expect": {
            "returns": "212405"
          }
        },
        {
          "id": "cbo.parse#unmasked",
          "args": [
            "212405"
          ],
          "expect": {
            "returns": "212405"
          }
        },
        {
          "id": "cbo.parse#strips-non-digits",
          "args": [
            "21?ABC24-05abc"
          ],
          "expect": {
            "returns": "212405"
          }
        },
        {
          "id": "cbo.parse#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          }
        },
        {
          "id": "cbo.parse#caps-length",
          "args": [
            "212405999"
          ],
          "expect": {
            "returns": "212405"
          },
          "note": "reference truncates to the 6 characters of the document; asserted by the reference (JS) unit tests"
        },
        {
          "id": "cbo.parse#[212405]",
          "args": [
            212405
          ],
          "expect": {
            "returns": "212405"
          },
          "note": "JavaScript's own test: should read a number as the string of its digits"
        },
        {
          "id": "cbo.parse#[\"10205\"]",
          "args": [
            "10205"
          ],
          "expect": {
            "returns": "10205"
          },
          "note": "JavaScript's own test: should keep a partial code as written, without padding it"
        },
        {
          "id": "cbo.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": "cbo.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": "cbo.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)"
        }
      ]
    }
  ]
}
