HackMyResume/src/utils/md2chalk.js

22 lines
653 B
JavaScript

/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
/**
Inline Markdown-to-Chalk conversion routines.
@license MIT. See LICENSE.md for details.
@module utils/md2chalk
*/
const MD = require('marked');
const CHALK = require('chalk');
const LO = require('lodash');
module.exports = function( v, style, boldStyle ) {
boldStyle = boldStyle || 'bold';
const temp = v.replace(/\*\*(.*?)\*\*/g, LO.get( CHALK, boldStyle )('$1'));
if (style) { return LO.get( CHALK, style )(temp); } else { return temp; }
};