@ooxml-tools/xml 0.4.0 → 0.5.0

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/npm/index.js CHANGED
@@ -20,7 +20,7 @@ function asXmlElement(xml) {
20
20
  function safeXml(templateStrings, ...templateValues) {
21
21
  let xml = "";
22
22
  for (let i = 0; i < templateStrings.length; i++) {
23
- if (templateValues[i] !== undefined) {
23
+ if (templateValues[i] !== undefined && templateValues[i] !== null) {
24
24
  const value = templateValues[i];
25
25
  const xmlPart = Array.isArray(value) ? value.join("") : value;
26
26
  xml += `${templateStrings[i]}${xmlPart}`;
@@ -7,7 +7,7 @@ declare function asXmlElement(xml: string | Element): Element;
7
7
  * @param templateValues tamplate values
8
8
  * @returns xml string
9
9
  */
10
- declare function safeXml(templateStrings: TemplateStringsArray, ...templateValues: (string | number | (string | number)[])[]): string;
10
+ declare function safeXml(templateStrings: TemplateStringsArray, ...templateValues: (undefined | null | string | number | (string | number)[])[]): string;
11
11
 
12
12
  declare function cdata(input: string | number): string;
13
13
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ooxml-tools/xml",
3
3
  "description": "Some XML helpers to help with OOXML development",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "license": "MIT",
6
6
  "main": "./dist/npm/index.js",
7
7
  "types": "./dist/npm/types.d.ts",