MCPcopy Create free account
hub / github.com/ddopson/underscore-cli / stripBOM

Function stripBOM

lib/template.js:11–19  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

9
10// DDOPSON-2012-04-28 - stealing this method from module.js ... seems pretty corner-case
11function stripBOM(content) {
12 // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
13 // because the buffer-to-string conversion in `fs.readFileSync()`
14 // translates it to FEFF, the UTF-16 BOM.
15 if (content.charCodeAt(0) === 0xFEFF) {
16 content = content.slice(1);
17 }
18 return content;
19}
20
21////////////////////////////////////////////////////////////////////////////////////////////////////
22// From: underscore.js

Callers 1

template.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected