Initial commit (from f5274cbdce4ae7c9e4b937dcdf95ac70ae436d5f)
This commit is contained in:
commit
28ccc3db2d
13974 changed files with 2618436 additions and 0 deletions
15
node_modules/strip-bom/index.js
generated
vendored
Normal file
15
node_modules/strip-bom/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = string => {
|
||||
if (typeof string !== 'string') {
|
||||
throw new TypeError(`Expected a string, got ${typeof string}`);
|
||||
}
|
||||
|
||||
// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
|
||||
// conversion translates it to FEFF (UTF-16 BOM)
|
||||
if (string.charCodeAt(0) === 0xFEFF) {
|
||||
return string.slice(1);
|
||||
}
|
||||
|
||||
return string;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue