return haystack;
}
const needleLen = needle.length;
let offset = 0;
if (needleLen === 1) {
const ch = needle.charCodeAt(0);
while (offset < haystack.length && haystack.charCodeAt(offset) === ch) {
offset++;
}
while (haystack.startsWith(needle, offset)) {
offset += needleLen;
}
}
}
/**