main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
577 bytes
|
Line | |
---|
1 | /**
|
---|
2 | * Extractor function for a AssignmentExpression type value node.
|
---|
3 | * An assignment expression looks like `x = y` or `x += y` in expression position.
|
---|
4 | * This will return the assignment as the value.
|
---|
5 | *
|
---|
6 | * @param - value - AST Value object with type `AssignmentExpression`
|
---|
7 | * @returns - The extracted value converted to correct type.
|
---|
8 | */
|
---|
9 | export default function extractValueFromAssignmentExpression(value) {
|
---|
10 | // eslint-disable-next-line global-require
|
---|
11 | const getValue = require('.').default;
|
---|
12 | return `${getValue(value.left)} ${value.operator} ${getValue(value.right)}`;
|
---|
13 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.