@harbour-enterprises/superdoc 0.6.88 → 0.6.89

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.
@@ -20618,7 +20618,7 @@ const _SuperConverter = class _SuperConverter {
20618
20618
  return;
20619
20619
  }
20620
20620
  }
20621
- static updateDocumentVersion(docx = this.convertedXml, version = "0.6.88") {
20621
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.6.89") {
20622
20622
  const customLocation = "docProps/custom.xml";
20623
20623
  if (!docx[customLocation]) {
20624
20624
  docx[customLocation] = generateCustomXml();
@@ -20877,18 +20877,23 @@ function storeSuperdocVersion(docx) {
20877
20877
  const properties = customXml.elements.find((el) => el.name === "Properties");
20878
20878
  if (!properties.elements) properties.elements = [];
20879
20879
  const elements = properties.elements;
20880
+ const cleanProperties = elements.filter((prop) => typeof prop === "object" && prop !== null).filter((prop) => {
20881
+ const { attributes } = prop;
20882
+ return attributes.name !== "SuperdocVersion";
20883
+ });
20880
20884
  let pid = 2;
20881
20885
  try {
20882
- pid = elements.length ? Math.max(...elements.map((el) => el.attributes.pid)) + 1 : 2;
20886
+ pid = cleanProperties.length ? Math.max(...elements.map((el) => el.attributes.pid)) + 1 : 2;
20883
20887
  } catch (error) {
20884
20888
  }
20885
- elements.push(pid, generateSuperdocVersion());
20889
+ cleanProperties.push(pid, generateSuperdocVersion());
20890
+ properties.elements = cleanProperties;
20886
20891
  return docx;
20887
20892
  }
20888
20893
  function generateCustomXml() {
20889
20894
  return DEFAULT_CUSTOM_XML;
20890
20895
  }
20891
- function generateSuperdocVersion(pid = 2, version = "0.6.88") {
20896
+ function generateSuperdocVersion(pid = 2, version = "0.6.89") {
20892
20897
  return {
20893
20898
  type: "element",
20894
20899
  name: "property",
@@ -20960,4 +20965,4 @@ export {
20960
20965
  RemoveMarkStep as y,
20961
20966
  twipsToLines as z
20962
20967
  };
20963
- //# sourceMappingURL=converter-Cec-lU-u.js.map
20968
+ //# sourceMappingURL=converter-DoRQBZ-W.js.map