Socket
Socket
Sign inDemoInstall

@babel/highlight

Package Overview
Dependencies
Maintainers
6
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/highlight - npm Package Compare versions

Comparing version 7.13.8 to 7.13.10

23

lib/index.js

@@ -10,14 +10,8 @@ "use strict";

var jsTokensNs = _interopRequireWildcard(require("js-tokens"));
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
var _chalk = _interopRequireDefault(require("chalk"));
const jsTokens = require("js-tokens");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const Chalk = require("chalk");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);

@@ -43,5 +37,2 @@

{
const {
matchToToken
} = jsTokensNs;
const JSX_TAG = /^[a-z][\w-]*$/i;

@@ -78,4 +69,4 @@

while (match = jsTokensNs.default.exec(text)) {
const token = matchToToken(match);
while (match = jsTokens.default.exec(text)) {
const token = jsTokens.matchToToken(match);
yield {

@@ -109,10 +100,10 @@ type: getTokenType(token, match.index, text),

function shouldHighlight(options) {
return !!_chalk.default.supportsColor || options.forceColor;
return !!Chalk.supportsColor || options.forceColor;
}
function getChalk(options) {
return options.forceColor ? new _chalk.default.constructor({
return options.forceColor ? new Chalk.constructor({
enabled: true,
level: 1
}) : _chalk.default;
}) : Chalk;
}

@@ -119,0 +110,0 @@

{
"name": "@babel/highlight",
"version": "7.13.8",
"version": "7.13.10",
"description": "Syntax highlight JavaScript strings for output in terminals.",

@@ -5,0 +5,0 @@ "author": "suchipi <me@suchipi.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc