mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
18 lines
370 B
TypeScript
18 lines
370 B
TypeScript
import { transformJison } from './jisonTransformer.js';
|
|
const fileRegex = /\.(jison)$/;
|
|
|
|
export default function jison() {
|
|
return {
|
|
name: 'jison',
|
|
|
|
transform(src: string, id: string) {
|
|
if (fileRegex.test(id)) {
|
|
return {
|
|
code: transformJison(src),
|
|
map: null, // provide source map if available
|
|
};
|
|
}
|
|
},
|
|
};
|
|
}
|