@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
18 lines (17 loc) • 545 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getImportedNodeBySource = void 0;
/**
* @param {SourceCode} source The eslint source
* @param {string} path The path specified to find
* @returns {ImportDeclaration}
*/
var getImportedNodeBySource = exports.getImportedNodeBySource = function getImportedNodeBySource(source, path) {
return source.ast.body.filter(function (node) {
return node.type === 'ImportDeclaration';
}).find(function (node) {
return node.source.value === path;
});
};