From 7a69fe97883ae27c51437c400cc08861dfa02b3c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 1 Apr 2013 16:25:39 +0100 Subject: Preserve messages in Converter --- lib/docx-reader.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/docx-reader.js') diff --git a/lib/docx-reader.js b/lib/docx-reader.js index b1e5627..e01d253 100644 --- a/lib/docx-reader.js +++ b/lib/docx-reader.js @@ -146,6 +146,12 @@ Result.prototype.map = function(func) { return new Result(func(this.value), this.messages); }; +Result.prototype.mapThen = function(func) { + return func(this.value).then(function(resultValue) { + return new Result(resultValue, this.messages); + }); +}; + function warning(message) { return { type: "warning", -- cgit v1.2.3