{"version":3,"file":"_stringLengthLte.mjs","names":[],"sources":["../../src/internal/_stringLengthLte.ts"],"sourcesContent":["/**\n * Test whether a string has at most the given number of code points.\n *\n * UTF-16 length decides inputs whose code units already fit the bound. Other\n * inputs are counted only until the maximum is exceeded.\n *\n * @evidence contracts/common.md#principled-implementation Each code point occupies one or two UTF-16 units, so code-unit length at most the maximum proves the code-point bound. Otherwise iteration stops once the maximum is exceeded; negative and NaN maxima remain false.\n * @evidence contracts/common.md#clear-and-simple-design One loop with an early return.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts The unit is code points.\n * @evidence contracts/common.md#meaningful-documentation The doc states the early return and the code point unit.\n * @evidence contracts/performance.md#efficient-algorithms The code-unit upper bound accepts in constant time without allocating an iterator; ambiguous inputs retain the bounded code-point walk and constant auxiliary space.\n *\n * @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call depends on its own primitive string and bound; this predicate coordinates no repeated requests or shared computation.\n * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The predicate retains no state or handles after returning; iteration and scalar counters are call-local.\n */\nexport const _stringLengthLte = (value: string, length: number): boolean => {\n  if (value.length <= length) return true;\n  let count: number = 0;\n  if (!(count <= length)) return false;\n  for (const _ch of value) if (!(++count <= length)) return false;\n  return true;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAa,oBAAoB,OAAe,WAA4B;CAC1E,IAAI,MAAM,UAAU,QAAQ,OAAO;CACnC,IAAI,QAAgB;CACpB,IAAI,EAAE,SAAS,SAAS,OAAO;CAC/B,KAAK,MAAM,OAAO,OAAO,IAAI,EAAE,EAAE,SAAS,SAAS,OAAO;CAC1D,OAAO;AACT"}