Automated class transform
npx lebab --replace src --transform class
This commit is contained in:
@@ -17,15 +17,40 @@ import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter,
|
||||
* @extends {module:ol/format/XML}
|
||||
* @api
|
||||
*/
|
||||
const WMSCapabilities = function() {
|
||||
class WMSCapabilities {
|
||||
constructor() {
|
||||
|
||||
XML.call(this);
|
||||
XML.call(this);
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.version = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
* @inheritDoc
|
||||
*/
|
||||
this.version = undefined;
|
||||
};
|
||||
readFromDocument(doc) {
|
||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readFromNode(n);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
readFromNode(node) {
|
||||
this.version = node.getAttribute('version').trim();
|
||||
const wmsCapabilityObject = pushParseAndPop({
|
||||
'version': this.version
|
||||
}, PARSERS, node, []);
|
||||
return wmsCapabilityObject ? wmsCapabilityObject : null;
|
||||
}
|
||||
}
|
||||
|
||||
inherits(WMSCapabilities, XML);
|
||||
|
||||
@@ -277,31 +302,6 @@ const KEYWORDLIST_PARSERS = makeStructureNS(
|
||||
WMSCapabilities.prototype.read;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
WMSCapabilities.prototype.readFromDocument = function(doc) {
|
||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readFromNode(n);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
WMSCapabilities.prototype.readFromNode = function(node) {
|
||||
this.version = node.getAttribute('version').trim();
|
||||
const wmsCapabilityObject = pushParseAndPop({
|
||||
'version': this.version
|
||||
}, PARSERS, node, []);
|
||||
return wmsCapabilityObject ? wmsCapabilityObject : null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
|
||||
Reference in New Issue
Block a user