UNPKG

@opra/common

Version:
32 lines (31 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiBase = void 0; const objects_1 = require("@jsopen/objects"); const constants_js_1 = require("../constants.js"); const document_element_js_1 = require("./document-element.js"); class ApiBase extends document_element_js_1.DocumentElement { constructor(init) { super(init.owner); this.name = 'OpraApi'; this.name = init.name; this.description = init.description; } // eslint-disable-next-line @typescript-eslint/no-unused-vars toJSON(options) { return (0, objects_1.omitUndefined)({ transport: this.transport, name: this.name, description: this.description, }); } async _initialize(init, // eslint-disable-next-line @typescript-eslint/no-unused-vars context) { if (!constants_js_1.CLASS_NAME_PATTERN.test(init.name)) throw new TypeError(`Invalid api name (${init.name})`); this.name = init.name; this.description = init?.description; } } exports.ApiBase = ApiBase;