Socket
Socket
Sign inDemoInstall

@babel/code-frame

Package Overview
Dependencies
Maintainers
4
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/code-frame - npm Package Compare versions

Comparing version 7.22.5 to 8.0.0-alpha.0

17

lib/index.js

@@ -1,9 +0,3 @@

"use strict";
import highlight, { shouldHighlight, getChalk } from '@babel/highlight';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.codeFrameColumns = codeFrameColumns;
exports.default = _default;
var _highlight = require("@babel/highlight");
let deprecationWarningShown = false;

@@ -75,4 +69,4 @@ function getDefs(chalk) {

function codeFrameColumns(rawLines, loc, opts = {}) {
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
const chalk = (0, _highlight.getChalk)(opts);
const highlighted = (opts.highlightCode || opts.forceColor) && shouldHighlight(opts);
const chalk = getChalk(opts);
const defs = getDefs(chalk);

@@ -90,3 +84,3 @@ const maybeHighlight = (chalkFn, string) => {

const numberMaxWidth = String(end).length;
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {

@@ -122,3 +116,3 @@ const number = start + 1 + index;

}
function _default(rawLines, lineNumber, colNumber, opts = {}) {
function index (rawLines, lineNumber, colNumber, opts = {}) {
if (!deprecationWarningShown) {

@@ -145,2 +139,3 @@ deprecationWarningShown = true;

export { codeFrameColumns, index as default };
//# sourceMappingURL=index.js.map
{
"name": "@babel/code-frame",
"version": "7.22.5",
"version": "8.0.0-alpha.0",
"description": "Generate errors that contain a code frame that point to source locations.",

@@ -19,3 +19,3 @@ "author": "The Babel Team (https://babel.dev/team)",

"dependencies": {
"@babel/highlight": "^7.22.5"
"@babel/highlight": "^8.0.0-alpha.0"
},

@@ -26,5 +26,9 @@ "devDependencies": {

"engines": {
"node": ">=6.9.0"
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
},
"type": "commonjs"
"exports": {
".": "./lib/index.js",
"./package.json": "./package.json"
},
"type": "module"
}

@@ -5,3 +5,3 @@ # @babel/code-frame

See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information.
See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information.

@@ -8,0 +8,0 @@ ## Install

Sorry, the diff of this file is not supported yet

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