abstract-file
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -118,2 +118,11 @@ (function() { | ||
AbstractFile.prototype.getOptions = function(aOptions) { | ||
var result; | ||
result = this.mergeTo(aOptions); | ||
result.path = this.path; | ||
result.base = this.base; | ||
result.cwd = this.cwd; | ||
return result; | ||
}; | ||
AbstractFile.prototype.load = function(aOptions, done) { | ||
@@ -125,3 +134,3 @@ var checkValid, e; | ||
} | ||
aOptions = this.mergeTo(aOptions); | ||
aOptions = this.getOptions(aOptions); | ||
checkValid = aOptions.validate !== false; | ||
@@ -173,3 +182,3 @@ if (this.stat == null) { | ||
if (isFunction(this._loadStatSync)) { | ||
aOptions = this.mergeTo(aOptions); | ||
aOptions = this.getOptions(aOptions); | ||
checkValid = aOptions.validate !== false; | ||
@@ -241,3 +250,3 @@ if (this.stat == null) { | ||
} | ||
aOptions = this.mergeTo(aOptions); | ||
aOptions = this.getOptions(aOptions); | ||
_loadStat(aOptions, done); | ||
@@ -249,3 +258,3 @@ return this; | ||
var result; | ||
aOptions = this.mergeTo(aOptions); | ||
aOptions = this.getOptions(aOptions); | ||
if (this._loadStatSync) { | ||
@@ -264,3 +273,3 @@ result = this._loadStatSync(aOptions); | ||
} | ||
aOptions = this.mergeTo(aOptions); | ||
aOptions = this.getOptions(aOptions); | ||
this._loadContent(aOptions, (function(_this) { | ||
@@ -280,3 +289,3 @@ return function(err, result) { | ||
if (isFunction(this._loadContentSync)) { | ||
aOptions = this.mergeTo(aOptions); | ||
aOptions = this.getOptions(aOptions); | ||
this.contents = result = this._loadContentSync(aOptions); | ||
@@ -299,3 +308,3 @@ } else { | ||
} | ||
aOptions = this.mergeTo(aOptions); | ||
aOptions = this.getOptions(aOptions); | ||
result = this._validate(aOptions); | ||
@@ -309,3 +318,3 @@ if (raiseError && !result) { | ||
AbstractFile.prototype.isValid = function(aOptions) { | ||
return this.Validate(aOptions, false); | ||
return this.validate(aOptions, false); | ||
}; | ||
@@ -312,0 +321,0 @@ |
{ | ||
"name": "abstract-file", | ||
"description": "It can be used on any virtual file system, and stream supports.", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"homepage": "https://github.com/snowyu/abstract-file.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51474
443