babel-plugin-const-enum
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -39,3 +39,3 @@ "use strict"; | ||
value = constEnum[tsEnumMember.initializer.name]; | ||
validateConstEnumMemberAccess(value); | ||
validateConstEnumMemberAccess(tsEnumMemberPath, value); | ||
} else if (isNumericUnaryExpression(tsEnumMember.initializer) || isNumericBinaryExpression(tsEnumMember.initializer)) { | ||
@@ -82,3 +82,3 @@ if (isStringEnum) { | ||
const validateConstEnumMemberAccess = value => { | ||
const validateConstEnumMemberAccess = (path, value) => { | ||
if (value === undefined) { | ||
@@ -94,3 +94,3 @@ throw path.buildCodeFrameError('Enum initializer identifier must reference a previously defined enum member.'); | ||
const value = constEnum[path.node.name]; | ||
validateConstEnumMemberAccess(value); | ||
validateConstEnumMemberAccess(path, value); | ||
path.replaceWith(_core.types.numericLiteral(value)); | ||
@@ -97,0 +97,0 @@ path.skip(); |
{ | ||
"name": "babel-plugin-const-enum", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Transform TypeScript `const` enums", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/dosentmatter/babel-plugin-const-enum", |
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
8663