MCPcopy Create free account
hub / github.com/Snapchat/Valdi / encodeUtf16LE

Function encodeUtf16LE

src/valdi_modules/src/valdi/coreutils/web/UnicodeNative.ts:156–164  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

154 }
155 // overlong & range checks (simple)
156 if (
157 !valid ||
158 (needed === 1 && cp < 0x80) ||
159 (needed === 2 && cp < 0x800) ||
160 (needed === 3 && cp < 0x10000) ||
161 cp > 0x10ffff ||
162 (cp >= 0xd800 && cp <= 0xdfff)
163 ) {
164 cps.push(REPLACEMENT);
165 } else {
166 cps.push(cp);
167 }

Callers 1

encodeStringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected