Merge c67ebe4285 into 8a090d7885
This commit is contained in:
commit
8a48b58658
2 changed files with 4 additions and 2 deletions
5
index.js
5
index.js
|
|
@ -1,5 +1,4 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
const escapeStringRegexp = require('escape-string-regexp');
|
|
||||||
const ansiStyles = require('ansi-styles');
|
const ansiStyles = require('ansi-styles');
|
||||||
const stdoutColor = require('supports-color').stdout;
|
const stdoutColor = require('supports-color').stdout;
|
||||||
|
|
||||||
|
|
@ -15,6 +14,10 @@ const skipModels = new Set(['gray']);
|
||||||
|
|
||||||
const styles = Object.create(null);
|
const styles = Object.create(null);
|
||||||
|
|
||||||
|
function escapeStringRegexp(str) {
|
||||||
|
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||||
|
}
|
||||||
|
|
||||||
function applyOptions(obj, options = {}) {
|
function applyOptions(obj, options = {}) {
|
||||||
if (options.level > 3 || options.level < 0) {
|
if (options.level > 3 || options.level < 0) {
|
||||||
throw new Error('The `level` option should be an integer from 0 to 3');
|
throw new Error('The `level` option should be an integer from 0 to 3');
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-styles": "^3.2.1",
|
"ansi-styles": "^3.2.1",
|
||||||
"escape-string-regexp": "^1.0.5",
|
|
||||||
"supports-color": "^5.5.0"
|
"supports-color": "^5.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue