@hegel/core
Advanced tools
Comparing version 0.0.25 to 0.0.26
{ | ||
"name": "@hegel/core", | ||
"author": "Artem Kobzar", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
@@ -260,3 +260,3 @@ "use strict"; | ||
// $FlowIssue | ||
type = "readonly" in type ? type.readonly : type; | ||
type = type !== undefined && "readonly" in type ? type.readonly : type; | ||
return !(type instanceof _unionType.UnionType) || !type.variants.some(t => t.equalsTo(_type.Type.Undefined)); | ||
@@ -263,0 +263,0 @@ }); |
@@ -40,2 +40,11 @@ "use strict"; | ||
function sortClassMembers(currentNode) { | ||
if (currentNode.type !== _nodes2.default.CLASS_DECLARATION || currentNode.type !== _nodes2.default.CLASS_EXPRESSION) { | ||
return currentNode; | ||
} | ||
currentNode.body.body.sort((a, b) => a.kind === "constructor" ? -1 : 1); | ||
return currentNode; | ||
} | ||
function mixBlockToLogicalOperator(currentNode) { | ||
@@ -243,3 +252,3 @@ if (currentNode.type !== _nodes2.default.LOGICAL_EXPRESSION || currentNode.operator !== "&&" && currentNode.operator !== "||" || currentNode.left.type === _nodes2.default.BLOCK_STATEMENT) { | ||
const getCurrentNode = compose(mixDeclarationsInideForBlock, mixBodyToArrowFunctionExpression, mixTryCatchInfo, mixBlockForStatements, mixExportInfo, mixBlockToLogicalOperator, mixElseIfReturnOrThrowExisted, mixBlockToConditionalExpression, mixBlockToCaseStatement, mixParentToClassObjectAndFunction); | ||
const getCurrentNode = compose(mixDeclarationsInideForBlock, mixBodyToArrowFunctionExpression, mixTryCatchInfo, mixBlockForStatements, mixExportInfo, mixBlockToLogicalOperator, mixElseIfReturnOrThrowExisted, mixBlockToConditionalExpression, mixBlockToCaseStatement, mixParentToClassObjectAndFunction, sortClassMembers); | ||
@@ -246,0 +255,0 @@ function traverseTree(node, pre, middle, post, parentNode = null, meta = {}) { |
@@ -134,4 +134,7 @@ "use strict"; | ||
case _nodes2.default.ANY_TYPE_ANNOTATION: | ||
throw new _errors2.default('There is no "any" type in Hegel.', typeNode.typeAnnotation.loc); | ||
throw new _errors2.default('There is no "any" type in Hegel. Use "unknown" instead.', typeNode.typeAnnotation.loc); | ||
case _nodes2.default.VOID_TYPE_ANNOTATION: | ||
throw new _errors2.default('There is no "void" type in Hegel. Use "undefined" instead.', typeNode.typeAnnotation.loc); | ||
case _nodes2.default.TYPEOF_TYPE_ANNOTATION: | ||
@@ -138,0 +141,0 @@ throw new _errors2.default("typeof for types does not exist in Hegel. Use magic type $TypeOf instead.", typeNode.typeAnnotation.loc); |
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
388568
8296