mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-03 20:34:20 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			378 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			378 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { transformJison } from '../.build/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
 | 
						|
        };
 | 
						|
      }
 | 
						|
    },
 | 
						|
  };
 | 
						|
}
 |