UNPKG

happy-dom-without-node

Version:

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.

41 lines 838 B
/** * MimeTypeArray. * * Reference: * https://developer.mozilla.org/en-US/docs/Web/API/MimeTypeArray. */ export default class MimeTypeArray { /** * Constructor. * * @param mimeTypes */ constructor(mimeTypes) { for (let i = 0, max = mimeTypes.length; i < max; i++) { this[i] = mimeTypes[i]; this[mimeTypes[i].type] = mimeTypes[i]; } this.length = mimeTypes.length; } /** * @param index */ item(index) { return this[index] || null; } /** * @param name */ namedItem(name) { return this[name] || null; } /** * Returns the object as a string. * * @returns String. */ toString() { return '[object MimeTypeArray]'; } } //# sourceMappingURL=MimeTypeArray.js.map