|
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:
607 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Extractor function for a OptionalCallExpression type value node.
|
|---|
| 3 | * A member expression is accessing a property on an object `obj.property` and invoking it.
|
|---|
| 4 | *
|
|---|
| 5 | * @param - value - AST Value object with type `OptionalCallExpression`
|
|---|
| 6 | * @returns - The extracted value converted to correct type
|
|---|
| 7 | * and maintaing `obj.property?.()` convention.
|
|---|
| 8 | */
|
|---|
| 9 | export default function extractValueFromOptionalCallExpression(value) {
|
|---|
| 10 | // eslint-disable-next-line global-require
|
|---|
| 11 | const getValue = require('.').default;
|
|---|
| 12 | return `${getValue(value.callee)}?.(${value.arguments.map((x) => getValue(x)).join(', ')})`;
|
|---|
| 13 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.