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 4.0.0 to 5.0.0

6

index.d.ts

@@ -6,3 +6,3 @@ /**

```
import stripBom = require('strip-bom');
import stripBom from 'strip-bom';

@@ -13,4 +13,2 @@ stripBom('\uFEFFunicorn');

*/
declare function stripBom(string: string): string;
export = stripBom;
export default function stripBom(string: string): string;

@@ -1,4 +0,2 @@

'use strict';
module.exports = string => {
export default function stripBom(string) {
if (typeof string !== 'string') {

@@ -9,3 +7,3 @@ throw new TypeError(`Expected a string, got ${typeof string}`);

// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
// conversion translates it to FEFF (UTF-16 BOM)
// conversion translates it to FEFF (UTF-16 BOM).
if (string.charCodeAt(0) === 0xFEFF) {

@@ -16,2 +14,2 @@ return string.slice(1);

return string;
};
}
{
"name": "strip-bom",
"version": "4.0.0",
"version": "5.0.0",
"description": "Strip UTF-8 byte order mark (BOM) from a string",
"license": "MIT",
"repository": "sindresorhus/strip-bom",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": ">=12"
},

@@ -38,6 +41,6 @@ "scripts": {

"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
}
}

@@ -1,2 +0,2 @@

# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom)
# strip-bom

@@ -9,16 +9,2 @@ > Strip UTF-8 [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string

---
<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

@@ -30,7 +16,6 @@

## Usage
```js
const stripBom = require('strip-bom');
import stripBom from 'strip-bom';

@@ -41,8 +26,2 @@ stripBom('\uFEFFunicorn');

## Security
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## Related

@@ -54,5 +33,12 @@

---
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
<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>

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