| | |
| | | Object.defineProperty(exports, "__esModule", { |
| | | value: true |
| | | }); |
| | | exports.shouldHighlight = shouldHighlight; |
| | | exports.getChalk = getChalk; |
| | | exports.default = highlight; |
| | | exports.getChalk = getChalk; |
| | | exports.shouldHighlight = shouldHighlight; |
| | | |
| | | var _jsTokens = require("js-tokens"); |
| | | |
| | |
| | | return "keyword"; |
| | | } |
| | | |
| | | if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) { |
| | | if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == "</")) { |
| | | return "jsxIdentifier"; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | function highlight(code, options = {}) { |
| | | if (shouldHighlight(options)) { |
| | | if (code !== "" && shouldHighlight(options)) { |
| | | const chalk = getChalk(options); |
| | | const defs = getDefs(chalk); |
| | | return highlightTokens(defs, code); |