mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 08:19:43 +02:00
Remove 'fs' as dependency
This commit is contained in:
@@ -84,16 +84,16 @@ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* actio
|
||||
var $0 = $$.length - 1;
|
||||
switch (yystate) {
|
||||
case 1:
|
||||
return $$[$0-1];
|
||||
return $$[$0-1];
|
||||
break;
|
||||
case 2:
|
||||
this.$ = []
|
||||
this.$ = []
|
||||
break;
|
||||
case 3:
|
||||
$$[$0-1].push($$[$0]);this.$ = $$[$0-1]
|
||||
break;
|
||||
case 4: case 5:
|
||||
this.$ = $$[$0]
|
||||
this.$ = $$[$0]
|
||||
break;
|
||||
case 6: case 7:
|
||||
this.$=[];
|
||||
@@ -647,14 +647,14 @@ exports.parser = parser;
|
||||
exports.Parser = parser.Parser;
|
||||
exports.parse = function () { return parser.parse.apply(parser, arguments); };
|
||||
exports.main = function commonjsMain(args) {
|
||||
if (!args[1]) {
|
||||
console.log('Usage: '+args[0]+' FILE');
|
||||
process.exit(1);
|
||||
}
|
||||
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
return exports.parser.parse(source);
|
||||
// if (!args[1]) {
|
||||
// console.log('Usage: '+args[0]+' FILE');
|
||||
// process.exit(1);
|
||||
// }
|
||||
// var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||
// return exports.parser.parse(source);
|
||||
};
|
||||
if (typeof module !== 'undefined' && require.main === module) {
|
||||
exports.main(process.argv.slice(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user