@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
17 lines (16 loc) • 765 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasImportOfName = void 0;
var hasImportOfName = exports.hasImportOfName = function hasImportOfName(node, name) {
return node.specifiers.some(
// This should not be an `any`. This is an array of `ImportSpecifier |
// ImportDefaultSpecifier`. For some reason, filtering this way still
// results in an error of `specifier.imported` doesn't exist on
// ImportDefaultSpecifier, which is exactly what I'm filtering for
function (specifier) {
var _specifier$imported;
return (specifier === null || specifier === void 0 || (_specifier$imported = specifier.imported) === null || _specifier$imported === void 0 ? void 0 : _specifier$imported.name) === name;
});
};