@babel/code-frame
Advanced tools
Comparing version 7.22.5 to 8.0.0-alpha.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20763
Yes
135
1
+ Added@babel/helper-validator-identifier@8.0.0-alpha.12(transitive)
+ Added@babel/highlight@8.0.0-alpha.12(transitive)
+ Addedjs-tokens@8.0.3(transitive)
- Removed@babel/helper-validator-identifier@7.24.7(transitive)
- Removed@babel/highlight@7.24.7(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)