Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@s4tk/xml-dom

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@s4tk/xml-dom - npm Package Compare versions

Comparing version
0.1.1
to
0.1.2
+4
-0
CHANGELOG.md

@@ -8,2 +8,6 @@ # Changelog

## [0.1.2] - 2022/01/29
### Added
- First release.
## [0.1.1] - 2022/01/23

@@ -10,0 +14,0 @@ ### Changed

+1
-1
{
"name": "@s4tk/xml-dom",
"version": "0.1.1",
"version": "0.1.2",
"main": "xml.js",

@@ -5,0 +5,0 @@ "repository": {

@@ -103,2 +103,11 @@ /// <reference types="node" />

/**
* Finds and returns the first child that has the given name. If no children
* have this name, undefined is returned. If this node cannot have children,
* an exception is thrown.
*
* @param name Name attribute of child to find
* @throws If this node cannot have children
*/
findChild(name: string): XmlNode;
/**
* Sorts the children of this node using the provided function. If no function

@@ -166,2 +175,3 @@ * is given, they are sorted in ascending alphanumeric order by their `n`

deepSort(compareFn?: (a: XmlNode, b: XmlNode) => number): void;
findChild(name: string): XmlNode;
sort(compareFn?: (a: XmlNode, b: XmlNode) => number): void;

@@ -168,0 +178,0 @@ abstract toXml(options?: {

+5
-0

@@ -105,2 +105,7 @@ "use strict";

}
findChild(name) {
if (!this.hasChildren)
throw new Error("Cannot find child for childless node.");
return this.children.find(child => child.name === name);
}
sort(compareFn) {

@@ -107,0 +112,0 @@ this._ensureChildren();