docx-templates
Advanced tools
Comparing version 2.7.0 to 2.7.1
@@ -294,3 +294,3 @@ 'use strict'; | ||
if (!numImages) { | ||
_context2.next = 108; | ||
_context2.next = 110; | ||
break; | ||
@@ -330,2 +330,4 @@ } | ||
ensureContentType('gif', 'image/gif'); | ||
ensureContentType('bmp', 'image/bmp'); | ||
ensureContentType('svg', 'image/svg+xml'); | ||
finalContentTypesXml = (0, _xml.buildXml)(contentTypes, xmlOptions); | ||
@@ -335,5 +337,5 @@ | ||
case 108: | ||
case 110: | ||
if (!replaceImages) { | ||
_context2.next = 130; | ||
_context2.next = 132; | ||
break; | ||
@@ -345,3 +347,3 @@ } | ||
if (!options.replaceImagesBase64) { | ||
_context2.next = 129; | ||
_context2.next = 131; | ||
break; | ||
@@ -354,5 +356,5 @@ } | ||
case 114: | ||
case 116: | ||
if (!(_i < imgNames.length)) { | ||
_context2.next = 127; | ||
_context2.next = 129; | ||
break; | ||
@@ -365,3 +367,3 @@ } | ||
if ((0, _zip.zipExists)(zip, '' + imgPath)) { | ||
_context2.next = 120; | ||
_context2.next = 122; | ||
break; | ||
@@ -371,24 +373,24 @@ } | ||
console.warn('Image ' + imgName + ' cannot be replaced: destination does not exist'); | ||
return _context2.abrupt('continue', 124); | ||
return _context2.abrupt('continue', 126); | ||
case 120: | ||
case 122: | ||
imgData = replaceImages[imgName]; | ||
DEBUG && log.debug('Replacing ' + imgName + ' with <base64 buffer>...'); | ||
_context2.next = 124; | ||
_context2.next = 126; | ||
return (0, _zip.zipSetBase64)(zip, imgPath, imgData); | ||
case 124: | ||
case 126: | ||
_i++; | ||
_context2.next = 114; | ||
_context2.next = 116; | ||
break; | ||
case 127: | ||
_context2.next = 130; | ||
case 129: | ||
_context2.next = 132; | ||
break; | ||
case 129: | ||
case 131: | ||
console.warn('Unsupported format (path): images can only be replaced in base64 mode'); | ||
case 130: | ||
case 132: | ||
@@ -399,10 +401,10 @@ // --------------------------------------------------------- | ||
DEBUG && log.debug('Zipping...'); | ||
_context2.next = 133; | ||
_context2.next = 135; | ||
return (0, _zip.zipSave)(zip); | ||
case 133: | ||
case 135: | ||
output = _context2.sent; | ||
return _context2.abrupt('return', output); | ||
case 135: | ||
case 137: | ||
case 'end': | ||
@@ -409,0 +411,0 @@ return _context2.stop(); |
{ | ||
"name": "docx-templates", | ||
"version": "2.7.0", | ||
"version": "2.7.1", | ||
"description": "Template-based docx report creation", | ||
@@ -5,0 +5,0 @@ "main": "lib/indexNode.js", |
Sorry, the diff of this file is not supported yet
149824
2207