first
This commit is contained in:
36
node_modules/@rgrove/parse-xml/dist/lib/XmlDeclaration.js
generated
vendored
Normal file
36
node_modules/@rgrove/parse-xml/dist/lib/XmlDeclaration.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.XmlDeclaration = void 0;
|
||||
const XmlNode_js_1 = require("./XmlNode.js");
|
||||
/**
|
||||
* An XML declaration within an XML document.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```xml
|
||||
* <?xml version="1.0" encoding="UTF-8"?>
|
||||
* ```
|
||||
*/
|
||||
class XmlDeclaration extends XmlNode_js_1.XmlNode {
|
||||
constructor(version, encoding, standalone) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.encoding = encoding ?? null;
|
||||
this.standalone = standalone ?? null;
|
||||
}
|
||||
get type() {
|
||||
return XmlNode_js_1.XmlNode.TYPE_XML_DECLARATION;
|
||||
}
|
||||
toJSON() {
|
||||
let json = XmlNode_js_1.XmlNode.prototype.toJSON.call(this);
|
||||
json.version = this.version;
|
||||
for (let key of ['encoding', 'standalone']) {
|
||||
if (this[key] !== null) {
|
||||
json[key] = this[key];
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
}
|
||||
exports.XmlDeclaration = XmlDeclaration;
|
||||
//# sourceMappingURL=XmlDeclaration.js.map
|
||||
Reference in New Issue
Block a user