Sha256: efadd14f04447e1b44ec2f79c6e9de6fc5a9c007bca43a1016ac5c79c9508d33

Contents?: true

Size: 566 Bytes

Versions: 9

Compression:

Stored size: 566 Bytes

Contents

/**
 * Extractor function for a OptionalMemberExpression type value node.
 * A member expression is accessing a property on an object `obj.property`.
 *
 * @param - value - AST Value object with type `OptionalMemberExpression`
 * @returns - The extracted value converted to correct type
 *  and maintaing `obj?.property` convention.
 */
export default function extractValueFromOptionalMemberExpression(value) {
  // eslint-disable-next-line global-require
  const getValue = require('.').default;
  return `${getValue(value.object)}?.${getValue(value.property)}`;
}

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.52 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
immosquare-cleaner-0.1.51 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
immosquare-cleaner-0.1.50 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
immosquare-cleaner-0.1.49 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
immosquare-cleaner-0.1.48 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
immosquare-cleaner-0.1.47 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
immosquare-cleaner-0.1.46 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
immosquare-cleaner-0.1.45 node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js
decidim-0.26.8 packages/eslint-config/node_modules/jsx-ast-utils/src/values/expressions/OptionalMemberExpression.js