@office-open/docx 0.14.4 → 0.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -8652,6 +8652,10 @@ function stringifyDrawingChild(child, ctx) {
8652
8652
  type: "wpg"
8653
8653
  };
8654
8654
  const registerMedia = (children) => {
8655
+ const adopt = (m) => (fileName) => {
8656
+ m.fileName = fileName;
8657
+ return m;
8658
+ };
8655
8659
  for (const c of children) {
8656
8660
  if (c.type === "wps") continue;
8657
8661
  if (c.type === "wpg") {
@@ -8678,11 +8682,11 @@ function stringifyDrawingChild(child, ctx) {
8678
8682
  if (c.type === "contentPart") continue;
8679
8683
  if (c.type === "svg") {
8680
8684
  const fb = c.fallback;
8681
- fb.fileName = ctx.file.media.addMedia(fb.data, fb.type, () => fb, fb.fileName).fileName;
8682
- c.fileName = ctx.file.media.addMedia(c.data, "svg", () => c, c.fileName).fileName;
8685
+ fb.fileName = ctx.file.media.addMedia(fb.data, fb.type, adopt(fb), fb.fileName).fileName;
8686
+ c.fileName = ctx.file.media.addMedia(c.data, "svg", adopt(c), c.fileName).fileName;
8683
8687
  continue;
8684
8688
  }
8685
- c.fileName = ctx.file.media.addMedia(c.data, c.type, () => c, c.fileName).fileName;
8689
+ c.fileName = ctx.file.media.addMedia(c.data, c.type, adopt(c), c.fileName).fileName;
8686
8690
  }
8687
8691
  };
8688
8692
  registerMedia(mediaData.children);