has-ansi
Advanced tools
Comparing version 3.0.0 to 4.0.0
'use strict'; | ||
const ansiRegex = require('ansi-regex'); | ||
// Remove the `g` flag | ||
const re = new RegExp(ansiRegex().source); | ||
// Removes the `g` flag | ||
const regex = new RegExp(ansiRegex().source); | ||
module.exports = input => re.test(input); | ||
module.exports = string => regex.test(string); |
{ | ||
"name": "has-ansi", | ||
"version": "3.0.0", | ||
"description": "Check if a string has ANSI escape codes", | ||
"license": "MIT", | ||
"repository": "chalk/has-ansi", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"ansi", | ||
"styles", | ||
"color", | ||
"colour", | ||
"colors", | ||
"terminal", | ||
"console", | ||
"string", | ||
"tty", | ||
"escape", | ||
"shell", | ||
"xterm", | ||
"command-line", | ||
"text", | ||
"regex", | ||
"regexp", | ||
"re", | ||
"match", | ||
"test", | ||
"find", | ||
"pattern", | ||
"has" | ||
], | ||
"dependencies": { | ||
"ansi-regex": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
"name": "has-ansi", | ||
"version": "4.0.0", | ||
"description": "Check if a string has ANSI escape codes", | ||
"license": "MIT", | ||
"repository": "chalk/has-ansi", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"ansi", | ||
"styles", | ||
"color", | ||
"colour", | ||
"colors", | ||
"terminal", | ||
"console", | ||
"string", | ||
"tty", | ||
"escape", | ||
"shell", | ||
"xterm", | ||
"command-line", | ||
"text", | ||
"regex", | ||
"regexp", | ||
"match", | ||
"test", | ||
"find", | ||
"pattern", | ||
"has" | ||
], | ||
"dependencies": { | ||
"ansi-regex": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^2.3.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -39,4 +39,13 @@ # has-ansi [![Build Status](https://travis-ci.org/chalk/has-ansi.svg?branch=master)](https://travis-ci.org/chalk/has-ansi) | ||
## License | ||
MIT | ||
--- | ||
<div align="center"> | ||
<b> | ||
<a href="https://tidelift.com/subscription/pkg/npm-has-ansi?utm_source=npm-has-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package 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> |
3318
51
+ Addedansi-regex@4.1.1(transitive)
- Removedansi-regex@3.0.1(transitive)
Updatedansi-regex@^4.1.0