{
  "$schema": "../cases.schema.json",
  "format": 1,
  "domain": "phone",
  "title": {
    "en": "Phone",
    "pt-BR": "Telefone"
  },
  "functions": [
    {
      "id": "phone.format",
      "level": "core",
      "summary": "Formats a Brazilian phone number with one of several masks.",
      "description": "Formats a phone number according to Brazilian patterns.\n\n- `options.mask` (default `sn`) picks the pattern: `sn` (subscriber number only, 9 digits: `98765-4321`), `nanp` (DDD plus number, `(11) 90000-0000`, 11 digits for a mobile and 10 for a landline, any other length keeps the 11-digit grouping), `e164` (`+5511987654321`), `international` (`+55 11 98765-4321`), `service` (`0800 123 4567`, `4004-1234`) and `auto`. An unknown `mask` falls back to `sn`.\n- If the value includes a DDD, pass `{ mask: \"auto\" }` or `\"nanp\"`: the default `sn` mask assumes no DDD and truncates one (`11900000000` gives `11900-0000`).\n- `auto` picks `service` for a service number, `international` when the value carries a country code, otherwise `nanp` for more than 9 digits and `sn` for the rest.\n- `e164` and `international` first drop a country code in the input, as `phone.parse` does, and fall back to `service` for a service number. `e164` keeps at most the 11 national digits, as `international` does (`119888877660000` gives `+5511988887766`). Until 2.4.0 `e164` kept them all.\n- `sn` and `nanp` drop an explicit `+55` or `0055` too, so `+5511987654321` gives `(11) 98765-4321` under `nanp`. Until 2.4.0 it gave `(55) 11987-6543`. A bare `55` stays, since it may be the DDD (`5511988887777` gives `(55) 11988-8877` under `nanp`).\n- A number still being typed after an explicit country code is formatted as far as it goes (`+55 11 9` gives `+55 11 9` under `international` and `auto`, `+55119` under `e164`). The value `+55` alone returns an empty string.\n- `options.obfuscate` (default `false`, read for truthiness) hides the subscriber number with `*` under every mask. It keeps the prefix that names a region or a service (the DDD, `+55`, the `0800`-like code, the `300X`/`400X` root) and the last 2 digits the mask has room for: `(11) *****-**21`, `0800 *** **67`, `4004-**34`. This is a convention of the library, not an official rule. It keeps the count of the gov.br account, which shows only the last 2 digits of a mobile. The DDD stays visible, although gov.br hides it.\n- With the default subscriber-number mask, a DDD-prefixed value is truncated before it is obfuscated, so the visible pair is not the last 2 digits of the input (`11987654321` gives `*****-**43`). Pass `{ mask: \"auto\" }` when the value has a DDD.\n- Under the `service` mask with `obfuscate`, a value that is only a service prefix so far keeps it (`0800` stays `0800`), since the prefix names a service, not a subscriber. A value too short to be recognized (`080`) is fully hidden (`***`). A value that is not a service number becomes one `*` per digit, which hides the digits but not how many there were.\n- With `obfuscate`, a valid 3-digit public utility code (`190`) is returned as it is under the `service`, `auto`, `e164` and `international` masks. The `sn` and `nanp` masks read it as an ordinary short number and hide it.\n- Under `e164` with `obfuscate`, the digits after the 11th national digit are dropped. This affects only invalid input.\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).\n- Pending decision (findings §2 #4): the reference (JS) defaults to the subscriber-number mask, which truncates a DDD-prefixed number. The other libraries default to `(11)99402-9275`.",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        },
        {
          "name": "options",
          "type": "FormatPhoneOptions",
          "optional": true
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "phone.format#subscriber-number",
          "args": [
            "988887777"
          ],
          "expect": {
            "returns": "98888-7777"
          },
          "note": "default mask is the 9-digit subscriber number (no DDD); asserted by the reference (JS) unit tests"
        },
        {
          "id": "phone.format#partial",
          "args": [
            "98888777"
          ],
          "expect": {
            "returns": "98888-777"
          }
        },
        {
          "id": "phone.format#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          },
          "note": "several libs return null/None for input they cannot format; the reference returns an empty string"
        },
        {
          "id": "phone.format#ddd-under-default-mask",
          "args": [
            "1130000000"
          ],
          "expect": {
            "returns": "11300-0000"
          },
          "note": "CONTENTIOUS: the reference's default mask ('sn') ignores the DDD and keeps only the first 9 digits (documented and asserted by its tests); other libs format DDD + number, e.g. '(11)3000-0000'"
        },
        {
          "id": "phone.format#[\"005540041234\",{\"mask\":\"e164\"}]",
          "args": [
            "005540041234",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "4004-1234"
          },
          "note": "JavaScript's own test: should format a service number written with an explicit country code"
        },
        {
          "id": "phone.format#[\"+55 0800 123 4567\",{\"mask\":\"auto\"}]",
          "args": [
            "+55 0800 123 4567",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should format a service number written with an explicit country code"
        },
        {
          "id": "phone.format#[\"+55 190\",{\"mask\":\"service\"}]",
          "args": [
            "+55 190",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "190"
          },
          "note": "JavaScript's own test: should format a service number written with an explicit country code"
        },
        {
          "id": "phone.format#[\"55 4004-1234\",{\"mask\":\"e164\"}]",
          "args": [
            "55 4004-1234",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+555540041234"
          },
          "note": "JavaScript's own test: should format a service number written with an explicit country code"
        },
        {
          "id": "phone.format#[\"5508001234567\",{\"mask\":\"auto\"}]",
          "args": [
            "5508001234567",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should format a service number written with a bare country code"
        },
        {
          "id": "phone.format#[\"5508001234567\",{\"mask\":\"e164\"}]",
          "args": [
            "5508001234567",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should format a service number written with a bare country code"
        },
        {
          "id": "phone.format#[\"5508001234567\",{\"mask\":\"international\"}]",
          "args": [
            "5508001234567",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should format a service number written with a bare country code"
        },
        {
          "id": "phone.format#[\"5508001234567\",{\"mask\":\"service\"}]",
          "args": [
            "5508001234567",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should format a service number written with a bare country code"
        },
        {
          "id": "phone.format#[\"55 0300 123 4567\",{\"mask\":\"auto\"}]",
          "args": [
            "55 0300 123 4567",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "0300 123 4567"
          },
          "note": "JavaScript's own test: should format a service number written with a bare country code"
        },
        {
          "id": "phone.format#[\"9\"]",
          "args": [
            "9"
          ],
          "expect": {
            "returns": "9"
          },
          "note": "JavaScript's own test: should sn format phone"
        },
        {
          "id": "phone.format#[\"98\"]",
          "args": [
            "98"
          ],
          "expect": {
            "returns": "98"
          },
          "note": "JavaScript's own test: should sn format phone"
        },
        {
          "id": "phone.format#[\"988\"]",
          "args": [
            "988"
          ],
          "expect": {
            "returns": "988"
          },
          "note": "JavaScript's own test: should sn format phone"
        },
        {
          "id": "phone.format#[\"9888\"]",
          "args": [
            "9888"
          ],
          "expect": {
            "returns": "9888"
          },
          "note": "JavaScript's own test: should sn format phone"
        },
        {
          "id": "phone.format#[\"98888\"]",
          "args": [
            "98888"
          ],
          "expect": {
            "returns": "98888"
          },
          "note": "JavaScript's own test: should sn format phone"
        },
        {
          "id": "phone.format#[\"988887\"]",
          "args": [
            "988887"
          ],
          "expect": {
            "returns": "98888-7"
          },
          "note": "JavaScript's own test: should sn format phone"
        },
        {
          "id": "phone.format#[\"9888877\"]",
          "args": [
            "9888877"
          ],
          "expect": {
            "returns": "98888-77"
          },
          "note": "JavaScript's own test: should sn format phone"
        },
        {
          "id": "phone.format#[\"\",{\"mask\":\"nanp\"}]",
          "args": [
            "",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"1\",{\"mask\":\"nanp\"}]",
          "args": [
            "1",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(1"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"11\",{\"mask\":\"nanp\"}]",
          "args": [
            "11",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"119\",{\"mask\":\"nanp\"}]",
          "args": [
            "119",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 9"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"1198\",{\"mask\":\"nanp\"}]",
          "args": [
            "1198",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"11988\",{\"mask\":\"nanp\"}]",
          "args": [
            "11988",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 988"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"119888\",{\"mask\":\"nanp\"}]",
          "args": [
            "119888",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 9888"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"1198888\",{\"mask\":\"nanp\"}]",
          "args": [
            "1198888",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98888"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"11988887\",{\"mask\":\"nanp\"}]",
          "args": [
            "11988887",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98888-7"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"119888877\",{\"mask\":\"nanp\"}]",
          "args": [
            "119888877",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98888-77"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"1198888777\",{\"mask\":\"nanp\"}]",
          "args": [
            "1198888777",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 9888-8777"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"11988887777\",{\"mask\":\"nanp\"}]",
          "args": [
            "11988887777",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98888-7777"
          },
          "note": "JavaScript's own test: should nanp format phone"
        },
        {
          "id": "phone.format#[\"1130000000\",{\"mask\":\"nanp\"}]",
          "args": [
            "1130000000",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 3000-0000"
          },
          "note": "JavaScript's own test: should group a complete 10 digit landline as (00) 0000-0000"
        },
        {
          "id": "phone.format#[\"1130000000\",{\"mask\":\"auto\"}]",
          "args": [
            "1130000000",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "(11) 3000-0000"
          },
          "note": "JavaScript's own test: should group a complete 10 digit landline as (00) 0000-0000"
        },
        {
          "id": "phone.format#[\"(11) 3000-0000\",{\"mask\":\"nanp\"}]",
          "args": [
            "(11) 3000-0000",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 3000-0000"
          },
          "note": "JavaScript's own test: should group a complete 10 digit landline as (00) 0000-0000"
        },
        {
          "id": "phone.format#[\"1130000000\",{\"mask\":\"sn\"}]",
          "args": [
            "1130000000",
            {
              "mask": "sn"
            }
          ],
          "expect": {
            "returns": "11300-0000"
          },
          "note": "JavaScript's own test: should keep the 9 digit sn grouping for a 10 digit value, which only nanp reads as a landline"
        },
        {
          "id": "phone.format#[\"\",{\"mask\":\"auto\"}]",
          "args": [
            "",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"1\",{\"mask\":\"auto\"}]",
          "args": [
            "1",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "1"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"11\",{\"mask\":\"auto\"}]",
          "args": [
            "11",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "11"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"119\",{\"mask\":\"auto\"}]",
          "args": [
            "119",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "119"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"1198\",{\"mask\":\"auto\"}]",
          "args": [
            "1198",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "1198"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"11988\",{\"mask\":\"auto\"}]",
          "args": [
            "11988",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "11988"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"119888\",{\"mask\":\"auto\"}]",
          "args": [
            "119888",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "11988-8"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"1198888\",{\"mask\":\"auto\"}]",
          "args": [
            "1198888",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "11988-88"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"11988887\",{\"mask\":\"auto\"}]",
          "args": [
            "11988887",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "11988-887"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"119888877\",{\"mask\":\"auto\"}]",
          "args": [
            "119888877",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "11988-8877"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"1198888777\",{\"mask\":\"auto\"}]",
          "args": [
            "1198888777",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "(11) 9888-8777"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"11988887777\",{\"mask\":\"auto\"}]",
          "args": [
            "11988887777",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "(11) 98888-7777"
          },
          "note": "JavaScript's own test: should auto format phone"
        },
        {
          "id": "phone.format#[\"\",{\"mask\":\"e164\"}]",
          "args": [
            "",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"11988887777\",{\"mask\":\"e164\"}]",
          "args": [
            "11988887777",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887777"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"(11) 98888-7777\",{\"mask\":\"e164\"}]",
          "args": [
            "(11) 98888-7777",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887777"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"1130000000\",{\"mask\":\"e164\"}]",
          "args": [
            "1130000000",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+551130000000"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"+55 11 98888-7777\",{\"mask\":\"e164\"}]",
          "args": [
            "+55 11 98888-7777",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887777"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"005511988887777\",{\"mask\":\"e164\"}]",
          "args": [
            "005511988887777",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887777"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"5511988887777\",{\"mask\":\"e164\"}]",
          "args": [
            "5511988887777",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887777"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"0800 123 4567\",{\"mask\":\"e164\"}]",
          "args": [
            "0800 123 4567",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"+55 0800 123 4567\",{\"mask\":\"e164\"}]",
          "args": [
            "+55 0800 123 4567",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"+55 0800 123 4567\",{\"mask\":\"international\"}]",
          "args": [
            "+55 0800 123 4567",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"55988887777\",{\"mask\":\"e164\"}]",
          "args": [
            "55988887777",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5555988887777"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[11988887777,{\"mask\":\"e164\"}]",
          "args": [
            11988887777,
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887777"
          },
          "note": "JavaScript's own test: should e164 format phone"
        },
        {
          "id": "phone.format#[\"\",{\"mask\":\"international\"}]",
          "args": [
            "",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should international format phone"
        },
        {
          "id": "phone.format#[\"11988887777\",{\"mask\":\"international\"}]",
          "args": [
            "11988887777",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should international format phone"
        },
        {
          "id": "phone.format#[\"(11) 98888-7777\",{\"mask\":\"international\"}]",
          "args": [
            "(11) 98888-7777",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should international format phone"
        },
        {
          "id": "phone.format#[\"1130000000\",{\"mask\":\"international\"}]",
          "args": [
            "1130000000",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 3000-0000"
          },
          "note": "JavaScript's own test: should international format phone"
        },
        {
          "id": "phone.format#[\"+55 (11) 98888-7777\",{\"mask\":\"international\"}]",
          "args": [
            "+55 (11) 98888-7777",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should international format phone"
        },
        {
          "id": "phone.format#[\"005511988887777\",{\"mask\":\"international\"}]",
          "args": [
            "005511988887777",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should international format phone"
        },
        {
          "id": "phone.format#[\"55988887777\",{\"mask\":\"international\"}]",
          "args": [
            "55988887777",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 55 98888-7777"
          },
          "note": "JavaScript's own test: should international format phone"
        },
        {
          "id": "phone.format#[\"\",{\"mask\":\"service\"}]",
          "args": [
            "",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"08001234567\",{\"mask\":\"service\"}]",
          "args": [
            "08001234567",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"0800 123 4567\",{\"mask\":\"service\"}]",
          "args": [
            "0800 123 4567",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"03001234567\",{\"mask\":\"service\"}]",
          "args": [
            "03001234567",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0300 123 4567"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"03031234567\",{\"mask\":\"service\"}]",
          "args": [
            "03031234567",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0303 123 4567"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"05001234567\",{\"mask\":\"service\"}]",
          "args": [
            "05001234567",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0500 123 4567"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"09001234567\",{\"mask\":\"service\"}]",
          "args": [
            "09001234567",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0900 123 4567"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"40041234\",{\"mask\":\"service\"}]",
          "args": [
            "40041234",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "4004-1234"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"30031234\",{\"mask\":\"service\"}]",
          "args": [
            "30031234",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "3003-1234"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"190\",{\"mask\":\"service\"}]",
          "args": [
            "190",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "190"
          },
          "note": "JavaScript's own test: should service format phone"
        },
        {
          "id": "phone.format#[\"55555\",{\"mask\":\"service\"}]",
          "args": [
            "55555",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "55555"
          },
          "note": "JavaScript's own test: should not apply the abbreviated mask to a number that matches neither the non-geographic nor the abbreviated roots"
        },
        {
          "id": "phone.format#[\"12345678\",{\"mask\":\"service\"}]",
          "args": [
            "12345678",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "12345678"
          },
          "note": "JavaScript's own test: should not apply the abbreviated mask to a number that matches neither the non-geographic nor the abbreviated roots"
        },
        {
          "id": "phone.format#[\"0\",{\"mask\":\"service\"}]",
          "args": [
            "0",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0"
          },
          "note": "JavaScript's own test: should service format phone while it is being typed"
        },
        {
          "id": "phone.format#[\"0800\",{\"mask\":\"service\"}]",
          "args": [
            "0800",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0800"
          },
          "note": "JavaScript's own test: should service format phone while it is being typed"
        },
        {
          "id": "phone.format#[\"08001\",{\"mask\":\"service\"}]",
          "args": [
            "08001",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0800 1"
          },
          "note": "JavaScript's own test: should service format phone while it is being typed"
        },
        {
          "id": "phone.format#[\"0800123\",{\"mask\":\"service\"}]",
          "args": [
            "0800123",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0800 123"
          },
          "note": "JavaScript's own test: should service format phone while it is being typed"
        },
        {
          "id": "phone.format#[\"08001234\",{\"mask\":\"service\"}]",
          "args": [
            "08001234",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "0800 123 4"
          },
          "note": "JavaScript's own test: should service format phone while it is being typed"
        },
        {
          "id": "phone.format#[\"4004\",{\"mask\":\"service\"}]",
          "args": [
            "4004",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "4004"
          },
          "note": "JavaScript's own test: should service format phone while it is being typed"
        },
        {
          "id": "phone.format#[\"40041\",{\"mask\":\"service\"}]",
          "args": [
            "40041",
            {
              "mask": "service"
            }
          ],
          "expect": {
            "returns": "4004-1"
          },
          "note": "JavaScript's own test: should service format phone while it is being typed"
        },
        {
          "id": "phone.format#[\"+55 11 98888-7777\",{\"mask\":\"auto\"}]",
          "args": [
            "+55 11 98888-7777",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should detect a country code under the auto mask"
        },
        {
          "id": "phone.format#[\"+5511988887777\",{\"mask\":\"auto\"}]",
          "args": [
            "+5511988887777",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should detect a country code under the auto mask"
        },
        {
          "id": "phone.format#[\"005511988887777\",{\"mask\":\"auto\"}]",
          "args": [
            "005511988887777",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should detect a country code under the auto mask"
        },
        {
          "id": "phone.format#[\"+55 11 3000-0000\",{\"mask\":\"auto\"}]",
          "args": [
            "+55 11 3000-0000",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 3000-0000"
          },
          "note": "JavaScript's own test: should detect a country code under the auto mask"
        },
        {
          "id": "phone.format#[\"08001234567\",{\"mask\":\"auto\"}]",
          "args": [
            "08001234567",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should detect a service number under the auto mask"
        },
        {
          "id": "phone.format#[\"03001234567\",{\"mask\":\"auto\"}]",
          "args": [
            "03001234567",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "0300 123 4567"
          },
          "note": "JavaScript's own test: should detect a service number under the auto mask"
        },
        {
          "id": "phone.format#[\"40041234\",{\"mask\":\"auto\"}]",
          "args": [
            "40041234",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "4004-1234"
          },
          "note": "JavaScript's own test: should detect a service number under the auto mask"
        },
        {
          "id": "phone.format#[\"30031234\",{\"mask\":\"auto\"}]",
          "args": [
            "30031234",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "3003-1234"
          },
          "note": "JavaScript's own test: should detect a service number under the auto mask"
        },
        {
          "id": "phone.format#[\"55988887777\",{\"mask\":\"auto\"}]",
          "args": [
            "55988887777",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "(55) 98888-7777"
          },
          "note": "JavaScript's own test: should keep reading the DDD from a bare 55 area code under the auto mask"
        },
        {
          "id": "phone.format#[\"+55 11 98888-7777\",{\"mask\":\"international\"}]",
          "args": [
            "+55 11 98888-7777",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should format international and service numbers when asked explicitly"
        },
        {
          "id": "phone.format#[\"+5511988887777\",{\"mask\":\"international\"}]",
          "args": [
            "+5511988887777",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7777"
          },
          "note": "JavaScript's own test: should format international and service numbers when asked explicitly"
        },
        {
          "id": "phone.format#[\"+55 11 3000-0000\",{\"mask\":\"international\"}]",
          "args": [
            "+55 11 3000-0000",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 3000-0000"
          },
          "note": "JavaScript's own test: should format international and service numbers when asked explicitly"
        },
        {
          "id": "phone.format#[\"08001234567\",{\"mask\":\"e164\"}]",
          "args": [
            "08001234567",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should keep international masks on service numbers"
        },
        {
          "id": "phone.format#[\"40041234\",{\"mask\":\"international\"}]",
          "args": [
            "40041234",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "4004-1234"
          },
          "note": "JavaScript's own test: should keep international masks on service numbers"
        },
        {
          "id": "phone.format#[\"11987654321\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "11987654321",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "(11) *****-**21"
          },
          "note": "from the maintainer briefing, #567"
        },
        {
          "id": "phone.format#[\"08001234567\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "08001234567",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "0800 *** **67"
          },
          "note": "from the maintainer briefing, #567"
        },
        {
          "id": "phone.format#[\"190\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "190",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "190"
          },
          "note": "from the maintainer briefing, #567: a public utility code identifies no subscriber and is kept whole"
        },
        {
          "id": "phone.format#[\"11987654321\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "11987654321",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***********"
          },
          "note": "from the maintainer briefing, #567: not a service number, so every digit is hidden"
        },
        {
          "id": "phone.format#[\"11987654321\",{\"obfuscate\":true}]",
          "args": [
            "11987654321",
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "*****-**43"
          },
          "note": "from the maintainer briefing, #567: the default \"sn\" mask truncates the DDD-prefixed value first"
        },
        {
          "id": "phone.format#[\"988887766\",{\"obfuscate\":true}]",
          "args": [
            "988887766",
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "*****-**66"
          },
          "note": "JavaScript's own test: should hide the subscriber number except its last 2 digits under the national masks"
        },
        {
          "id": "phone.format#[988887766,{\"obfuscate\":true}]",
          "args": [
            988887766,
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "*****-**66"
          },
          "note": "JavaScript's own test: should hide the subscriber number except its last 2 digits under the national masks"
        },
        {
          "id": "phone.format#[\"11988887766\",{\"mask\":\"nanp\",\"obfuscate\":true}]",
          "args": [
            "11988887766",
            {
              "mask": "nanp",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "(11) *****-**66"
          },
          "note": "JavaScript's own test: should hide the subscriber number except its last 2 digits under the national masks"
        },
        {
          "id": "phone.format#[\"1130001234\",{\"mask\":\"nanp\",\"obfuscate\":true}]",
          "args": [
            "1130001234",
            {
              "mask": "nanp",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "(11) ****-**34"
          },
          "note": "JavaScript's own test: should hide the subscriber number except its last 2 digits under the national masks"
        },
        {
          "id": "phone.format#[\"1130001234\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "1130001234",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "(11) ****-**34"
          },
          "note": "JavaScript's own test: should hide the subscriber number except its last 2 digits under the national masks"
        },
        {
          "id": "phone.format#[\"988887766\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "988887766",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "*****-**66"
          },
          "note": "JavaScript's own test: should hide the subscriber number except its last 2 digits under the national masks"
        },
        {
          "id": "phone.format#[\"1130001234\",{\"mask\":\"sn\",\"obfuscate\":true}]",
          "args": [
            "1130001234",
            {
              "mask": "sn",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "*****-**23"
          },
          "note": "JavaScript's own test: should truncate a DDD-prefixed value under the default mask before obfuscating it"
        },
        {
          "id": "phone.format#[\"11988887766\",{\"mask\":\"international\",\"obfuscate\":true}]",
          "args": [
            "11988887766",
            {
              "mask": "international",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+55 11 *****-**66"
          },
          "note": "JavaScript's own test: should keep the country code and the DDD when obfuscating the international masks"
        },
        {
          "id": "phone.format#[\"+55 11 3000-1234\",{\"mask\":\"international\",\"obfuscate\":true}]",
          "args": [
            "+55 11 3000-1234",
            {
              "mask": "international",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+55 11 ****-**34"
          },
          "note": "JavaScript's own test: should keep the country code and the DDD when obfuscating the international masks"
        },
        {
          "id": "phone.format#[\"5511988887766\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "5511988887766",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+55 11 *****-**66"
          },
          "note": "JavaScript's own test: should keep the country code and the DDD when obfuscating the international masks"
        },
        {
          "id": "phone.format#[\"11988887766\",{\"mask\":\"e164\",\"obfuscate\":true}]",
          "args": [
            "11988887766",
            {
              "mask": "e164",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+5511*******66"
          },
          "note": "JavaScript's own test: should keep the country code and the DDD when obfuscating the international masks"
        },
        {
          "id": "phone.format#[\"1130001234\",{\"mask\":\"e164\",\"obfuscate\":true}]",
          "args": [
            "1130001234",
            {
              "mask": "e164",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+5511******34"
          },
          "note": "JavaScript's own test: should keep the country code and the DDD when obfuscating the international masks"
        },
        {
          "id": "phone.format#[\"03031234567\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "03031234567",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "0303 *** **67"
          },
          "note": "JavaScript's own test: should keep the service prefix and the last 2 digits when obfuscating a service number"
        },
        {
          "id": "phone.format#[\"40041234\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "40041234",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "4004-**34"
          },
          "note": "JavaScript's own test: should keep the service prefix and the last 2 digits when obfuscating a service number"
        },
        {
          "id": "phone.format#[\"30031234\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "30031234",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "3003-**34"
          },
          "note": "JavaScript's own test: should keep the service prefix and the last 2 digits when obfuscating a service number"
        },
        {
          "id": "phone.format#[\"08001234567\",{\"mask\":\"e164\",\"obfuscate\":true}]",
          "args": [
            "08001234567",
            {
              "mask": "e164",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "0800 *** **67"
          },
          "note": "JavaScript's own test: should keep the service prefix and the last 2 digits when obfuscating a service number"
        },
        {
          "id": "phone.format#[\"40041234\",{\"mask\":\"international\",\"obfuscate\":true}]",
          "args": [
            "40041234",
            {
              "mask": "international",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "4004-**34"
          },
          "note": "JavaScript's own test: should keep the service prefix and the last 2 digits when obfuscating a service number"
        },
        {
          "id": "phone.format#[\"190\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "190",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "190"
          },
          "note": "JavaScript's own test: should return a public utility code whole when obfuscating"
        },
        {
          "id": "phone.format#[\"190\",{\"mask\":\"e164\",\"obfuscate\":true}]",
          "args": [
            "190",
            {
              "mask": "e164",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "190"
          },
          "note": "the e164 and international masks fall back to the service presentation for a service number"
        },
        {
          "id": "phone.format#[\"190\",{\"obfuscate\":true}]",
          "args": [
            "190",
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***"
          },
          "note": "the default \"sn\" mask reads 190 as an ordinary short number, so it is hidden"
        },
        {
          "id": "phone.format#[\"08\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "08",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "**"
          },
          "note": "JavaScript's own test: should hide entirely a value the service mask does not recognize when obfuscating"
        },
        {
          "id": "phone.format#[\"1198\",{\"mask\":\"nanp\",\"obfuscate\":true}]",
          "args": [
            "1198",
            {
              "mask": "nanp",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "(11) **"
          },
          "note": "JavaScript's own test: should obfuscate a partial value as far as it goes"
        },
        {
          "id": "phone.format#[\"11988\",{\"mask\":\"international\",\"obfuscate\":true}]",
          "args": [
            "11988",
            {
              "mask": "international",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+55 11 ***"
          },
          "note": "JavaScript's own test: should obfuscate a partial value as far as it goes"
        },
        {
          "id": "phone.format#[\"0800123\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "0800123",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "0800 ***"
          },
          "note": "JavaScript's own test: should obfuscate a partial value as far as it goes"
        },
        {
          "id": "phone.format#[\"\",{\"mask\":\"e164\",\"obfuscate\":true}]",
          "args": [
            "",
            {
              "mask": "e164",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should obfuscate a partial value as far as it goes"
        },
        {
          "id": "phone.format#[\"\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should obfuscate a partial value as far as it goes"
        },
        {
          "id": "phone.format#[\"119888877660000\",{\"mask\":\"e164\",\"obfuscate\":true}]",
          "args": [
            "119888877660000",
            {
              "mask": "e164",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+5511*******66"
          },
          "note": "JavaScript's own test: should drop what does not fit the 11 national digits when obfuscating the e164 mask"
        },
        {
          "id": "phone.format#[\"11988887766\",{\"mask\":\"nanp\",\"obfuscate\":false}]",
          "args": [
            "11988887766",
            {
              "mask": "nanp",
              "obfuscate": false
            }
          ],
          "expect": {
            "returns": "(11) 98888-7766"
          },
          "note": "JavaScript's own test: should behave exactly as without the option when obfuscate is falsy or absent"
        },
        {
          "id": "phone.format#[\"11988887766\",{\"mask\":\"e164\",\"obfuscate\":false}]",
          "args": [
            "11988887766",
            {
              "mask": "e164",
              "obfuscate": false
            }
          ],
          "expect": {
            "returns": "+5511988887766"
          },
          "note": "JavaScript's own test: should behave exactly as without the option when obfuscate is falsy or absent"
        },
        {
          "id": "phone.format#[\"08001234567\",{\"mask\":\"service\",\"obfuscate\":false}]",
          "args": [
            "08001234567",
            {
              "mask": "service",
              "obfuscate": false
            }
          ],
          "expect": {
            "returns": "0800 123 4567"
          },
          "note": "JavaScript's own test: should behave exactly as without the option when obfuscate is falsy or absent"
        },
        {
          "id": "phone.format#[-11987654321,{\"mask\":\"auto\"}]",
          "args": [
            -11987654321,
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a negative number is not a safe non-negative integer. 2.4.0 returned \"(11) 98765-4321\""
        },
        {
          "id": "phone.format#[11987654321.5,{\"mask\":\"auto\"}]",
          "args": [
            11987654321.5,
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "#593 number rule: a fractional number gives an empty string"
        },
        {
          "id": "phone.format#[9007199254740992]",
          "args": [
            9007199254740992
          ],
          "expect": {
            "returns": ""
          },
          "note": "#593 number rule: 2^53 is past Number.MAX_SAFE_INTEGER"
        },
        {
          "id": "phone.format#[\"+5511988887777\"]",
          "args": [
            "+5511988887777"
          ],
          "expect": {
            "returns": "11988-8877"
          },
          "note": "JavaScript's own test: should drop an explicit country code under the sn and nanp masks (changed in 2.5.0, #615)"
        },
        {
          "id": "phone.format#[\"+55 55 98888-7777\"]",
          "args": [
            "+55 55 98888-7777"
          ],
          "expect": {
            "returns": "55988-8877"
          },
          "note": "JavaScript's own test: should drop an explicit country code under the sn and nanp masks"
        },
        {
          "id": "phone.format#[\"+5511988887777\",{\"mask\":\"nanp\"}]",
          "args": [
            "+5511988887777",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98888-7777"
          },
          "note": "JavaScript's own test: should drop an explicit country code under the sn and nanp masks (2.4.0 gave (55) 11988-8877)"
        },
        {
          "id": "phone.format#[\"+5511987654321\",{\"mask\":\"nanp\"}]",
          "args": [
            "+5511987654321",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98765-4321"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "phone.format#[\"+55 11 3000-0000\",{\"mask\":\"nanp\"}]",
          "args": [
            "+55 11 3000-0000",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 3000-0000"
          },
          "note": "JavaScript's own test: should drop an explicit country code under the sn and nanp masks"
        },
        {
          "id": "phone.format#[\"0055 11 98888-7777\",{\"mask\":\"nanp\"}]",
          "args": [
            "0055 11 98888-7777",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 98888-7777"
          },
          "note": "JavaScript's own test: should drop an explicit country code under the sn and nanp masks"
        },
        {
          "id": "phone.format#[\"+55 11 9\",{\"mask\":\"nanp\"}]",
          "args": [
            "+55 11 9",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(11) 9"
          },
          "note": "JavaScript's own test: should drop an explicit country code under the sn and nanp masks"
        },
        {
          "id": "phone.format#[\"+55\",{\"mask\":\"sn\"}]",
          "args": [
            "+55",
            {
              "mask": "sn"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should drop an explicit country code under the sn and nanp masks"
        },
        {
          "id": "phone.format#[\"5511988887777\",{\"mask\":\"nanp\"}]",
          "args": [
            "5511988887777",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(55) 11988-8877"
          },
          "note": "JavaScript's own test: should keep a bare 55 under the sn and nanp masks"
        },
        {
          "id": "phone.format#[\"55988887777\",{\"mask\":\"nanp\"}]",
          "args": [
            "55988887777",
            {
              "mask": "nanp"
            }
          ],
          "expect": {
            "returns": "(55) 98888-7777"
          },
          "note": "JavaScript's own test: should keep a bare 55 under the sn and nanp masks"
        },
        {
          "id": "phone.format#[\"+55\",{\"mask\":\"e164\"}]",
          "args": [
            "+55",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should format a number still being typed after an explicit country code"
        },
        {
          "id": "phone.format#[\"+55\",{\"mask\":\"international\"}]",
          "args": [
            "+55",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should format a number still being typed after an explicit country code"
        },
        {
          "id": "phone.format#[\"+55\",{\"mask\":\"auto\"}]",
          "args": [
            "+55",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should format a number still being typed after an explicit country code"
        },
        {
          "id": "phone.format#[\"+55 11 9\",{\"mask\":\"e164\"}]",
          "args": [
            "+55 11 9",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+55119"
          },
          "note": "JavaScript's own test: should format a number still being typed after an explicit country code"
        },
        {
          "id": "phone.format#[\"+55 11 9\",{\"mask\":\"international\"}]",
          "args": [
            "+55 11 9",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 9"
          },
          "note": "JavaScript's own test: should format a number still being typed after an explicit country code"
        },
        {
          "id": "phone.format#[\"+55 11 9\",{\"mask\":\"auto\"}]",
          "args": [
            "+55 11 9",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 9"
          },
          "note": "JavaScript docs example (typed after +55, the 55 is not read as a DDD)"
        },
        {
          "id": "phone.format#[\"+55 11 98765\",{\"mask\":\"auto\"}]",
          "args": [
            "+55 11 98765",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 9876-5"
          },
          "note": "JavaScript's own test: should format a number still being typed after an explicit country code"
        },
        {
          "id": "phone.format#[\"+55 11 98765-4321\",{\"mask\":\"auto\"}]",
          "args": [
            "+55 11 98765-4321",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 98765-4321"
          },
          "note": "JavaScript's own test: should format a number still being typed after an explicit country code"
        },
        {
          "id": "phone.format#[\"119888877660000\",{\"mask\":\"e164\"}]",
          "args": [
            "119888877660000",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887766"
          },
          "note": "changed in 2.5.0 (#615): e164 keeps at most the 11 national digits (2.4.0 kept all of them: +55119888877660000). JavaScript's own test: should keep at most the 11 national digits under the e164 mask, as international does"
        },
        {
          "id": "phone.format#[\"119888877660000\",{\"mask\":\"international\"}]",
          "args": [
            "119888877660000",
            {
              "mask": "international"
            }
          ],
          "expect": {
            "returns": "+55 11 98888-7766"
          },
          "note": "JavaScript's own test: should keep at most the 11 national digits under the e164 mask, as international does"
        },
        {
          "id": "phone.format#[\"+55 11 98888-7766 0000\",{\"mask\":\"e164\"}]",
          "args": [
            "+55 11 98888-7766 0000",
            {
              "mask": "e164"
            }
          ],
          "expect": {
            "returns": "+5511988887766"
          },
          "note": "JavaScript's own test: should keep at most the 11 national digits under the e164 mask, as international does"
        },
        {
          "id": "phone.format#[\"0800\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "0800",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "0800"
          },
          "note": "JavaScript's own test: should keep a bare service prefix and hide a shorter value under the service mask"
        },
        {
          "id": "phone.format#[\"080\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "080",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***"
          },
          "note": "JavaScript's own test: should keep a bare service prefix and hide a shorter value under the service mask"
        },
        {
          "id": "phone.format#[\"987654321\",{\"obfuscate\":true}]",
          "args": [
            "987654321",
            {
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "*****-**21"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "phone.format#[\"1130000000\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "1130000000",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "(11) ****-**00"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "phone.format#[\"+5511987654321\",{\"mask\":\"auto\",\"obfuscate\":true}]",
          "args": [
            "+5511987654321",
            {
              "mask": "auto",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+55 11 *****-**21"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "phone.format#[\"11987654321\",{\"mask\":\"e164\",\"obfuscate\":true}]",
          "args": [
            "11987654321",
            {
              "mask": "e164",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "+5511*******21"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "phone.format#[\"11988887766\",{\"mask\":\"service\",\"obfuscate\":true}]",
          "args": [
            "11988887766",
            {
              "mask": "service",
              "obfuscate": true
            }
          ],
          "expect": {
            "returns": "***********"
          },
          "note": "JavaScript docs example (not a service number)"
        },
        {
          "id": "phone.format#[\"11900000000\"]",
          "args": [
            "11900000000"
          ],
          "expect": {
            "returns": "11900-0000"
          },
          "note": "JavaScript docs example (default sn truncates a DDD-prefixed number)"
        },
        {
          "id": "phone.format#[\"11987654321\",{\"mask\":\"zzz\"}]",
          "args": [
            "11987654321",
            {
              "mask": "zzz"
            }
          ],
          "expect": {
            "returns": "11987-6543"
          },
          "note": "an unknown mask falls back to sn"
        },
        {
          "id": "phone.format#[\"+5511987654321\",{\"mask\":\"auto\"}]",
          "args": [
            "+5511987654321",
            {
              "mask": "auto"
            }
          ],
          "expect": {
            "returns": "+55 11 98765-4321"
          },
          "note": "JavaScript docs example (auto detects the +55 prefix and picks international)"
        }
      ]
    },
    {
      "id": "phone.generate",
      "level": "core",
      "summary": "Generates a random, structurally valid Brazilian phone number (DDD + subscriber number).",
      "description": "Generates a random Brazilian phone number, unformatted.\n\nUse `phone.format` to format it.\n\n- `type`: `mobile` (DDD + 9 digits starting with 9, valid under both numbering versions of `phone.isValidMobile`), `landline` (DDD + 8 digits starting with 2 to 5) or `service` (no DDD: a Código Não Geográfico such as `0800` + 7 digits, or an abbreviated `300X`/`400X` number). When `type` is omitted, the function picks a mobile or a landline at random, never a service number.\n- A landline never starts with 6 after the DDD: the 2 to 5 range stays valid after Resolução Anatel nº 777/2025 narrows it on 1 March 2027. Until 2.4.0 a 6 could be drawn.\n- `phone.isValid` accepts a mobile or a landline result, and `phone.isValidService` a service one.\n- It uses `Math.random()`, so the result is not cryptographically secure: do not use it for security purposes.",
      "params": [
        {
          "name": "type",
          "type": "\"mobile\" | \"landline\" | \"service\"",
          "optional": true
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "phone.generate#generated-is-valid",
          "args": [],
          "expect": {
            "satisfies": "phone.isValid"
          },
          "repeat": 5,
          "note": "every generated value must pass the lib's own validator"
        },
        {
          "id": "phone.generate#[\"mobile\"]",
          "args": [
            "mobile"
          ],
          "expect": {
            "matches": "^\\d{2}9\\d{8}$"
          },
          "repeat": 10,
          "note": "JavaScript docs example: DDD + 9 digits starting with 9"
        },
        {
          "id": "phone.generate#[\"mobile\"]~2",
          "args": [
            "mobile"
          ],
          "expect": {
            "satisfies": "phone.isValidMobile"
          },
          "repeat": 10,
          "note": "every generated mobile must pass the lib's own validator"
        },
        {
          "id": "phone.generate#[\"landline\"]",
          "args": [
            "landline"
          ],
          "expect": {
            "matches": "^\\d{2}[2-5]\\d{7}$"
          },
          "repeat": 40,
          "note": "JavaScript's own test: should draw the landline's first number digit from 2 to 5 only (changed in 2.5.0, #615: 6 is never drawn)"
        },
        {
          "id": "phone.generate#[\"landline\"]~2",
          "args": [
            "landline"
          ],
          "expect": {
            "satisfies": "phone.isValidLandline"
          },
          "repeat": 10,
          "note": "every generated landline must pass the lib's own validator"
        },
        {
          "id": "phone.generate#[\"service\"]",
          "args": [
            "service"
          ],
          "expect": {
            "matches": "^(0(300|303|500|800|900)\\d{7}|[34]00\\d{5})$"
          },
          "repeat": 10,
          "note": "JavaScript docs example: a service number has no DDD"
        },
        {
          "id": "phone.generate#[\"service\"]~2",
          "args": [
            "service"
          ],
          "expect": {
            "satisfies": "phone.isValidService"
          },
          "repeat": 10,
          "note": "every generated service number must pass the lib's own validator"
        }
      ]
    },
    {
      "id": "phone.isValid",
      "level": "core",
      "summary": "Checks whether a Brazilian phone number is valid.",
      "description": "Validates a Brazilian phone number, mobile or landline by default.\n\n- The function accepts a country code (`+55`, `0055` or a bare `55`) and removes it first, as in `phone.parse`. A bare `55` is removed only when 10 or 11 digits are left.\n- The DDD must be a valid Brazilian area code (`00` is not).\n- Any character other than digits, whitespace and `()+.-/` (a letter, for instance) makes the value invalid. Until 2.4.0 such characters were dropped, so `11 98765-4321x` was valid.\n- The character check applies to the string form of any input, not only to strings: an object whose `toString` returns `\"190x\"` is invalid, as `\"190x\"` is, while one that returns `\"190\"` is read as the service number `190` with `accept: [\"service\"]`. An array of characters is not read as the joined string and is invalid. Only `phone.isValid` reads the string form; `phone.isValidMobile`, `phone.isValidLandline` and `phone.isValidService` return `false` for a value that is not a string.\n- `options.accept` (default `[\"mobile\", \"landline\"]`) lists the kinds of number that count as valid: `mobile`, `landline` and `service` (the numbers `phone.isValidService` recognizes). An empty list rejects everything.\n- `options.version` (`1` or `2`, default `1`) is forwarded to `phone.isValidMobile`: both versions need 7, 8 or 9 as the first subscriber digit, and `2` also rejects the `700` series (satellite service).\n- A mobile number needs 7, 8 or 9 as its first subscriber digit under both numbering rules (Resolução Anatel nº 749/2022, art. 12). 2.4.0 also accepted 6 by default.",
      "params": [
        {
          "name": "value",
          "type": "string"
        },
        {
          "name": "options",
          "type": "IsValidPhoneOptions",
          "optional": true
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "phone.isValid#[\"48976579784\"]",
          "args": [
            "48976579784"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"48976579785\"]",
          "args": [
            "48976579785"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"00000000000\"]",
          "args": [
            "00000000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"3147981464\"]",
          "args": [
            "3147981464"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"3147981465\"]",
          "args": [
            "3147981465"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"0000000000\"]",
          "args": [
            "0000000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"38942432195\"]",
          "args": [
            "38942432195"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"38942432196\"]",
          "args": [
            "38942432196"
          ],
          "expect": {
            "returns": true
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"48976-5797\"]",
          "args": [
            "48976-5797"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"31479-8146\"]",
          "args": [
            "31479-8146"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"38942-4321\"]",
          "args": [
            "38942-4321"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"   \"]",
          "args": [
            "   "
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"abc\"]",
          "args": [
            "abc"
          ],
          "expect": {
            "returns": false
          },
          "note": "consensus of 3 libs (javascript, python, ruby)"
        },
        {
          "id": "phone.isValid#[\"+55 0800 123 4567\",{\"accept\":[\"service\"]}]",
          "args": [
            "+55 0800 123 4567",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: service numbers written with a country code should accept an explicit country code before a service number"
        },
        {
          "id": "phone.isValid#[\"0055 4004-1234\",{\"accept\":[\"service\"]}]",
          "args": [
            "0055 4004-1234",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: service numbers written with a country code should accept an explicit country code before a service number"
        },
        {
          "id": "phone.isValid#[\"5508001234567\",{\"accept\":[\"service\"]}]",
          "args": [
            "5508001234567",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: service numbers written with a country code should accept a bare 55 before a service number, as parsePhone reads it"
        },
        {
          "id": "phone.isValid#[\"55 0300 123 4567\",{\"accept\":[\"service\"]}]",
          "args": [
            "55 0300 123 4567",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: service numbers written with a country code should accept a bare 55 before a service number, as parsePhone reads it"
        },
        {
          "id": "phone.isValid#[\"5508001234567\"]",
          "args": [
            "5508001234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: service numbers written with a country code should accept a bare 55 before a service number, as parsePhone reads it"
        },
        {
          "id": "phone.isValid#[\"+55 0800 123 4567\"]",
          "args": [
            "+55 0800 123 4567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: service numbers written with a country code should accept a bare 55 before a service number, as parsePhone reads it"
        },
        {
          "id": "phone.isValid#[\"123\"]",
          "args": [
            "123"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when length is invalid"
        },
        {
          "id": "phone.isValid#[\"00999999999\"]",
          "args": [
            "00999999999"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when DDD is invalid"
        },
        {
          "id": "phone.isValid#[\"08001234567\"]",
          "args": [
            "08001234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it is a service phone and accept is left to its default"
        },
        {
          "id": "phone.isValid#[\"40041234\"]",
          "args": [
            "40041234"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it is a service phone and accept is left to its default"
        },
        {
          "id": "phone.isValid#[\"(11) 98765-4321\",{\"accept\":[]}]",
          "args": [
            "(11) 98765-4321",
            {
              "accept": []
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when accept is empty"
        },
        {
          "id": "phone.isValid#[\"1130000000\",{\"accept\":[]}]",
          "args": [
            "1130000000",
            {
              "accept": []
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when accept is empty"
        },
        {
          "id": "phone.isValid#[\"08001234567\",{\"accept\":[]}]",
          "args": [
            "08001234567",
            {
              "accept": []
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when accept is empty"
        },
        {
          "id": "phone.isValid#[\"11612345678\",{\"version\":2}]",
          "args": [
            "11612345678",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when version 2 rejects the mobile number"
        },
        {
          "id": "phone.isValid#[\"11700123456\",{\"version\":2}]",
          "args": [
            "11700123456",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when version 2 rejects the mobile number"
        },
        {
          "id": "phone.isValid#[\"11987654321\",{\"accept\":[\"landline\"]}]",
          "args": [
            "11987654321",
            {
              "accept": [
                "landline"
              ]
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the kind is not accepted"
        },
        {
          "id": "phone.isValid#[\"1130000000\",{\"accept\":[\"mobile\"]}]",
          "args": [
            "1130000000",
            {
              "accept": [
                "mobile"
              ]
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the kind is not accepted"
        },
        {
          "id": "phone.isValid#[\"11987654321\",{\"accept\":[\"service\"]}]",
          "args": [
            "11987654321",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the kind is not accepted"
        },
        {
          "id": "phone.isValid#[\"08001234567\",{\"accept\":[\"mobile\",\"landline\"]}]",
          "args": [
            "08001234567",
            {
              "accept": [
                "mobile",
                "landline"
              ]
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the kind is not accepted"
        },
        {
          "id": "phone.isValid#[\"(11) 98765-4321\"]",
          "args": [
            "(11) 98765-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 2"
        },
        {
          "id": "phone.isValid#[\"11987654321\",{\"version\":2}]",
          "args": [
            "11987654321",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 2"
        },
        {
          "id": "phone.isValid#[\"11712345678\",{\"version\":2}]",
          "args": [
            "11712345678",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 2"
        },
        {
          "id": "phone.isValid#[\"11812345678\",{\"version\":2}]",
          "args": [
            "11812345678",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 2"
        },
        {
          "id": "phone.isValid#[\"(11) 3000-0000\"]",
          "args": [
            "(11) 3000-0000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid landline phone"
        },
        {
          "id": "phone.isValid#[\"1130000000\"]",
          "args": [
            "1130000000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid landline phone"
        },
        {
          "id": "phone.isValid#[\"11712345678\",{\"version\":1}]",
          "args": [
            "11712345678",
            {
              "version": 1
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 1"
        },
        {
          "id": "phone.isValid#[\"+5511987654321\"]",
          "args": [
            "+5511987654321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValid#[\"+55 11 98765-4321\"]",
          "args": [
            "+55 11 98765-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValid#[\"+55 (11) 98765-4321\"]",
          "args": [
            "+55 (11) 98765-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValid#[\"0055 11 98765-4321\"]",
          "args": [
            "0055 11 98765-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValid#[\"5511987654321\"]",
          "args": [
            "5511987654321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValid#[\"+55 (11) 3000-0000\"]",
          "args": [
            "+55 (11) 3000-0000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValid#[\"+55 11 98765-4321\",{\"version\":2}]",
          "args": [
            "+55 11 98765-4321",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValid#[\"11987654321\",{\"accept\":[\"mobile\"]}]",
          "args": [
            "11987654321",
            {
              "accept": [
                "mobile"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"1130000000\",{\"accept\":[\"landline\"]}]",
          "args": [
            "1130000000",
            {
              "accept": [
                "landline"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"08001234567\",{\"accept\":[\"service\"]}]",
          "args": [
            "08001234567",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"40041234\",{\"accept\":[\"service\"]}]",
          "args": [
            "40041234",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"190\",{\"accept\":[\"service\"]}]",
          "args": [
            "190",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"0800 123 4567\",{\"accept\":[\"service\"]}]",
          "args": [
            "0800 123 4567",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"11987654321\",{\"accept\":[\"mobile\",\"landline\",\"service\"]}]",
          "args": [
            "11987654321",
            {
              "accept": [
                "mobile",
                "landline",
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"08001234567\",{\"accept\":[\"mobile\",\"landline\",\"service\"]}]",
          "args": [
            "08001234567",
            {
              "accept": [
                "mobile",
                "landline",
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the kind is accepted"
        },
        {
          "id": "phone.isValid#[\"11612345678\"]",
          "args": [
            "11612345678"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): a first subscriber digit of 6 is not SMP (Resolução Anatel nº 749/2022, art. 12, I, \"a\"), so it is not a mobile. 2.4.0 returned true"
        },
        {
          "id": "phone.isValid#[\"112\",{\"accept\":[\"service\"]}]",
          "args": [
            "112",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "changed in 2.5.0 (#593): 112 is on Anatel's current list of public utility codes"
        },
        {
          "id": "phone.isValid#[\"11 98765-4321x\"]",
          "args": [
            "11 98765-4321x"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript docs example: a character outside digits, whitespace and ()+.-/ makes the value invalid (changed in 2.5.0, #615)"
        },
        {
          "id": "phone.isValid#[\"tel 1130000000\"]",
          "args": [
            "tel 1130000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        },
        {
          "id": "phone.isValid#[\"abc190\",{\"accept\":[\"service\"]}]",
          "args": [
            "abc190",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        },
        {
          "id": "phone.isValid#[\"0800 123 4567 ramal 1\",{\"accept\":[\"service\"]}]",
          "args": [
            "0800 123 4567 ramal 1",
            {
              "accept": [
                "service"
              ]
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        },
        {
          "id": "phone.isValid#[\"11.98765/4321\"]",
          "args": [
            "11.98765/4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "the phone mask characters are whitespace, parentheses, +, . - and /"
        },
        {
          "id": "phone.isValid#[\"11900000000\"]",
          "args": [
            "11900000000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "phone.isValid#[\"11900000000\",{\"accept\":[]}]",
          "args": [
            "11900000000",
            {
              "accept": []
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript docs example"
        }
      ]
    },
    {
      "id": "phone.isValidLandline",
      "level": "extended",
      "summary": "Checks whether a phone number is a valid Brazilian landline number.",
      "description": "Validates a landline number: DDD plus 8 digits starting with 2 to 6.\n\n- The function accepts a country code (`+55`, `0055` or a bare `55`) and removes it first, as in `phone.parse`.\n- The DDD must be a valid Brazilian area code (`00` is not).\n- Any character other than digits, whitespace and `()+.-/` (a letter, for instance) makes the value invalid. Until 2.4.0 such characters were dropped, so `11 3000-0000x` was valid.\n- The first digit of the number is 2 to 6, the STFC and SCM range of Resolução Anatel nº 749/2022, art. 11, I, \"a\".\n- Scheduled change, not applied yet: from 1 March 2027 Resolução Anatel nº 777/2025, art. 21, leaves only 2 to 5 to the STFC and moves the SCM to 9-digit numbers starting with 6. From that date a landline starting with 6 will have to be rejected.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "phone.isValidLandline#[\"(11) 3000-0000\"]",
          "args": [
            "(11) 3000-0000"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidLandline#[\"1130000000\"]",
          "args": [
            "1130000000"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidLandline#country-code",
          "args": [
            "+55 11 3000-0000"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidLandline#mobile",
          "args": [
            "11987654321"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidLandline#9-digits",
          "args": [
            "113000000"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidLandline#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidLandline#[\"+55 11 98765-4321\"]",
          "args": [
            "+55 11 98765-4321"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the country code leaves an invalid number"
        },
        {
          "id": "phone.isValidLandline#[\"0030000000\"]",
          "args": [
            "0030000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the DDD is not a valid area code"
        },
        {
          "id": "phone.isValidLandline#[\"+551130000000\"]",
          "args": [
            "+551130000000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidLandline#[\"+55 (11) 3000-0000\"]",
          "args": [
            "+55 (11) 3000-0000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidLandline#[\"0055 11 3000-0000\"]",
          "args": [
            "0055 11 3000-0000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidLandline#[\"551130000000\"]",
          "args": [
            "551130000000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidLandline#[\"5530000000\"]",
          "args": [
            "5530000000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the area code is 55"
        },
        {
          "id": "phone.isValidLandline#[\"+55 55 3000-0000\"]",
          "args": [
            "+55 55 3000-0000"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the area code is 55"
        },
        {
          "id": "phone.isValidLandline#[\"1162654321\"]",
          "args": [
            "1162654321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should accept landlines whose first digit is 6 (Anatel Res. 749/2022, art. 11)"
        },
        {
          "id": "phone.isValidLandline#[\"(11) 6265-4321\"]",
          "args": [
            "(11) 6265-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should accept landlines whose first digit is 6 (Anatel Res. 749/2022, art. 11)"
        },
        {
          "id": "phone.isValidLandline#[\"1172654321\"]",
          "args": [
            "1172654321"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should accept landlines whose first digit is 6 (Anatel Res. 749/2022, art. 11)"
        },
        {
          "id": "phone.isValidLandline#[\"tel 1130000000\"]",
          "args": [
            "tel 1130000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        },
        {
          "id": "phone.isValidLandline#[\"(11) 3000-0000x\"]",
          "args": [
            "(11) 3000-0000x"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        }
      ]
    },
    {
      "id": "phone.isValidMobile",
      "level": "extended",
      "summary": "Checks whether a phone number is a valid Brazilian mobile number.",
      "description": "Validates a mobile number: DDD plus 9 digits.\n\n- The function accepts a country code (`+55`, `0055` or a bare `55`) and removes it first, as in `phone.parse`. A bare `55` is removed only when 10 or 11 digits are left.\n- The DDD must be a valid Brazilian area code (`00` is not).\n- Any character other than digits, whitespace and `()+.-/` (a letter, for instance) makes the value invalid. Until 2.4.0 such characters were dropped, so `11 98765-4321x` was valid.\n- The first subscriber digit must be 7, 8 or 9 under both numbering rules (Resolução Anatel nº 749/2022, art. 12, I, \"a\": Serviço Móvel Pessoal). 2.4.0 also accepted 6 under version 1, although 6 is not SMP.\n- `options.version` (`1` or `2`, default `1`) picks the numbering rule for the `700` series. Version 1 accepts it. Version 2 rejects it, because art. 12, II, \"a\" gives it to the satellite service.\n- Resolução Anatel nº 777/2025 rewrites art. 12 from 1 March 2027 (only 8 and 9 for SMP, plus the `700` series as satellite SMP). It is not in force yet, so the function does not apply it.",
      "params": [
        {
          "name": "value",
          "type": "string"
        },
        {
          "name": "options",
          "type": "IsValidMobilePhoneOptions",
          "optional": true
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "phone.isValidMobile#[\"(11) 98765-4321\"]",
          "args": [
            "(11) 98765-4321"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidMobile#country-code",
          "args": [
            "+55 11 98765-4321"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidMobile#[\"5511987654321\"]",
          "args": [
            "5511987654321"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidMobile#landline",
          "args": [
            "1130000000"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidMobile#10-digits",
          "args": [
            "1198765432"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidMobile#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidMobile#[\"+55 11 3000-0000\"]",
          "args": [
            "+55 11 3000-0000"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the country code leaves an invalid number"
        },
        {
          "id": "phone.isValidMobile#[\"+1 415 555 2671\"]",
          "args": [
            "+1 415 555 2671"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the country code leaves an invalid number"
        },
        {
          "id": "phone.isValidMobile#[\"11612345678\",{\"version\":2}]",
          "args": [
            "11612345678",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the first number digit is 6, which is not SMP, under either version"
        },
        {
          "id": "phone.isValidMobile#[\"11700123456\",{\"version\":2}]",
          "args": [
            "11700123456",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when version 2 is requested and the number is in the 700 satellite series"
        },
        {
          "id": "phone.isValidMobile#[\"(11) 70012-3456\",{\"version\":2}]",
          "args": [
            "(11) 70012-3456",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when version 2 is requested and the number is in the 700 satellite series"
        },
        {
          "id": "phone.isValidMobile#[\"+55 11 70012-3456\",{\"version\":2}]",
          "args": [
            "+55 11 70012-3456",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when version 2 is requested and the number is in the 700 satellite series"
        },
        {
          "id": "phone.isValidMobile#[\"11987654321\",{\"version\":2}]",
          "args": [
            "11987654321",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 2"
        },
        {
          "id": "phone.isValidMobile#[\"11712345678\",{\"version\":2}]",
          "args": [
            "11712345678",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when version 2 is requested and the first number digit is 7 or 8"
        },
        {
          "id": "phone.isValidMobile#[\"11812345678\",{\"version\":2}]",
          "args": [
            "11812345678",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when version 2 is requested and the first number digit is 7 or 8"
        },
        {
          "id": "phone.isValidMobile#[\"11701234567\",{\"version\":2}]",
          "args": [
            "11701234567",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when version 2 is requested and the number only starts like the 700 series"
        },
        {
          "id": "phone.isValidMobile#[\"11770012345\",{\"version\":2}]",
          "args": [
            "11770012345",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when version 2 is requested and the number only starts like the 700 series"
        },
        {
          "id": "phone.isValidMobile#[\"11712345678\",{\"version\":1}]",
          "args": [
            "11712345678",
            {
              "version": 1
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 1"
        },
        {
          "id": "phone.isValidMobile#[\"11612345678\",{\"version\":1}]",
          "args": [
            "11612345678",
            {
              "version": 1
            }
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): a first subscriber digit of 6 is not SMP (Resolução Anatel nº 749/2022, art. 12, I, \"a\"), so version 1 rejects it too. 2.4.0 returned true"
        },
        {
          "id": "phone.isValidMobile#[\"11700123456\",{\"version\":1}]",
          "args": [
            "11700123456",
            {
              "version": 1
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when is a valid mobile phone version 1"
        },
        {
          "id": "phone.isValidMobile#[\"+5511987654321\"]",
          "args": [
            "+5511987654321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidMobile#[\"+55 (11) 98765-4321\"]",
          "args": [
            "+55 (11) 98765-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidMobile#[\"0055 11 98765-4321\"]",
          "args": [
            "0055 11 98765-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidMobile#[\"+55 11 98765-4321\",{\"version\":2}]",
          "args": [
            "+55 11 98765-4321",
            {
              "version": 2
            }
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when it carries the country code"
        },
        {
          "id": "phone.isValidMobile#[\"55987654321\"]",
          "args": [
            "55987654321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the area code is 55"
        },
        {
          "id": "phone.isValidMobile#[\"+55 55 98765-4321\"]",
          "args": [
            "+55 55 98765-4321"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when the area code is 55"
        },
        {
          "id": "phone.isValidMobile#[\"11612345678\"]",
          "args": [
            "11612345678"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): the default version 1 rejects a first subscriber digit of 6 (Resolução Anatel nº 749/2022, art. 12, I, \"a\"). 2.4.0 returned true"
        },
        {
          "id": "phone.isValidMobile#[\"11700123456\"]",
          "args": [
            "11700123456"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: version 1 (default) keeps the 700 series"
        },
        {
          "id": "phone.isValidMobile#[\"11 98765-4321x\"]",
          "args": [
            "11 98765-4321x"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        },
        {
          "id": "phone.isValidMobile#[\"+55 11 98765-4321 a\"]",
          "args": [
            "+55 11 98765-4321 a"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        }
      ]
    },
    {
      "id": "phone.isValidService",
      "level": "extended",
      "summary": "Checks whether a phone number is a valid Brazilian service number.",
      "description": "Validates a Brazilian service number, dialed without a DDD. The function checks only the structure: the number does not have to be assigned to anyone.\n\n- A country code (`+55`, `0055` or a bare `55`) is accepted and removed first, as in `phone.isValid` with `accept: [\"service\"]`: `+55 0800 123 4567` is valid. Until 2.4.0 it was rejected. A bare `55` is removed only when 11 digits that form a service number are left (`5508001234567` is valid; `55190` and `5540041234` are not).\n- Any character other than digits, whitespace and `()+.-/` (a letter, for instance) makes the value invalid. Until 2.4.0 such characters were dropped, so `abc190` was valid.\n- Códigos Não Geográficos `0300`, `0303`, `0500`, `0800` and `0900` followed by 7 digits (11 in total; the old 6-digit form, such as `0800 123456`, is rejected). The rule of `0500` that encodes a donation amount in the last two digits is not enforced.\n- The abbreviated `300X`/`400X` numbers (8 digits). Other carrier prefixes are rejected.\n- The 3-digit public utility codes designated by Anatel (such as `190` and `192`), from Anatel's current SUP list and the Anexo of Ato nº 43.151/2004. `112` is accepted: the current SUP list has it (2.4.0 rejected it).\n- `911` stays rejected. The SUP list names it next to `112`, but Resolução Anatel nº 749/2022, art. 13, gives public utility services only the `1N₂N₁` range. The two official texts conflict, so the 2.4.0 answer stays.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "phone.isValidService#[\"08001234567\"]",
          "args": [
            "08001234567"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidService#masked",
          "args": [
            "0800 123 4567"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidService#abbreviated",
          "args": [
            "40041234"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "phone.isValidService#mobile",
          "args": [
            "11987654321"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidService#too-short",
          "args": [
            "0800123456"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidService#not-a-brazilian-short-code",
          "args": [
            "911"
          ],
          "expect": {
            "returns": false
          },
          "note": "911 is on the SUP list but outside the 1N₂N₁ range of Resolução Anatel nº 749/2022, art. 13; the conflict keeps the 2.4.0 answer"
        },
        {
          "id": "phone.isValidService#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "phone.isValidService#[\"1130000000\"]",
          "args": [
            "1130000000"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it is a geographic number"
        },
        {
          "id": "phone.isValidService#[\"01001234567\"]",
          "args": [
            "01001234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic prefix is unknown"
        },
        {
          "id": "phone.isValidService#[\"02001234567\"]",
          "args": [
            "02001234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic prefix is unknown"
        },
        {
          "id": "phone.isValidService#[\"04001234567\"]",
          "args": [
            "04001234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic prefix is unknown"
        },
        {
          "id": "phone.isValidService#[\"06001234567\"]",
          "args": [
            "06001234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic prefix is unknown"
        },
        {
          "id": "phone.isValidService#[\"07001234567\"]",
          "args": [
            "07001234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic prefix is unknown"
        },
        {
          "id": "phone.isValidService#[\"08101234567\"]",
          "args": [
            "08101234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic prefix is unknown"
        },
        {
          "id": "phone.isValidService#[\"08011234567\"]",
          "args": [
            "08011234567"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic prefix is unknown"
        },
        {
          "id": "phone.isValidService#[\"080012345678\"]",
          "args": [
            "080012345678"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the non-geographic length is wrong"
        },
        {
          "id": "phone.isValidService#[\"40201234\"]",
          "args": [
            "40201234"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the abbreviated root is unknown"
        },
        {
          "id": "phone.isValidService#[\"31031234\"]",
          "args": [
            "31031234"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the abbreviated root is unknown"
        },
        {
          "id": "phone.isValidService#[\"50041234\"]",
          "args": [
            "50041234"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the abbreviated root is unknown"
        },
        {
          "id": "phone.isValidService#[\"4004123\"]",
          "args": [
            "4004123"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the abbreviated length is wrong"
        },
        {
          "id": "phone.isValidService#[\"400412345\"]",
          "args": [
            "400412345"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the abbreviated length is wrong"
        },
        {
          "id": "phone.isValidService#[\"101\"]",
          "args": [
            "101"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the utility code was never designated"
        },
        {
          "id": "phone.isValidService#[\"110\"]",
          "args": [
            "110"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the utility code was never designated"
        },
        {
          "id": "phone.isValidService#[\"189\"]",
          "args": [
            "189"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the utility code was never designated"
        },
        {
          "id": "phone.isValidService#[\"200\"]",
          "args": [
            "200"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the utility code was never designated"
        },
        {
          "id": "phone.isValidService#[\"999\"]",
          "args": [
            "999"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the utility code was never designated"
        },
        {
          "id": "phone.isValidService#[\"112\"]",
          "args": [
            "112"
          ],
          "expect": {
            "returns": true
          },
          "note": "changed in 2.5.0 (#593): 112 is on Anatel's current SUP list (page modified on 22/06/2023) and inside the 1N₂N₁ range of Resolução nº 749/2022, art. 13. 2.4.0 returned false"
        },
        {
          "id": "phone.isValidService#[\"03001234567\"]",
          "args": [
            "03001234567"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every non-geographic prefix"
        },
        {
          "id": "phone.isValidService#[\"03031234567\"]",
          "args": [
            "03031234567"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every non-geographic prefix"
        },
        {
          "id": "phone.isValidService#[\"05001234567\"]",
          "args": [
            "05001234567"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every non-geographic prefix"
        },
        {
          "id": "phone.isValidService#[\"09001234567\"]",
          "args": [
            "09001234567"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every non-geographic prefix"
        },
        {
          "id": "phone.isValidService#[\"0800-123-4567\"]",
          "args": [
            "0800-123-4567"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a formatted non-geographic number"
        },
        {
          "id": "phone.isValidService#[\"0300 123 4567\"]",
          "args": [
            "0300 123 4567"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a formatted non-geographic number"
        },
        {
          "id": "phone.isValidService#[\"30001234\"]",
          "args": [
            "30001234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every abbreviated root"
        },
        {
          "id": "phone.isValidService#[\"30031234\"]",
          "args": [
            "30031234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every abbreviated root"
        },
        {
          "id": "phone.isValidService#[\"30091234\"]",
          "args": [
            "30091234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every abbreviated root"
        },
        {
          "id": "phone.isValidService#[\"40001234\"]",
          "args": [
            "40001234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every abbreviated root"
        },
        {
          "id": "phone.isValidService#[\"40021234\"]",
          "args": [
            "40021234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every abbreviated root"
        },
        {
          "id": "phone.isValidService#[\"40091234\"]",
          "args": [
            "40091234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for every abbreviated root"
        },
        {
          "id": "phone.isValidService#[\"4004-1234\"]",
          "args": [
            "4004-1234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a formatted abbreviated number"
        },
        {
          "id": "phone.isValidService#[\"3003 1234\"]",
          "args": [
            "3003 1234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a formatted abbreviated number"
        },
        {
          "id": "phone.isValidService#[\"100\"]",
          "args": [
            "100"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"102\"]",
          "args": [
            "102"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"136\"]",
          "args": [
            "136"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"141\"]",
          "args": [
            "141"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"156\"]",
          "args": [
            "156"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"180\"]",
          "args": [
            "180"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"181\"]",
          "args": [
            "181"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"188\"]",
          "args": [
            "188"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"190\"]",
          "args": [
            "190"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"191\"]",
          "args": [
            "191"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"192\"]",
          "args": [
            "192"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"193\"]",
          "args": [
            "193"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"199\"]",
          "args": [
            "199"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the public utility codes"
        },
        {
          "id": "phone.isValidService#[\"abc190\"]",
          "args": [
            "abc190"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        },
        {
          "id": "phone.isValidService#[\"0800 123 4567x\"]",
          "args": [
            "0800 123 4567x"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the value holds a character that is not part of a phone mask"
        },
        {
          "id": "phone.isValidService#[\"55190\"]",
          "args": [
            "55190"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when a bare 55 does not leave a service number behind"
        },
        {
          "id": "phone.isValidService#[\"5540041234\"]",
          "args": [
            "5540041234"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when a bare 55 does not leave a service number behind"
        },
        {
          "id": "phone.isValidService#[\"+55 11987654321\"]",
          "args": [
            "+55 11987654321"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when a bare 55 does not leave a service number behind"
        },
        {
          "id": "phone.isValidService#[\"+55 0800 123 4567\"]",
          "args": [
            "+55 0800 123 4567"
          ],
          "expect": {
            "returns": true
          },
          "note": "changed in 2.5.0 (#615): a country code is accepted, as in isValid with accept service. JavaScript's own test: when it is written with a country code"
        },
        {
          "id": "phone.isValidService#[\"+55 190\"]",
          "args": [
            "+55 190"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when it is written with a country code"
        },
        {
          "id": "phone.isValidService#[\"0055 4004-1234\"]",
          "args": [
            "0055 4004-1234"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when it is written with a country code"
        },
        {
          "id": "phone.isValidService#[\"5508001234567\"]",
          "args": [
            "5508001234567"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when it is written with a country code"
        }
      ]
    },
    {
      "id": "phone.parse",
      "level": "extended",
      "summary": "Removes the formatting characters of a phone number and returns only the digits, up to 11.",
      "description": "Removes phone formatting and keeps only digits, capped at 11 digits.\n\n- An explicit country code, written as `+55` or `0055` at the start of the value, is always stripped, however many digits follow, so a number still being typed keeps its DDD: `+55 11 9` gives `119`. Until 2.4.0 the length rule below applied to the explicit forms too, so `+55 11 9` gave `55119`.\n- A bare leading `55` is stripped only when 10 or 11 digits are left (DDD plus an 8 or 9 digit subscriber number). This way area code 55 is not mistaken for a country code: `55987654321` is kept, and `55 11 9` gives `55119`.\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).",
      "params": [
        {
          "name": "value",
          "type": "string | number"
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "phone.parse#masked-mobile",
          "args": [
            "(11) 98888-7777"
          ],
          "expect": {
            "returns": "11988887777"
          }
        },
        {
          "id": "phone.parse#no-ddd",
          "args": [
            "98888-7777"
          ],
          "expect": {
            "returns": "988887777"
          }
        },
        {
          "id": "phone.parse#country-code",
          "args": [
            "+55 11 98888-7777"
          ],
          "expect": {
            "returns": "11988887777"
          }
        },
        {
          "id": "phone.parse#0055",
          "args": [
            "005511988887777"
          ],
          "expect": {
            "returns": "11988887777"
          }
        },
        {
          "id": "phone.parse#bare-55-landline",
          "args": [
            "551130000000"
          ],
          "expect": {
            "returns": "1130000000"
          }
        },
        {
          "id": "phone.parse#ddd-55",
          "args": [
            "55988887777"
          ],
          "expect": {
            "returns": "55988887777"
          },
          "note": "11 digits: 55 is read as the DDD, not a country code; asserted by the reference (JS) unit tests"
        },
        {
          "id": "phone.parse#service",
          "args": [
            "0800 123 4567"
          ],
          "expect": {
            "returns": "08001234567"
          }
        },
        {
          "id": "phone.parse#caps-length",
          "args": [
            "11988887777123"
          ],
          "expect": {
            "returns": "11988887777"
          }
        },
        {
          "id": "phone.parse#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          }
        },
        {
          "id": "phone.parse#[\"48976579784\"]",
          "args": [
            "48976579784"
          ],
          "expect": {
            "returns": "48976579784"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"48976579785\"]",
          "args": [
            "48976579785"
          ],
          "expect": {
            "returns": "48976579785"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"00000000000\"]",
          "args": [
            "00000000000"
          ],
          "expect": {
            "returns": "00000000000"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"3147981464\"]",
          "args": [
            "3147981464"
          ],
          "expect": {
            "returns": "3147981464"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"3147981465\"]",
          "args": [
            "3147981465"
          ],
          "expect": {
            "returns": "3147981465"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"0000000000\"]",
          "args": [
            "0000000000"
          ],
          "expect": {
            "returns": "0000000000"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"38942432195\"]",
          "args": [
            "38942432195"
          ],
          "expect": {
            "returns": "38942432195"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"38942432196\"]",
          "args": [
            "38942432196"
          ],
          "expect": {
            "returns": "38942432196"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"48976-5797\"]",
          "args": [
            "48976-5797"
          ],
          "expect": {
            "returns": "489765797"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"31479-8146\"]",
          "args": [
            "31479-8146"
          ],
          "expect": {
            "returns": "314798146"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"38942-4321\"]",
          "args": [
            "38942-4321"
          ],
          "expect": {
            "returns": "389424321"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"   \"]",
          "args": [
            "   "
          ],
          "expect": {
            "returns": ""
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.parse#[\"+55 (11) 98888-7777\"]",
          "args": [
            "+55 (11) 98888-7777"
          ],
          "expect": {
            "returns": "11988887777"
          },
          "note": "JavaScript's own test: should remove non numeric characters"
        },
        {
          "id": "phone.parse#[\"+5511988887777\"]",
          "args": [
            "+5511988887777"
          ],
          "expect": {
            "returns": "11988887777"
          },
          "note": "JavaScript's own test: should remove the country code from every international notation"
        },
        {
          "id": "phone.parse#[\"5511988887777\"]",
          "args": [
            "5511988887777"
          ],
          "expect": {
            "returns": "11988887777"
          },
          "note": "JavaScript's own test: should remove the country code from every international notation"
        },
        {
          "id": "phone.parse#[\"+55 (11) 3000-0000\"]",
          "args": [
            "+55 (11) 3000-0000"
          ],
          "expect": {
            "returns": "1130000000"
          },
          "note": "JavaScript's own test: should remove the country code from every international notation"
        },
        {
          "id": "phone.parse#[\"(55) 3000-0000\"]",
          "args": [
            "(55) 3000-0000"
          ],
          "expect": {
            "returns": "5530000000"
          },
          "note": "JavaScript's own test: should keep a leading 55 that is an area code"
        },
        {
          "id": "phone.parse#[\"+55 (55) 98888-7777\"]",
          "args": [
            "+55 (55) 98888-7777"
          ],
          "expect": {
            "returns": "55988887777"
          },
          "note": "JavaScript's own test: should keep a leading 55 that is an area code"
        },
        {
          "id": "phone.parse#[\"55123\"]",
          "args": [
            "55123"
          ],
          "expect": {
            "returns": "55123"
          },
          "note": "JavaScript's own test: should keep the digits when the country code leaves an implausible number"
        },
        {
          "id": "phone.parse#[\"4004-1234\"]",
          "args": [
            "4004-1234"
          ],
          "expect": {
            "returns": "40041234"
          },
          "note": "JavaScript's own test: should keep service numbers untouched"
        },
        {
          "id": "phone.parse#[\"190\"]",
          "args": [
            "190"
          ],
          "expect": {
            "returns": "190"
          },
          "note": "JavaScript's own test: should keep service numbers untouched"
        },
        {
          "id": "phone.parse#[11988887777]",
          "args": [
            11988887777
          ],
          "expect": {
            "returns": "11988887777"
          },
          "note": "JavaScript's own test: should accept numbers"
        },
        {
          "id": "phone.parse#[-11988887777]",
          "args": [
            -11988887777
          ],
          "expect": {
            "returns": ""
          },
          "note": "changed in 2.5.0 (#593): a negative number is not a safe non-negative integer. 2.4.0 returned \"11988887777\""
        },
        {
          "id": "phone.parse#[1.5]",
          "args": [
            1.5
          ],
          "expect": {
            "returns": ""
          },
          "note": "#593 number rule: a fractional number gives an empty string"
        },
        {
          "id": "phone.parse#[\"+55\"]",
          "args": [
            "+55"
          ],
          "expect": {
            "returns": ""
          },
          "note": "JavaScript's own test: should remove an explicit country code from a number still being typed"
        },
        {
          "id": "phone.parse#[\"+55 11 9\"]",
          "args": [
            "+55 11 9"
          ],
          "expect": {
            "returns": "119"
          },
          "note": "JavaScript docs example: changed in 2.5.0 (#615), 2.4.0 gave 55119"
        },
        {
          "id": "phone.parse#[\"0055 (11) 98888\"]",
          "args": [
            "0055 (11) 98888"
          ],
          "expect": {
            "returns": "1198888"
          },
          "note": "JavaScript's own test: should remove an explicit country code from a number still being typed"
        },
        {
          "id": "phone.parse#[\"+55 55 9\"]",
          "args": [
            "+55 55 9"
          ],
          "expect": {
            "returns": "559"
          },
          "note": "JavaScript's own test: should remove an explicit country code from a number still being typed"
        },
        {
          "id": "phone.parse#[\"55 11 9\"]",
          "args": [
            "55 11 9"
          ],
          "expect": {
            "returns": "55119"
          },
          "note": "JavaScript's own test: should keep a bare 55 that is still short"
        },
        {
          "id": "phone.parse#[\"55987654321\"]",
          "args": [
            "55987654321"
          ],
          "expect": {
            "returns": "55987654321"
          },
          "note": "JavaScript docs example (area code 55, not mistaken for the +55 country code)"
        },
        {
          "id": "phone.parse#[\"5511987654321\"]",
          "args": [
            "5511987654321"
          ],
          "expect": {
            "returns": "11987654321"
          },
          "note": "JavaScript docs example"
        }
      ]
    },
    {
      "id": "phone.removeInternationalDialingCode",
      "level": "core",
      "summary": "Removes a leading `+55` or `55`.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "string",
      "cases": [
        {
          "id": "phone.removeInternationalDialingCode#[\"48976579784\"]",
          "args": [
            "48976579784"
          ],
          "expect": {
            "returns": "48976579784"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"48976579785\"]",
          "args": [
            "48976579785"
          ],
          "expect": {
            "returns": "48976579785"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"00000000000\"]",
          "args": [
            "00000000000"
          ],
          "expect": {
            "returns": "00000000000"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"3147981464\"]",
          "args": [
            "3147981464"
          ],
          "expect": {
            "returns": "3147981464"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"3147981465\"]",
          "args": [
            "3147981465"
          ],
          "expect": {
            "returns": "3147981465"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"0000000000\"]",
          "args": [
            "0000000000"
          ],
          "expect": {
            "returns": "0000000000"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"38942432195\"]",
          "args": [
            "38942432195"
          ],
          "expect": {
            "returns": "38942432195"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"38942432196\"]",
          "args": [
            "38942432196"
          ],
          "expect": {
            "returns": "38942432196"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"48976-5797\"]",
          "args": [
            "48976-5797"
          ],
          "expect": {
            "returns": "48976-5797"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"31479-8146\"]",
          "args": [
            "31479-8146"
          ],
          "expect": {
            "returns": "31479-8146"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"38942-4321\"]",
          "args": [
            "38942-4321"
          ],
          "expect": {
            "returns": "38942-4321"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"\"]",
          "args": [
            ""
          ],
          "expect": {
            "returns": ""
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"   \"]",
          "args": [
            "   "
          ],
          "expect": {
            "returns": "   "
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        },
        {
          "id": "phone.removeInternationalDialingCode#[\"abc\"]",
          "args": [
            "abc"
          ],
          "expect": {
            "returns": "abc"
          },
          "note": "consensus of 4 libs (go, python, ruby, rust)"
        }
      ]
    }
  ]
}
