Comparing version 3.0.0 to 4.0.0
13
index.js
'use strict'; | ||
module.exports = x => { | ||
if (typeof x !== 'string') { | ||
throw new TypeError('Expected a string, got ' + typeof x); | ||
module.exports = string => { | ||
if (typeof string !== 'string') { | ||
throw new TypeError(`Expected a string, got ${typeof string}`); | ||
} | ||
@@ -9,7 +10,7 @@ | ||
// conversion translates it to FEFF (UTF-16 BOM) | ||
if (x.charCodeAt(0) === 0xFEFF) { | ||
return x.slice(1); | ||
if (string.charCodeAt(0) === 0xFEFF) { | ||
return string.slice(1); | ||
} | ||
return x; | ||
return string; | ||
}; |
{ | ||
"name": "strip-bom", | ||
"version": "3.0.0", | ||
"description": "Strip UTF-8 byte order mark (BOM) from a string", | ||
"license": "MIT", | ||
"repository": "sindresorhus/strip-bom", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"strip", | ||
"bom", | ||
"byte", | ||
"order", | ||
"mark", | ||
"unicode", | ||
"utf8", | ||
"utf-8", | ||
"remove", | ||
"delete", | ||
"trim", | ||
"text", | ||
"string" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
"name": "strip-bom", | ||
"version": "4.0.0", | ||
"description": "Strip UTF-8 byte order mark (BOM) from a string", | ||
"license": "MIT", | ||
"repository": "sindresorhus/strip-bom", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
"strip", | ||
"bom", | ||
"byte", | ||
"order", | ||
"mark", | ||
"unicode", | ||
"utf8", | ||
"utf-8", | ||
"remove", | ||
"delete", | ||
"trim", | ||
"text", | ||
"string" | ||
], | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom) | ||
> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string | ||
> Strip UTF-8 [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string | ||
@@ -9,7 +9,20 @@ From Wikipedia: | ||
--- | ||
<div align="center"> | ||
<b> | ||
<a href="https://tidelift.com/subscription/pkg/npm-strip-bom?utm_source=npm-strip-bom&utm_medium=referral&utm_campaign=readme">Get professional support for 'strip-bom' with a Tidelift subscription</a> | ||
</b> | ||
<br> | ||
<sub> | ||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. | ||
</sub> | ||
</div> | ||
--- | ||
## Install | ||
``` | ||
$ npm install --save strip-bom | ||
$ npm install strip-bom | ||
``` | ||
@@ -28,2 +41,7 @@ | ||
## Security | ||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. | ||
## Related | ||
@@ -30,0 +48,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3910
5
23
55
3