Sha256: 563e9d037c1153dc1da77d51f2745188a2d3c3d8c946595546afa26375e82f9f
Contents?: true
Size: 1.1 KB
Versions: 13
Compression:
Stored size: 1.1 KB
Contents
import { elementNodeType } from "./types" export class Diff { constructor(options = {}) { Object.entries(options).forEach(([key, value]) => (this[key] = value)) } toString() { return JSON.stringify(this) } setValue( aKey: string | number, aValue: | string | number | boolean | number[] | { [key: string]: string | { [key: string]: string } } | elementNodeType, ) { this[aKey] = aValue return this } } export function checkElementType(element, ...elementTypeNames: string[]) { if (typeof element === "undefined" || element === null) { return false } return elementTypeNames.some( (elementTypeName) => // We need to check if the specified type is defined // because otherwise instanceof throws an exception. typeof element?.ownerDocument?.defaultView?.[elementTypeName] === "function" && element instanceof element.ownerDocument.defaultView[elementTypeName], ) }
Version data entries
13 entries across 13 versions & 1 rubygems