kopia lustrzana https://github.com/c9/core
15 wiersze
322 B
JavaScript
15 wiersze
322 B
JavaScript
![]() |
var fs = require("fs");
|
||
|
fs.$readFileSync = fs.readFileSync;
|
||
|
|
||
|
fs.readFileSync = function(file, options) {
|
||
|
if (!file.match(/\.js*$/))
|
||
|
file += ".js";
|
||
|
try {
|
||
|
return this.$readFileSync(file, options);
|
||
|
}
|
||
|
catch (e) {
|
||
|
if (e.code === "ENOENT")
|
||
|
return "";
|
||
|
throw e;
|
||
|
}
|
||
|
};
|