-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #42
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Extractor function for a AssignmentExpression type value node. | ||
* An assignment expression looks like `x = y` or `x += y` in expression position. | ||
* This will return the assignment as the value. | ||
* | ||
* @param - value - AST Value object with type `AssignmentExpression` | ||
* @returns - The extracted value converted to correct type. | ||
*/ | ||
export default function extractValueFromAssignmentExpression(value) { | ||
// eslint-disable-next-line global-require | ||
const getValue = require('./index.js').default; | ||
return `${getValue(value.left)} ${value.operator} ${getValue(value.right)}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters