Object.defineProperty(exports, "__esModule", {
value: true
});
-exports.shouldHighlight = shouldHighlight;
-exports.getChalk = getChalk;
exports.default = highlight;
+exports.getChalk = getChalk;
+exports.shouldHighlight = shouldHighlight;
-var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
+var _jsTokens = require("js-tokens");
-const jsTokens = require("js-tokens");
+var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
-const Chalk = require("chalk");
+var _chalk = require("chalk");
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
tokenize = function* (text) {
let match;
- while (match = jsTokens.default.exec(text)) {
- const token = jsTokens.matchToToken(match);
+ while (match = _jsTokens.default.exec(text)) {
+ const token = _jsTokens.matchToToken(match);
+
yield {
type: getTokenType(token, match.index, text),
value: token.value
}
function shouldHighlight(options) {
- return !!Chalk.supportsColor || options.forceColor;
+ return !!_chalk.supportsColor || options.forceColor;
}
function getChalk(options) {
- return options.forceColor ? new Chalk.constructor({
+ return options.forceColor ? new _chalk.constructor({
enabled: true,
level: 1
- }) : Chalk;
+ }) : _chalk;
}
function highlight(code, options = {}) {