@babel/types
Advanced tools
Comparing version
@@ -253,2 +253,3 @@ "use strict"; | ||
exports.assertTSRestType = assertTSRestType; | ||
exports.assertTSSatisfiesExpression = assertTSSatisfiesExpression; | ||
exports.assertTSStringKeyword = assertTSStringKeyword; | ||
@@ -1249,2 +1250,6 @@ exports.assertTSSymbolKeyword = assertTSSymbolKeyword; | ||
function assertTSSatisfiesExpression(node, opts) { | ||
assert("TSSatisfiesExpression", node, opts); | ||
} | ||
function assertTSTypeAssertion(node, opts) { | ||
@@ -1251,0 +1256,0 @@ assert("TSTypeAssertion", node, opts); |
@@ -219,2 +219,3 @@ "use strict"; | ||
exports.tSRestType = exports.tsRestType = tsRestType; | ||
exports.tSSatisfiesExpression = exports.tsSatisfiesExpression = tsSatisfiesExpression; | ||
exports.tSStringKeyword = exports.tsStringKeyword = tsStringKeyword; | ||
@@ -2095,2 +2096,10 @@ exports.tSSymbolKeyword = exports.tsSymbolKeyword = tsSymbolKeyword; | ||
function tsSatisfiesExpression(expression, typeAnnotation) { | ||
return (0, _validateNode.default)({ | ||
type: "TSSatisfiesExpression", | ||
expression, | ||
typeAnnotation | ||
}); | ||
} | ||
function tsTypeAssertion(typeAnnotation, expression) { | ||
@@ -2097,0 +2106,0 @@ return (0, _validateNode.default)({ |
@@ -1236,2 +1236,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "TSSatisfiesExpression", { | ||
enumerable: true, | ||
get: function () { | ||
return _index.tsSatisfiesExpression; | ||
} | ||
}); | ||
Object.defineProperty(exports, "TSStringKeyword", { | ||
@@ -1238,0 +1244,0 @@ enumerable: true, |
@@ -48,3 +48,3 @@ "use strict"; | ||
left: { | ||
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
}, | ||
@@ -253,3 +253,3 @@ right: { | ||
left: { | ||
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
}, | ||
@@ -685,3 +685,3 @@ right: { | ||
validate: function () { | ||
const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern", "TSAsExpression", "TSNonNullExpression", "TSTypeAssertion"); | ||
const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern", "TSAsExpression", "TSSatisfiesExpression", "TSNonNullExpression", "TSTypeAssertion"); | ||
const expression = (0, _utils.assertNodeType)("Expression"); | ||
@@ -702,3 +702,3 @@ return function (parent, key, node) { | ||
argument: { | ||
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression", "TSAsExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
}, | ||
@@ -854,3 +854,3 @@ optional: { | ||
kind: { | ||
validate: (0, _utils.assertOneOf)("var", "let", "const") | ||
validate: (0, _utils.assertOneOf)("var", "let", "const", "using") | ||
}, | ||
@@ -931,3 +931,3 @@ declarations: { | ||
left: { | ||
validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression", "TSAsExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") | ||
}, | ||
@@ -1175,3 +1175,3 @@ right: { | ||
const declaration = (0, _utils.assertNodeType)("VariableDeclaration"); | ||
const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSTypeAssertion", "TSNonNullExpression"); | ||
const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression"); | ||
return function (node, key, val) { | ||
@@ -1205,2 +1205,6 @@ if ((0, _is.default)("VariableDeclaration", val)) { | ||
}, | ||
module: { | ||
optional: true, | ||
validate: (0, _utils.assertValueType)("boolean") | ||
}, | ||
specifiers: { | ||
@@ -1207,0 +1211,0 @@ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) |
@@ -347,3 +347,3 @@ "use strict"; | ||
}); | ||
defineType("TSAsExpression", { | ||
const TSTypeExpression = { | ||
aliases: ["Expression", "LVal", "PatternLike"], | ||
@@ -355,3 +355,5 @@ visitor: ["expression", "typeAnnotation"], | ||
} | ||
}); | ||
}; | ||
defineType("TSAsExpression", TSTypeExpression); | ||
defineType("TSSatisfiesExpression", TSTypeExpression); | ||
defineType("TSTypeAssertion", { | ||
@@ -358,0 +360,0 @@ aliases: ["Expression", "LVal", "PatternLike"], |
{ | ||
"name": "@babel/types", | ||
"version": "7.19.4", | ||
"version": "7.20.0", | ||
"description": "Babel Types is a Lodash-esque utility library for AST nodes", | ||
@@ -32,4 +32,4 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"devDependencies": { | ||
"@babel/generator": "^7.19.4", | ||
"@babel/parser": "^7.19.4", | ||
"@babel/generator": "^7.20.0", | ||
"@babel/parser": "^7.20.0", | ||
"chalk": "^4.1.0", | ||
@@ -36,0 +36,0 @@ "glob": "^7.2.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
34
-2.86%2454321
-1.71%167
-7.22%21372
-5.73%