@bmqube/xmlrpc
Version:
A pure TypeScript XML-RPC client and server. Forked from (https://github.com/baalexander/node-xmlrpc)
21 lines (20 loc) • 455 B
JavaScript
// customType.mts
/**
* Represents a custom XML-RPC type.
*/
export default class CustomType {
constructor(raw) {
this.raw = raw;
}
/**
* Serializes this custom type into XML.
* @param xml XML builder object (must have `.ele()` and `.txt()` methods).
*/
serialize(xml) {
return xml.ele(this.tagName).txt(this.raw);
}
/** XML-RPC tag name */
get tagName() {
return "customType";
}
}