@babel/types
Advanced tools
Comparing version 7.0.0-beta.37 to 7.0.0-beta.38
@@ -126,2 +126,3 @@ "use strict"; | ||
exports.assertUnionTypeAnnotation = assertUnionTypeAnnotation; | ||
exports.assertVariance = assertVariance; | ||
exports.assertVoidTypeAnnotation = assertVoidTypeAnnotation; | ||
@@ -1239,2 +1240,10 @@ exports.assertJSXAttribute = assertJSXAttribute; | ||
function assertVariance(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
assert("Variance", node, opts); | ||
} | ||
function assertVoidTypeAnnotation(node, opts) { | ||
@@ -1241,0 +1250,0 @@ if (opts === void 0) { |
@@ -304,5 +304,5 @@ "use strict"; | ||
name: { | ||
validate: function validate(node, key, val) { | ||
validate: (0, _utils.chain)(function (node, key, val) { | ||
if (!(0, _isValidIdentifier.default)(val)) {} | ||
} | ||
}, (0, _utils.assertValueType)("string")) | ||
}, | ||
@@ -309,0 +309,0 @@ optional: { |
@@ -79,3 +79,3 @@ "use strict"; | ||
implements: { | ||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "FlowClassImplements"))), | ||
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), | ||
optional: true | ||
@@ -273,3 +273,3 @@ } | ||
key: { | ||
validate: function () { | ||
validate: (0, _utils.chain)(function () { | ||
var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); | ||
@@ -281,3 +281,3 @@ var computed = (0, _utils.assertNodeType)("Expression"); | ||
}; | ||
}() | ||
}(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression")) | ||
} | ||
@@ -284,0 +284,0 @@ }; |
@@ -362,4 +362,11 @@ "use strict"; | ||
}); | ||
(0, _utils.default)("Variance", { | ||
aliases: ["Flow"], | ||
builder: ["kind"], | ||
fields: { | ||
kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus")) | ||
} | ||
}); | ||
(0, _utils.default)("VoidTypeAnnotation", { | ||
aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] | ||
}); |
@@ -126,2 +126,3 @@ "use strict"; | ||
exports.isUnionTypeAnnotation = isUnionTypeAnnotation; | ||
exports.isVariance = isVariance; | ||
exports.isVoidTypeAnnotation = isVoidTypeAnnotation; | ||
@@ -745,2 +746,6 @@ exports.isJSXAttribute = isJSXAttribute; | ||
function isVariance(node, opts) { | ||
return (0, _is.default)("Variance", node, opts); | ||
} | ||
function isVoidTypeAnnotation(node, opts) { | ||
@@ -747,0 +752,0 @@ return (0, _is.default)("VoidTypeAnnotation", node, opts); |
@@ -7,3 +7,3 @@ "use strict"; | ||
function isCompatTag(tagName) { | ||
return !!tagName && /^[a-z]|-/.test(tagName); | ||
return !!tagName && /^[a-z]/.test(tagName); | ||
} |
{ | ||
"name": "@babel/types", | ||
"version": "7.0.0-beta.37", | ||
"version": "7.0.0-beta.38", | ||
"description": "Babel Types is a Lodash-esque utility library for AST nodes", | ||
@@ -10,2 +10,3 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"dependencies": { | ||
@@ -17,5 +18,5 @@ "esutils": "^2.0.2", | ||
"devDependencies": { | ||
"@babel/generator": "7.0.0-beta.37", | ||
"babylon": "7.0.0-beta.37" | ||
"@babel/generator": "7.0.0-beta.38", | ||
"babylon": "7.0.0-beta.38" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
573020
85
9797
2862