Skip to content

Commit

Permalink
Use colors-option
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Feb 28, 2021
1 parent 61a917e commit 8383be4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 44 deletions.
27 changes: 26 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"abstract-parser": "^0.2.0",
"chalk": "^4.1.0",
"colors-option": "^1.0.0",
"core-js": "^3.8.1",
"filter-obj": "^2.0.1",
"is-plain-obj": "^3.0.0",
Expand Down
38 changes: 0 additions & 38 deletions src/print/colors.js

This file was deleted.

5 changes: 3 additions & 2 deletions src/print/main.js
@@ -1,6 +1,7 @@
import colorsOption from 'colors-option'

import { parse } from '../parse/main.js'

import { getChalk } from './colors.js'
import { serializeNode } from './node.js'
import { getOpts } from './options.js'

Expand All @@ -24,7 +25,7 @@ export const print = function (code, opts) {
// Serialize AST nodes so they can be printed on the console
export const serialize = function (results, { colors }) {
const showHeader = results.length !== 1
const chalk = getChalk(colors)
const chalk = colorsOption({ colors })

const output = results
.map((result) => serializeResult(result, { showHeader, chalk }))
Expand Down
4 changes: 2 additions & 2 deletions src/repl/prompt.js
@@ -1,8 +1,8 @@
import { getChalk } from '../print/colors.js'
import colorsOption from 'colors-option'

// REPL prompt
export const getPrompt = function ({ colors }) {
const chalk = getChalk(colors)
const chalk = colorsOption({ colors })
return chalk.yellow.bold(PROMPT)
}

Expand Down

0 comments on commit 8383be4

Please sign in to comment.