@office-open/xml 0.10.9 → 0.10.10

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.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Xml2JsOptions, D as XmlDescArray, E as XmlDesc, O as XmlObject, S as Js2XmlOptions, T as XmlAttrs, _ as DeclarationAttributes, a as attrNum, b as ElementObject, c as children, d as findChild, f as findDeep, g as Attributes, h as textOf, i as attrMeasure, k as XmlOption, l as collectText, m as hasChild, n as attr, o as childCount, p as findFirst, r as attrBool, s as childText, t as allChildren, u as colorAttr, v as Element, w as XmlAtom, x as IgnoreOptions, y as ElementCompact } from "./utils-CDLayhwk.mjs";
1
+ import { C as Xml2JsOptions, D as XmlDescArray, E as XmlDesc, O as XmlObject, S as Js2XmlOptions, T as XmlAttrs, _ as DeclarationAttributes, a as attrNum, b as ElementObject, c as children, d as findChild, f as findDeep, g as Attributes, h as textOf, i as attrMeasure, k as XmlOption, l as collectText, m as hasChild, n as attr, o as childCount, p as findFirst, r as attrBool, s as childText, t as allChildren, u as colorAttr, v as Element, w as XmlAtom, x as IgnoreOptions, y as ElementCompact } from "./utils-t-_-N57p.mjs";
2
2
 
3
3
  //#region src/serialize.d.ts
4
4
  /**
@@ -164,11 +164,11 @@ declare function attrNum(element: Element | undefined, name: string): number | u
164
164
  * UniversalMeasure ("5mm") and Percentage ("50%") stay verbatim so they
165
165
  * round-trip with the stringify-side value helpers in @office-open/core.
166
166
  *
167
- * Pass the sibling @type for CT_TblWidth with type="pct" its fiftieths token
168
- * ("5000") must stay a string, since converting it to 5000 would make a later
169
- * stringify re-emit "5000%", changing the value.
167
+ * For CT_TblWidth with type="pct", the fiftieths token ("5000" = 100%) is a
168
+ * plain numeric token and is returned as the number 5000; the stringify side
169
+ * emits it verbatim (never "5000%", which is a different XSD branch).
170
170
  */
171
- declare function attrMeasure(element: Element | undefined, name: string, type?: string): number | string | undefined;
171
+ declare function attrMeasure(element: Element | undefined, name: string): number | string | undefined;
172
172
  /**
173
173
  * Get an attribute value as a boolean.
174
174
  */
package/dist/utils.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as attrNum, c as children, d as findChild, f as findDeep, h as textOf, i as attrMeasure, l as collectText, m as hasChild, n as attr, o as childCount, p as findFirst, r as attrBool, s as childText, t as allChildren, u as colorAttr } from "./utils-CDLayhwk.mjs";
1
+ import { a as attrNum, c as children, d as findChild, f as findDeep, h as textOf, i as attrMeasure, l as collectText, m as hasChild, n as attr, o as childCount, p as findFirst, r as attrBool, s as childText, t as allChildren, u as colorAttr } from "./utils-t-_-N57p.mjs";
2
2
  export { allChildren, attr, attrBool, attrMeasure, attrNum, childCount, childText, children, collectText, colorAttr, findChild, findDeep, findFirst, hasChild, textOf };
package/dist/utils.mjs CHANGED
@@ -72,15 +72,14 @@ function attrNum(element, name) {
72
72
  * UniversalMeasure ("5mm") and Percentage ("50%") stay verbatim so they
73
73
  * round-trip with the stringify-side value helpers in @office-open/core.
74
74
  *
75
- * Pass the sibling @type for CT_TblWidth with type="pct" its fiftieths token
76
- * ("5000") must stay a string, since converting it to 5000 would make a later
77
- * stringify re-emit "5000%", changing the value.
75
+ * For CT_TblWidth with type="pct", the fiftieths token ("5000" = 100%) is a
76
+ * plain numeric token and is returned as the number 5000; the stringify side
77
+ * emits it verbatim (never "5000%", which is a different XSD branch).
78
78
  */
79
- function attrMeasure(element, name, type) {
79
+ function attrMeasure(element, name) {
80
80
  const v = element?.attributes?.[name];
81
81
  if (v === void 0) return void 0;
82
82
  const raw = String(v);
83
- if (type === "pct") return raw;
84
83
  const n = Number(raw);
85
84
  return Number.isNaN(n) ? raw : n;
86
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-open/xml",
3
- "version": "0.10.9",
3
+ "version": "0.10.10",
4
4
  "description": "XML parsing and serialization for Office Open XML. Zero dependencies, drop-in replacement for xml + xml-js.",
5
5
  "keywords": [
6
6
  "office-open",