source: frontend/node_modules/webpack/lib/util/removeBOM.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 617 bytes
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Alexander Akait @alexander-akait
4*/
5
6"use strict";
7
8/**
9 * Returns result without BOM.
10 * @param {string | Buffer} strOrBuffer string or buffer
11 * @returns {string | Buffer} result without BOM
12 */
13module.exports = (strOrBuffer) => {
14 if (typeof strOrBuffer === "string" && strOrBuffer.charCodeAt(0) === 0xfeff) {
15 return strOrBuffer.slice(1);
16 } else if (
17 Buffer.isBuffer(strOrBuffer) &&
18 strOrBuffer[0] === 0xef &&
19 strOrBuffer[1] === 0xbb &&
20 strOrBuffer[2] === 0xbf
21 ) {
22 return strOrBuffer.subarray(3);
23 }
24
25 return strOrBuffer;
26};
Note: See TracBrowser for help on using the repository browser.