Socket
Socket
Sign inDemoInstall

strip-bom

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-bom - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

index.d.ts

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc