Debian Codegraph @

util/build/fs.js

raw symbols SCIP
1 define(["dojo/has!host-node?./node/fs:./rhino/fs"], function(result){
2 // Code to strip BOM
3 var origReadFileSync = result.readFileSync;
4 result.readFileSync = function(filename, encoding) {
5 var text = origReadFileSync(filename, encoding);
6 if(encoding == "utf8"){
7 text = text.replace(/^\uFEFF/, ''); // remove BOM
8 }
9 return text;
10 };
11
12 var origReadFile = result.readFile;
13 result.readFile = function(filename, encoding, cb){
14 origReadFile(filename, encoding, function(err, text){
15 if(text && encoding == "utf8"){
16 text = text.replace(/^\uFEFF/, ''); // remove BOM
17 }
18 cb(err, text);
19 });
20 };
21
22 return result;
23 });