{"version":3,"file":"_stringLength.mjs","names":[],"sources":["../../src/internal/_stringLength.ts"],"sourcesContent":["/**\n * Counts the code points yielded by ECMAScript string iteration.\n *\n * A surrogate pair counts once and an unpaired surrogate counts once. This is\n * neither UTF-16 code-unit length nor grapheme-cluster length.\n *\n * @evidence contracts/common.md#principled-implementation For-of uses the language string iterator, so incrementing once per yielded element implements code-point-oriented schema length independently of the UTF-16 units counted by String.length.\n * @evidence contracts/common.md#clear-and-simple-design One counter and one traversal implement the length without a temporary character array or a second Unicode segmentation policy.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts Language-defined iteration applies uniformly; no strings, encodings or consumers are patched or special-cased.\n * @evidence contracts/common.md#meaningful-documentation The doc states that it counts code points through string iteration, so a surrogate pair counts once and the result is neither the UTF-16 length nor a grapheme count.\n */\nexport const _stringLength = (value: string): number => {\n  let count: number = 0;\n  for (const _ch of value) ++count;\n  return count;\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,iBAAiB,UAA0B;CACtD,IAAI,QAAgB;CACpB,KAAK,MAAM,OAAO,OAAO,EAAE;CAC3B,OAAO;AACT"}