aboutsummaryrefslogtreecommitdiff
path: root/lib/index.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-05-28 19:16:44 +0100
committerMichael Williamson <mike@zwobble.org>2023-05-28 19:16:44 +0100
commite12c1e59acd5fc66ec274395f3c0f88713daf5b4 (patch)
treeeb034934fee35f0885fccc65d64a6580ed45f2e3 /lib/index.js
parent84fffea3212510a7b0b1d33b8dad4a9660675c8b (diff)
Add toArrayBuffer when embedding a style map
Diffstat (limited to 'lib/index.js')
-rw-r--r--lib/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/index.js b/lib/index.js
index ac9f634..03302c2 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -92,12 +92,15 @@ function embedStyleMap(input, styleMap) {
return docxStyleMap.writeStyleMap(docxFile, styleMap);
})
.then(function(docxFile) {
- return docxFile.toBuffer();
+ return docxFile.toArrayBuffer();
})
- .then(function(buffer) {
+ .then(function(arrayBuffer) {
return {
+ toArrayBuffer: function() {
+ return arrayBuffer;
+ },
toBuffer: function() {
- return buffer;
+ return Buffer.from(arrayBuffer);
}
};
});