What does this architecture check print?

from Software architecture
Node 24 beginner 2 min

What does this architecture check print?

JavaScript
const rank = { domain: 0, application: 1, adapter: 2 };
const modules = {
  order: 'domain',
  checkout: 'application',
  postgres: 'adapter',
};
const dependencies = [
  ['checkout', 'order'],
  ['order', 'postgres'],
];
const invalid = dependencies.filter(
  ([from, to]) => rank[modules[from]] < rank[modules[to]],
);

console.log(invalid.map((edge) => edge.join(' -> ')));
Open in playground
Report an error