HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/share/nodejs/strip-bom/
Upload File :
Current File : //proc/self/root/usr/share/nodejs/strip-bom/index.js
'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;
};