eslint-plugin-conarti-fsd
Version:
Feature-sliced design methodology plugin
29 lines (24 loc) • 443 B
JavaScript
const { layers } = require('../../config');
/**
* Checks if layer is known
* @param layer {string}
* @returns {boolean}
*/
function isLayer(layer) {
return layers.includes(layer);
}
/**
* Returns layer fsd weight
* @param layer {string}
* @returns {null|number}
*/
function getLayerWeight(layer) {
if (!isLayer(layer)) {
return null;
}
return layers.indexOf(layer);
}
module.exports = {
getLayerWeight,
isLayer,
};