Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.main = function commonjsMain(args) {
if (!args[1]) throw new Error('Usage: ' + args[0] + ' FILE');
if (typeof process !== 'undefined') {
var source = require('fs').readFileSync(
require('path').join(process.cwd(), args[1]),
'utf8',
);
} else {
var cwd = require('file').path(require('file').cwd());
var source = cwd.join(args[1]).read({charset: 'utf-8'});
}
return exports.parser.parse(source);
};
exports.main = function commonjsMain(args) {
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
if (typeof process !== 'undefined') {
var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
} else {
var cwd = require("file").path(require("file").cwd());
var source = cwd.join(args[1]).read({charset: "utf-8"});
}
return exports.parser.parse(source);
}
if (typeof module !== 'undefined' && require.main === module) {
exports.main = function commonjsMain(args) {
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
if (typeof process !== 'undefined') {
var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
} else {
var cwd = require("file").path(require("file").cwd());
var source = cwd.join(args[1]).read({charset: "utf-8"});
}
return exports.parser.parse(source);
}
if (typeof module !== 'undefined' && require.main === module) {
exports.main = function commonjsMain(args) {
if (!args[1])
throw new Error('Usage: '+args[0]+' FILE');
if (typeof process !== 'undefined') {
var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
} else {
var cwd = require("file").path(require("file").cwd());
var source = cwd.join(args[1]).read({charset: "utf-8"});
}
return exports.parser.parse(source);
}
if (typeof module !== 'undefined' && require.main === module) {
exports.main = function commonjsMain(args) {
if (!args[1])
throw new Error('Usage: ' + args[0] + ' FILE');
var source, cwd;
if (typeof process !== 'undefined') {
source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
} else {
source = require("file").path(require("file").cwd()).join(args[1]).read({
charset: "utf-8"
});
}
return exports.parser.parse(source);
}
if (typeof module !== 'undefined' && require.main === module) {