summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/figures/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/figures/index.js')
-rw-r--r--tools/node_modules/eslint/node_modules/figures/index.js26
1 files changed, 14 insertions, 12 deletions
diff --git a/tools/node_modules/eslint/node_modules/figures/index.js b/tools/node_modules/eslint/node_modules/figures/index.js
index c01148ccb1..10bd6edba0 100644
--- a/tools/node_modules/eslint/node_modules/figures/index.js
+++ b/tools/node_modules/eslint/node_modules/figures/index.js
@@ -1,7 +1,7 @@
'use strict';
const escapeStringRegexp = require('escape-string-regexp');
-const platform = process.platform;
+const {platform} = process;
const main = {
tick: '✔',
@@ -31,6 +31,7 @@ const main = {
smiley: '㋡',
mustache: '෴',
heart: '♥',
+ nodejs: '⬢',
arrowUp: '↑',
arrowDown: '↓',
arrowLeft: '←',
@@ -62,7 +63,7 @@ const main = {
sevenEighths: '⅞'
};
-const win = {
+const windows = {
tick: '√',
cross: '×',
star: '*',
@@ -90,6 +91,7 @@ const win = {
smiley: '☺',
mustache: '┌─┐',
heart: main.heart,
+ nodejs: '♦',
arrowUp: main.arrowUp,
arrowDown: main.arrowDown,
arrowLeft: main.arrowLeft,
@@ -122,26 +124,26 @@ const win = {
};
if (platform === 'linux') {
- // the main one doesn't look that good on Ubuntu
+ // The main one doesn't look that good on Ubuntu
main.questionMarkPrefix = '?';
}
-const figures = platform === 'win32' ? win : main;
+const figures = platform === 'win32' ? windows : main;
-const fn = str => {
+const fn = string => {
if (figures === main) {
- return str;
+ return string;
}
- Object.keys(main).forEach(key => {
- if (main[key] === figures[key]) {
- return;
+ for (const [key, value] of Object.entries(main)) {
+ if (value === figures[key]) {
+ continue;
}
- str = str.replace(new RegExp(escapeStringRegexp(main[key]), 'g'), figures[key]);
- });
+ string = string.replace(new RegExp(escapeStringRegexp(value), 'g'), figures[key]);
+ }
- return str;
+ return string;
};
module.exports = Object.assign(fn, figures);