diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-09-16 23:24:59 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-09-16 23:24:59 +0100 |
| commit | 8fde4e29bb6778ac42027e701d5dd18d761242c9 (patch) | |
| tree | f2078e0f7ed632885b2504fb033eca20ad1189bb | |
| parent | 5488058d7ca995fcaaf642dcbe31dbc0255fe4be (diff) | |
Remove uses of Promise.tap()
| -rw-r--r-- | lib/index.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/index.js b/lib/index.js index 48dfb91..0048cfe 100644 --- a/lib/index.js +++ b/lib/index.js @@ -33,9 +33,10 @@ function convert(input, options) { options = readOptions(options); return unzip.openZip(input) - .tap(function(docxFile) { + .then(function(docxFile) { return docxStyleMap.readStyleMap(docxFile).then(function(styleMap) { options.embeddedStyleMap = styleMap; + return docxFile; }); }) .then(function(docxFile) { @@ -88,8 +89,11 @@ function extractRawText(input) { function embedStyleMap(input, styleMap) { return unzip.openZip(input) - .tap(function(docxFile) { - return docxStyleMap.writeStyleMap(docxFile, styleMap); + .then(function(docxFile) { + return docxStyleMap.writeStyleMap(docxFile, styleMap) + .then(function() { + return docxFile; + }); }) .then(function(docxFile) { return docxFile.toArrayBuffer(); |
