@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
15 lines (14 loc) • 414 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getStaticAttributeValue = getStaticAttributeValue;
/**
* Returns the static string value of a JSXAttribute, or undefined if dynamic.
*/
function getStaticAttributeValue(attr) {
if (attr.value && attr.value.type === 'Literal' && typeof attr.value.value === 'string') {
return attr.value.value;
}
return undefined;
}