|
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:
700 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.default = extractValueFromAssignmentExpression;
|
|---|
| 7 | /**
|
|---|
| 8 | * Extractor function for a AssignmentExpression type value node.
|
|---|
| 9 | * An assignment expression looks like `x = y` or `x += y` in expression position.
|
|---|
| 10 | * This will return the assignment as the value.
|
|---|
| 11 | *
|
|---|
| 12 | * @param - value - AST Value object with type `AssignmentExpression`
|
|---|
| 13 | * @returns - The extracted value converted to correct type.
|
|---|
| 14 | */
|
|---|
| 15 | function extractValueFromAssignmentExpression(value) {
|
|---|
| 16 | // eslint-disable-next-line global-require
|
|---|
| 17 | var getValue = require('.').default;
|
|---|
| 18 | return getValue(value.left) + ' ' + value.operator + ' ' + getValue(value.right);
|
|---|
| 19 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.