diff options
Diffstat (limited to 'lib/Yaml.js')
-rw-r--r-- | lib/Yaml.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Yaml.js b/lib/Yaml.js index 8ab695f..67bd634 100644 --- a/lib/Yaml.js +++ b/lib/Yaml.js @@ -34,10 +34,12 @@ Yaml = (function() { if (callback != null) { return Utils.getStringFromFile(path, (function(_this) { return function(input) { + var result; + result = null; if (input != null) { - return _this.parse(input, exceptionOnInvalidType, objectDecoder); + result = _this.parse(input, exceptionOnInvalidType, objectDecoder); } - return null; + callback(result); }; })(this)); } else { @@ -79,11 +81,11 @@ Yaml = (function() { } }; - Yaml.prototype.stringify = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { + Yaml.stringify = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { return this.dump(input, inline, indent, exceptionOnInvalidType, objectEncoder); }; - Yaml.prototype.load = function(path, callback, exceptionOnInvalidType, objectDecoder) { + Yaml.load = function(path, callback, exceptionOnInvalidType, objectDecoder) { return this.parseFile(path, callback, exceptionOnInvalidType, objectDecoder); }; |