@office-open/xml
Advanced tools
+13
-1
@@ -49,2 +49,14 @@ import { C as XmlAttrs, D as XmlOption, E as XmlObject, S as XmlAtom, T as XmlDescArray, _ as ElementCompact, a as childCount, b as Js2XmlOptions, c as collectText, d as findDeep, f as hasChild, g as Element, h as DeclarationAttributes, i as attrNum, l as colorAttr, m as Attributes, n as attr, o as childText, p as textOf, r as attrBool, s as children, t as allChildren, u as findChild, v as ElementObject, w as XmlDesc, x as Xml2JsOptions, y as IgnoreOptions } from "./utils-DJSm61Ws.mjs"; | ||
| /** | ||
| * Build an XML attribute string without escaping. | ||
| * | ||
| * Same as `attrs()` but skips `typeof` checks and `escapeXml` — use only when | ||
| * all values are known-safe (numbers, booleans, or strings free of `& " ' < >`). | ||
| * Avoids per-call array and `Object.keys()` allocation in hot loops. | ||
| * | ||
| * @example | ||
| * attrsRaw({ r: "A1", s: 5 }) | ||
| * // => ' r="A1" s="5"' | ||
| */ | ||
| declare function attrsRaw(record: Record<string, string | number | boolean | undefined>): string; | ||
| /** | ||
| * Build a self-closing XML element: `<tag attrStr/>`. | ||
@@ -76,2 +88,2 @@ * `attrStr` is a pre-serialized attribute string (from `attrs()`) or undefined. | ||
| //#endregion | ||
| export { type Attributes, type DeclarationAttributes, type Element, type ElementCompact, type ElementObject, type IgnoreOptions, type Js2XmlOptions, type Xml2JsOptions, type XmlAtom, type XmlAttrs, type XmlDesc, type XmlDescArray, type XmlObject, type XmlOption, allChildren, attr, attrBool, attrNum, attrs, childCount, childText, children, collectText, colorAttr, element, escapeXml, findChild, findDeep, hasChild, stringify as js2xml, stringify, json2xml, nativeTypeValue, parse, parse as xml2js, parseAttributes, selfCloseElement, textOf, toElement, unescapeXml, xml, xml2json }; | ||
| export { type Attributes, type DeclarationAttributes, type Element, type ElementCompact, type ElementObject, type IgnoreOptions, type Js2XmlOptions, type Xml2JsOptions, type XmlAtom, type XmlAttrs, type XmlDesc, type XmlDescArray, type XmlObject, type XmlOption, allChildren, attr, attrBool, attrNum, attrs, attrsRaw, childCount, childText, children, collectText, colorAttr, element, escapeXml, findChild, findDeep, hasChild, stringify as js2xml, stringify, json2xml, nativeTypeValue, parse, parse as xml2js, parseAttributes, selfCloseElement, textOf, toElement, unescapeXml, xml, xml2json }; |
+20
-1
@@ -53,2 +53,21 @@ import { allChildren, attr, attrBool, attrNum, childCount, childText, children, collectText, colorAttr, findChild, findDeep, hasChild, textOf } from "./utils.mjs"; | ||
| /** | ||
| * Build an XML attribute string without escaping. | ||
| * | ||
| * Same as `attrs()` but skips `typeof` checks and `escapeXml` — use only when | ||
| * all values are known-safe (numbers, booleans, or strings free of `& " ' < >`). | ||
| * Avoids per-call array and `Object.keys()` allocation in hot loops. | ||
| * | ||
| * @example | ||
| * attrsRaw({ r: "A1", s: 5 }) | ||
| * // => ' r="A1" s="5"' | ||
| */ | ||
| function attrsRaw(record) { | ||
| let s = ""; | ||
| for (const key in record) { | ||
| const v = record[key]; | ||
| if (v !== void 0) s += ` ${key}="${v}"`; | ||
| } | ||
| return s; | ||
| } | ||
| /** | ||
| * Build a self-closing XML element: `<tag attrStr/>`. | ||
@@ -584,2 +603,2 @@ * `attrStr` is a pre-serialized attribute string (from `attrs()`) or undefined. | ||
| //#endregion | ||
| export { allChildren, attr, attrBool, attrNum, attrs, childCount, childText, children, collectText, colorAttr, element, escapeXml, findChild, findDeep, hasChild, stringify as js2xml, stringify, json2xml, nativeTypeValue, parse, parse as xml2js, parseAttributes, selfCloseElement, textOf, toElement, unescapeXml, xml, xml2json }; | ||
| export { allChildren, attr, attrBool, attrNum, attrs, attrsRaw, childCount, childText, children, collectText, colorAttr, element, escapeXml, findChild, findDeep, hasChild, stringify as js2xml, stringify, json2xml, nativeTypeValue, parse, parse as xml2js, parseAttributes, selfCloseElement, textOf, toElement, unescapeXml, xml, xml2json }; |
+1
-1
| { | ||
| "name": "@office-open/xml", | ||
| "version": "0.9.0", | ||
| "version": "0.9.1", | ||
| "description": "XML parsing and serialization for Office Open XML. Zero dependencies, drop-in replacement for xml + xml-js.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
42706
2.38%719
2.71%