- reworked IIFE - avoid Buffer read helpers (see https://github.com/joyent/node/issues/7809) - avoid nested functions in parse - eliminate consecutive nulls in test files (libreoffice) - travis + coveralls support - jscs linting
16 lines
421 B
JavaScript
16 lines
421 B
JavaScript
var fs;
|
|
function readFileSync(filename) {
|
|
if(fs === undefined) fs = require('fs');
|
|
return parse(fs.readFileSync(filename));
|
|
}
|
|
|
|
function readSync(blob, options) {
|
|
switch(options !== undefined && options.type !== undefined ? options.type : "base64") {
|
|
case "file": return readFileSync(blob);
|
|
case "base64": return parse(s2a(Base64.decode(blob)));
|
|
case "binary": return parse(s2a(blob));
|
|
}
|
|
return parse(blob);
|
|
}
|
|
|