MCPcopy Index your code
hub / github.com/nodejs/node / stripBOM

Function stripBOM

lib/internal/modules/helpers.js:252–257  ·  view source on GitHub ↗

* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) * because the buffer-to-string conversion in `fs.readFileSync()` * translates it to FEFF, the UTF-16 BOM. * @param {string} content * @returns {string}

(content)

Source from the content-addressed store, hash-verified

250 * @returns {string}
251 */
252function stripBOM(content) {
253 if (StringPrototypeCharCodeAt(content) === 0xFEFF) {
254 content = StringPrototypeSlice(content, 1);
255 }
256 return content;
257}
258
259/**
260 * Add built-in modules to a global or REPL scope object.

Callers 2

translators.jsFile · 0.85
loader.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…