You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
395 B

'use strict';
module.exports = function (filepath, options) {
options = options || {raw: false};
var file = this.store.get(filepath);
if (file.state === 'deleted' || file.contents === null) {
if ('defaults' in options) {
return options.defaults;
}
throw new Error(filepath + ' doesn\'t exist');
}
return options.raw ? file.contents : file.contents.toString();
};