'use strict'; // Shared so the geometry compiler and the constraint solver report problems in // one shape. The solver must stay free of `fs`, which rules out reaching into // native-road.js for this, and re-declaring the shape there would let the two // drift apart field by field. function diagnostic(severity, subjectId, sourceIds, rule, message, coordinate) { return { id: `diagnostic:${rule}:${subjectId}`, severity, subjectId, sourceIds, rule, message, geometry: coordinate ? { type: 'Point', coordinates: coordinate } : null, }; } module.exports = { diagnostic };