UNPKG

@openactive/data-models

Version:

Data models used to drive that OpenActive validator, developer documentation, and model libraries

13 lines (10 loc) 354 B
const graphs = require('./dist/graphs'); const deriveVersion = require('./helpers/deriveVersion'); const getGraph = (version) => { const specVersion = deriveVersion(version); if (typeof graphs[specVersion] === 'undefined') { throw Error('Invalid specification version supplied'); } return graphs[specVersion]; }; module.exports = getGraph;