Function
fakeEl
(
attrs: Record<string, string>,
tagName: string,
parent: FakeEl | null = null,
)
Source from the content-addressed store, hash-verified
| 40 | } |
| 41 | |
| 42 | function fakeEl( |
| 43 | attrs: Record<string, string>, |
| 44 | tagName: string, |
| 45 | parent: FakeEl | null = null, |
| 46 | ): FakeEl { |
| 47 | return { |
| 48 | attrs, |
| 49 | tagName, |
| 50 | parentElement: parent, |
| 51 | getAttribute(name) { |
| 52 | return Object.prototype.hasOwnProperty.call(this.attrs, name) ? this.attrs[name] : null; |
| 53 | }, |
| 54 | hasAttribute(name) { |
| 55 | return Object.prototype.hasOwnProperty.call(this.attrs, name); |
| 56 | }, |
| 57 | }; |
| 58 | } |
| 59 | |
| 60 | const visible = () => true; |
| 61 | const invisible = () => false; |
Tested by
no test coverage detected