@gouvfr/dsfr-nexus
Version:
Le module `dsfr-nexus` est l'interface de ligne de commande (CLI) centrale du Système de Design de l’État - DSFR. Il offre des outils pour gérer et compiler les ressources du DSFR
30 lines (25 loc) • 627 B
JavaScript
import { MeshItem } from './mesh-item.js';
class MeshInterpreter {
constructor (state, paths) {
this._state = state;
this._paths = paths;
this._items = [];
}
async read () {
if (!this._paths || !Array.isArray(this._paths)) return;
const items = await Promise.all(
this._paths.map(async path => {
const item = new MeshItem(this._state, path);
await item.read();
return item;
})
);
this._items = items.filter(item => item.isValid);
}
get data () {
return {
items: this._items?.map(item => item.data),
}
}
}
export { MeshInterpreter };