Sha256: 82459fc5991da102665f194a3774d8a1d48e0de932979f173884af6320eeb568

Contents?: true

Size: 665 Bytes

Versions: 15

Compression:

Stored size: 665 Bytes

Contents

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = extractValueFromTypeCastExpression;
/**
 * Extractor function for a TypeCastExpression type value node.
 * A type cast expression looks like `(this.handleClick: (event: MouseEvent) => void))`
 * This will return the expression `this.handleClick`.
 *
 * @param - value - AST Value object with type `TypeCastExpression`
 * @returns - The extracted value converted to correct type.
 */
function extractValueFromTypeCastExpression(value) {
  // eslint-disable-next-line global-require
  var getValue = require('./index.js').default;
  return getValue(value.expression);
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.21.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.20.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.19.1 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.19.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.18.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.17.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.16.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.15.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.14.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.13.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.12.2 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.12.1 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.12.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
govuk_publishing_components-17.11.0 node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js