.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / node_modules / strip-bom / index.js
1 'use strict';
2 module.exports = x => {
3         if (typeof x !== 'string') {
4                 throw new TypeError('Expected a string, got ' + typeof x);
5         }
6
7         // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
8         // conversion translates it to FEFF (UTF-16 BOM)
9         if (x.charCodeAt(0) === 0xFEFF) {
10                 return x.slice(1);
11         }
12
13         return x;
14 };