{"version":3,"file":"_isFormatIriReference.mjs","names":[],"sources":["../../src/internal/_isFormatIriReference.ts"],"sourcesContent":["/**\n * Checks the `iri-reference` format at the character level.\n *\n * Rejects control characters, DEL and C1 controls, lone surrogates, space and\n * the characters `\"<>\\^`{|}`, and any `%`that is not followed by two\n * hexadecimal digits. A colon before the first`/`, `?`or`#` must end a valid\n * scheme. Authority, port and path structure are not parsed.\n *\n * @evidence contracts/common.md#principled-implementation Characters that no IRI may contain (controls, space, lone surrogates and a few ASCII delimiters) and malformed percent escapes are rejected, and a colon before the first path delimiter must be the end of a valid scheme, which separates `a:b` from the relative `./a:b`. Authority, port and path structure are not parsed, so the predicate is a character and scheme check and not full grammar validation.\n * @evidence contracts/common.md#clear-and-simple-design One predicate with three private patterns, identical to the copy in @typia/utils.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts The forbidden set comes from the IRI grammar and not from examples.\n * @evidence contracts/common.md#meaningful-documentation The doc states what is rejected and what is not parsed.\n */\nexport const _isFormatIriReference = (str: string): boolean => {\n  if (FORBIDDEN.test(str) || INVALID_PERCENT.test(str)) return false;\n  const colon: number = str.indexOf(\":\");\n  const boundary: number = str.search(/[/?#]/u);\n  return (\n    colon === -1 || (boundary !== -1 && boundary < colon) || SCHEME.test(str)\n  );\n};\n\nconst FORBIDDEN = /[\\u0000-\\u0020\\u007f-\\u009f\\ud800-\\udfff\"<>\\\\^`{|}]/u;\nconst INVALID_PERCENT = /%(?![0-9A-Fa-f]{2})/u;\nconst SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*:/u;\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,yBAAyB,QAAyB;CAC7D,IAAI,UAAU,KAAK,GAAG,KAAK,gBAAgB,KAAK,GAAG,GAAG,OAAO;CAC7D,MAAM,QAAgB,IAAI,QAAQ,GAAG;CACrC,MAAM,WAAmB,IAAI,OAAO,QAAQ;CAC5C,OACE,UAAU,MAAO,aAAa,MAAM,WAAW,SAAU,OAAO,KAAK,GAAG;AAE5E;AAEA,MAAM,YAAY;AAClB,MAAM,kBAAkB;AACxB,MAAM,SAAS"}