Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chalk

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chalk - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

types/index.d.ts

1

index.js

@@ -221,1 +221,2 @@ 'use strict';

module.exports.supportsColor = supportsColor;
module.exports.default = module.exports; // For TypeScript

15

package.json
{
"name": "chalk",
"version": "2.1.0",
"version": "2.2.0",
"description": "Terminal string styling done right",

@@ -11,3 +11,3 @@ "license": "MIT",

"scripts": {
"test": "xo && nyc ava",
"test": "xo && tsc --project types && nyc ava",
"bench": "matcha benchmark.js",

@@ -18,3 +18,4 @@ "coveralls": "nyc report --reporter=text-lcov | coveralls"

"index.js",
"templates.js"
"templates.js",
"types/index.d.ts"
],

@@ -51,10 +52,12 @@ "keywords": [

"ava": "*",
"coveralls": "^2.11.2",
"execa": "^0.7.0",
"coveralls": "^3.0.0",
"execa": "^0.8.0",
"import-fresh": "^2.0.0",
"matcha": "^0.7.0",
"nyc": "^11.0.2",
"resolve-from": "^3.0.0",
"resolve-from": "^4.0.0",
"typescript": "^2.5.3",
"xo": "*"
},
"types": "types/index.d.ts",
"xo": {

@@ -61,0 +64,0 @@ "envs": [

@@ -289,2 +289,3 @@ <h1 align="center">

- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes

@@ -297,2 +298,3 @@ - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes

- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings

@@ -299,0 +301,0 @@

'use strict';
const TEMPLATE_REGEX = /(?:\\(u[a-f0-9]{4}|x[a-f0-9]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
const ESCAPE_REGEX = /\\(u[0-9a-f]{4}|x[0-9a-f]{2}|.)|([^\\])/gi;
const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
const ESCAPES = {
n: '\n',
r: '\r',
t: '\t',
b: '\b',
f: '\f',
v: '\v',
0: '\0',
'\\': '\\',
e: '\u001b',
a: '\u0007'
};
const ESCAPES = new Map([
['n', '\n'],
['r', '\r'],
['t', '\t'],
['b', '\b'],
['f', '\f'],
['v', '\v'],
['0', '\0'],
['\\', '\\'],
['e', '\u001B'],
['a', '\u0007']
]);

@@ -25,3 +25,3 @@ function unescape(c) {

return ESCAPES[c] || c;
return ESCAPES.get(c) || c;
}

@@ -28,0 +28,0 @@

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