All files / src/plugins strip_bom.js

20% Statements 1/5
0% Branches 0/4
0% Functions 0/1
25% Lines 1/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8      2x        
import {toStr} from "../helpers/string/to_string";
import {BYTE_ORDER_MARK} from "../helpers/number/const";
 
export const stripBoom = s => {
    let _s = toStr(s)
    if (_s === '') return _s
    return _s[0] === BYTE_ORDER_MARK ? _s.substr(1) : _s
}