gads
Version:
An unofficial JS client library for the SOAP-based DFP Ads API
26 lines • 967 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("./util");
class WsdlSimpleTypeToMetaTypeTranslator {
constructor() { }
translate(simpleType) {
return new Promise(resolve => {
const name = simpleType.$.name;
const values = util_1.toArray(simpleType.restriction.enumeration)
.map(v => ({
description: v.annotation ? v.annotation.documentation : '',
value: v.$.value
}));
const type = {
base: simpleType.restriction.$.base,
description: simpleType.annotation ?
simpleType.annotation.documentation : '',
name,
values
};
resolve(type);
});
}
}
exports.WsdlSimpleTypeToMetaTypeTranslator = WsdlSimpleTypeToMetaTypeTranslator;
//# sourceMappingURL=wsdlSimpleTypeToMetaTypeTranslator.js.map