abstract-file
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -148,3 +148,3 @@ (function() { | ||
AbstractFile.prototype.load = function(aOptions, done) { | ||
var checkValid, e, loaded; | ||
var checkValid, err, loaded; | ||
if (isFunction(aOptions)) { | ||
@@ -191,8 +191,10 @@ done = aOptions; | ||
} catch (_error) { | ||
e = _error; | ||
done(e); | ||
return this; | ||
err = _error; | ||
} | ||
} | ||
this.loadContent(aOptions, done); | ||
if (err) { | ||
done(err); | ||
} else { | ||
this.loadContent(aOptions, done); | ||
} | ||
} else { | ||
@@ -427,3 +429,3 @@ done(null, this.contents); | ||
return this.loadContent(aOptions, function(err, result) { | ||
if (aOptions.skipSize && isFunction(result.slice)) { | ||
if (result && aOptions.skipSize && isFunction(result.slice)) { | ||
result = result.slice(aOptions.skipSize); | ||
@@ -430,0 +432,0 @@ } |
{ | ||
"name": "abstract-file", | ||
"description": "It can be used on any virtual file system, and stream supports.", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"homepage": "https://github.com/snowyu/abstract-file.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -136,3 +136,3 @@ ## abstract-file [![npm](https://img.shields.io/npm/v/abstract-file.svg)](https://npmjs.org/package/abstract-file) | ||
+ add `extName` readonly property | ||
+ add `relaceExt` method to get the replaced extname's path string. | ||
+ add `replaceExt` method to get the replaced extname's path string. | ||
@@ -139,0 +139,0 @@ ## License |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
93003
600