diff --git a/src/index.js b/src/index.js index e5c24fc..e2b793e 100755 --- a/src/index.js +++ b/src/index.js @@ -8,11 +8,6 @@ export function parse(text, ...args) { const reviver = args.length > 1 || !firstOptions ? args[0] : undefined; const options = (args.length > 1 && args[1]) || firstOptions || {}; - // Strip a leading UTF-8 BOM - if (typeof text === 'string' && text.charCodeAt(0) === 0xfeff) { - text = text.slice(1); - } - // Parse normally, allowing exceptions const obj = JSON.parse(text, reviver); diff --git a/test/index.js b/test/index.js index 411004e..19dc0d3 100755 --- a/test/index.js +++ b/test/index.js @@ -91,10 +91,6 @@ describe('Bourne', () => { ); }); - it('ignores leading BOM', () => { - expect(Bourne.parse('\uFEFF{"a": 5, "b": 6}')).toEqual({ a: 5, b: 6 }); - }); - it('errors on proto property (unicode)', () => { expect(() => Bourne.parse('{ "a": 5, "b": 6, "\\u005f_proto__": { "x": 7 } }')).toThrow(SyntaxError); expect(() => Bourne.parse('{ "a": 5, "b": 6, "_\\u005fp\\u0072oto__": { "x": 7 } }')).toThrow(SyntaxError);