|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
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.