@babel/types
Advanced tools
Comparing version 7.18.9 to 7.18.10
@@ -14,2 +14,4 @@ "use strict"; | ||
var _helperStringParser = require("@babel/helper-string-parser"); | ||
var _constants = require("../constants"); | ||
@@ -1390,3 +1392,3 @@ | ||
value: { | ||
validate: (0, _utils.assertShape)({ | ||
validate: (0, _utils.chain)((0, _utils.assertShape)({ | ||
raw: { | ||
@@ -1399,2 +1401,35 @@ validate: (0, _utils.assertValueType)("string") | ||
} | ||
}), function templateElementCookedValidator(node) { | ||
const raw = node.value.raw; | ||
let str, | ||
containsInvalid, | ||
unterminatedCalled = false; | ||
try { | ||
const error = () => { | ||
throw new Error(); | ||
}; | ||
({ | ||
str, | ||
containsInvalid | ||
} = (0, _helperStringParser.readStringContents)("template", raw, 0, 0, 0, { | ||
unterminated() { | ||
unterminatedCalled = true; | ||
}, | ||
strictNumericEscape: error, | ||
invalidEscapeSequence: error, | ||
numericSeparatorInEscapeSequence: error, | ||
unexpectedNumericSeparator: error, | ||
invalidDigit: error, | ||
invalidCodePoint: error | ||
})); | ||
} catch (_unused) { | ||
unterminatedCalled = true; | ||
containsInvalid = true; | ||
} | ||
if (!unterminatedCalled) throw new Error("Invalid raw"); | ||
node.value.cooked = containsInvalid ? null : str; | ||
}) | ||
@@ -1401,0 +1436,0 @@ }, |
{ | ||
"name": "@babel/types", | ||
"version": "7.18.9", | ||
"version": "7.18.10", | ||
"description": "Babel Types is a Lodash-esque utility library for AST nodes", | ||
@@ -27,2 +27,3 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"dependencies": { | ||
"@babel/helper-string-parser": "^7.18.10", | ||
"@babel/helper-validator-identifier": "^7.18.6", | ||
@@ -32,6 +33,6 @@ "to-fast-properties": "^2.0.0" | ||
"devDependencies": { | ||
"@babel/generator": "^7.18.9", | ||
"@babel/parser": "^7.18.9", | ||
"@babel/generator": "^7.18.10", | ||
"@babel/parser": "^7.18.10", | ||
"chalk": "^4.1.0", | ||
"glob": "^7.1.7" | ||
"glob": "^7.2.0" | ||
}, | ||
@@ -38,0 +39,0 @@ "engines": { |
@@ -11,3 +11,6 @@ export default function stringifyValidator(validator, nodePrefix) { | ||
if (validator.chainOf) { | ||
return stringifyValidator(validator.chainOf[1], nodePrefix); | ||
const ret = stringifyValidator(validator.chainOf[1], nodePrefix); | ||
return Array.isArray(ret) && ret.length === 1 && ret[0] === "any" | ||
? stringifyValidator(validator.chainOf[0], nodePrefix) | ||
: ret; | ||
} | ||
@@ -14,0 +17,0 @@ |
Sorry, the diff of this file is too big to display
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
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
1169362
21577
3
+ Added@babel/helper-string-parser@7.25.9(transitive)