Urara-Blog/node_modules/.pnpm-store/v3/files/0f/fdacd6a6a3dd886cd471cf1589675eee43143f421d36ab52286f8bc7dc13904782b2ad8d5636512a1710adf1cf5879594f22d306d9adf36d24e312362a397c
2022-08-14 01:14:53 +08:00

14 lines
317 B
Text

'use strict';
module.exports = x => {
if (typeof x !== 'string') {
throw new TypeError('Expected a string, got ' + typeof x);
}
// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
// conversion translates it to FEFF (UTF-16 BOM)
if (x.charCodeAt(0) === 0xFEFF) {
return x.slice(1);
}
return x;
};