mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
13 lines
374 B
JavaScript
13 lines
374 B
JavaScript
|
const { Generator } = require('jison');
|
||
|
const { validate } = require('schema-utils');
|
||
|
const schema = require('./parser-options-schema.json');
|
||
|
|
||
|
module.exports = function jisonLoader(source) {
|
||
|
const options = this.getOptions();
|
||
|
validate(schema, options, {
|
||
|
name: 'Jison Loader',
|
||
|
baseDataPath: 'options',
|
||
|
});
|
||
|
return new Generator(source, options).generate();
|
||
|
};
|