@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
7 lines • 391 B
JavaScript
import { isNodeOfType } from 'eslint-codemod-utils';
import { getValue } from './get-value';
export function getValueForPropertyNode(propertyNode, context) {
var propertyValueRaw = isNodeOfType(propertyNode, 'Property') ? getValue(propertyNode.value, context) : null;
var propertyValue = Array.isArray(propertyValueRaw) ? propertyValueRaw[0] : propertyValueRaw;
return propertyValue;
}