UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

14 lines 429 B
import { isImportFromPackage } from './is-import-from-package'; export const getAffectedPackageConfig = (source, affectedPackages) => { if (typeof source !== 'string') { return null; } const packageName = Object.keys(affectedPackages).find(candidate => isImportFromPackage(source, candidate)); if (!packageName) { return null; } return { packageName, importNames: affectedPackages[packageName] }; };