You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@babel/code-frame

Package Overview
Dependencies
Maintainers
4
Versions
95
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
8.0.0-rc.1
to
8.0.0-rc.2
+1
-19
lib/browser.js
import { _ as _codeFrameColumns } from './common-BO7XIBW3.js';
let deprecationWarningShown = false;
function codeFrameColumns(rawLines, loc, opts = {}) {
return _codeFrameColumns(rawLines, loc, opts);
}
function browser (rawLines, lineNumber, colNumber, opts = {}) {
if (!deprecationWarningShown) {
deprecationWarningShown = true;
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
const deprecationError = new Error(message);
deprecationError.name = "DeprecationWarning";
console.warn(new Error(message));
}
colNumber = Math.max(colNumber, 0);
const location = {
start: {
column: colNumber,
line: lineNumber
}
};
return codeFrameColumns(rawLines, location, opts);
}
function highlight(code) {

@@ -28,3 +10,3 @@ return code;

export { codeFrameColumns, browser as default, highlight };
export { codeFrameColumns, highlight };
//# sourceMappingURL=browser.js.map

@@ -35,7 +35,3 @@ type Location = {

declare function codeFrameColumns(rawLines: string, loc: NodeLocation, opts?: Options): string;
/**
* Create a code frame, adding line numbers, code highlighting, and pointing to a given position.
*/
declare function export_default(rawLines: string, lineNumber: number, colNumber?: number | null, opts?: Options): string;
export { type Options, codeFrameColumns, export_default as default, highlight };
export { type Options, codeFrameColumns, highlight };

@@ -144,3 +144,2 @@ import { _ as _codeFrameColumns } from './common-BO7XIBW3.js';

let deprecationWarningShown = false;
function codeFrameColumns(rawLines, loc, opts = {}) {

@@ -153,25 +152,4 @@ const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;

}
function index (rawLines, lineNumber, colNumber, opts = {}) {
if (!deprecationWarningShown) {
deprecationWarningShown = true;
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
if (process.emitWarning) {
process.emitWarning(message, "DeprecationWarning");
} else {
const deprecationError = new Error(message);
deprecationError.name = "DeprecationWarning";
console.warn(new Error(message));
}
}
colNumber = Math.max(colNumber, 0);
const location = {
start: {
column: colNumber,
line: lineNumber
}
};
return codeFrameColumns(rawLines, location, opts);
}
export { codeFrameColumns, index as default, highlight };
export { codeFrameColumns, highlight };
//# sourceMappingURL=index.js.map
+2
-2
{
"name": "@babel/code-frame",
"version": "8.0.0-rc.1",
"version": "8.0.0-rc.2",
"description": "Generate errors that contain a code frame that point to source locations.",

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

"dependencies": {
"@babel/helper-validator-identifier": "^8.0.0-rc.1",
"@babel/helper-validator-identifier": "^8.0.0-rc.2",
"js-tokens": "^10.0.0"

@@ -23,0 +23,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet