UNPKG

@opra/common

Version:
24 lines (23 loc) 701 B
import { omitUndefined } from '@jsopen/objects'; import { DocumentElement } from '../common/document-element.js'; /** * @class HttpRequestBody */ export class HttpRequestBody extends DocumentElement { constructor(owner) { super(owner); this.content = []; } toJSON(options) { return omitUndefined({ description: this.description, required: this.required, maxContentSize: this.maxContentSize, content: this.content.length ? this.content.map(x => x.toJSON(options)) : [], partial: this.partial, allowPatchOperators: this.allowPatchOperators, }); } }