has-ansi
Advanced tools
Comparing version 4.0.1 to 5.0.0
@@ -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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3298
5
Yes
46
+ Addedansi-regex@6.0.1(transitive)
- Removedansi-regex@4.1.1(transitive)
Updatedansi-regex@^6.0.0