diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils.coffee | 2 | ||||
-rw-r--r-- | src/Yaml.coffee | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/Utils.coffee b/src/Utils.coffee index bc18405..a78fd39 100644 --- a/src/Utils.coffee +++ b/src/Utils.coffee @@ -328,7 +328,7 @@ class Utils if err callback null else - callback data + callback String(data) else # Sync diff --git a/src/Yaml.coffee b/src/Yaml.coffee index fd16cd2..81deb38 100644 --- a/src/Yaml.coffee +++ b/src/Yaml.coffee @@ -49,9 +49,11 @@ class Yaml if callback? # Async Utils.getStringFromFile path, (input) => + result = null if input? - return @parse input, exceptionOnInvalidType, objectDecoder - return null + result = @parse input, exceptionOnInvalidType, objectDecoder + callback result + return else # Sync input = Utils.getStringFromFile path @@ -96,13 +98,13 @@ class Yaml # Alias of dump() method for compatibility reasons. # - stringify: (input, inline, indent, exceptionOnInvalidType, objectEncoder) -> + @stringify: (input, inline, indent, exceptionOnInvalidType, objectEncoder) -> return @dump input, inline, indent, exceptionOnInvalidType, objectEncoder # Alias of parseFile() method for compatibility reasons. # - load: (path, callback, exceptionOnInvalidType, objectDecoder) -> + @load: (path, callback, exceptionOnInvalidType, objectDecoder) -> return @parseFile path, callback, exceptionOnInvalidType, objectDecoder |