web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
694 B

  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = extractValueFromMemberExpression;
  6. /**
  7. * Extractor function for a MemberExpression type value node.
  8. * A member expression is accessing a property on an object `obj.property`.
  9. *
  10. * @param - value - AST Value object with type `MemberExpression`
  11. * @returns - The extracted value converted to correct type
  12. * and maintaing `obj.property` convention.
  13. */
  14. function extractValueFromMemberExpression(value) {
  15. // eslint-disable-next-line global-require
  16. var getValue = require('./index.js').default;
  17. return '' + getValue(value.object) + (value.optional ? '?.' : '.') + getValue(value.property);
  18. }