Socket
Socket
Sign inDemoInstall

has-ansi

Package Overview
Dependencies
1
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 5.0.0

7

index.js

@@ -1,6 +0,7 @@

'use strict';
const ansiRegex = require('ansi-regex');
import ansiRegex from 'ansi-regex';
const regex = ansiRegex({onlyFirst: true});
module.exports = string => regex.test(string);
export default function hasAnsi(string) {
return regex.test(string);
}
{
"name": "has-ansi",
"version": "4.0.1",
"version": "5.0.0",
"description": "Check if a string has ANSI escape codes",
"license": "MIT",
"repository": "chalk/has-ansi",
"funding": "https://github.com/chalk/has-ansi?sponsor=1",
"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"
},

@@ -45,8 +48,8 @@ "scripts": {

"dependencies": {
"ansi-regex": "^4.1.0"
"ansi-regex": "^6.0.0"
},
"devDependencies": {
"ava": "^2.3.0",
"xo": "^0.24.0"
"ava": "^3.15.0",
"xo": "^0.38.2"
}
}

@@ -5,3 +5,2 @@ # has-ansi

## Install

@@ -13,7 +12,6 @@

## Usage
```js
const hasAnsi = require('has-ansi');
import hasAnsi from 'has-ansi';

@@ -27,3 +25,2 @@ hasAnsi('\u001B[4mUnicorn\u001B[0m');

## Related

@@ -36,3 +33,2 @@

## Maintainers

@@ -43,3 +39,2 @@

---

@@ -46,0 +41,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc