MCPcopy Create free account
hub / github.com/nodejs/node / HasIsolatedSurrogate

Function HasIsolatedSurrogate

deps/v8/test/mjsunit/wasm/stringrefs-exec-gc.js:59–65  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

57 return 0xD800 <= codepoint && codepoint <= 0xDFFF
58}
59function HasIsolatedSurrogate(str) {
60 for (let codepoint of str) {
61 let value = codepoint.codePointAt(0);
62 if (IsSurrogate(value)) return true;
63 }
64 return false;
65}
66function ReplaceIsolatedSurrogates(str, replacement='\ufffd') {
67 let replaced = '';
68 for (let codepoint of str) {

Callers 1

Calls 1

IsSurrogateFunction · 0.70

Tested by

no test coverage detected