mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
fix(native): strict types in the address screen, Prettier on the native-auth e2e suite, file-local exports
The address screen's element helper returns the plain element instead of Object.assign's intersection, which strict mode could not represent; the haptics test reads an optional argument as optional; three exports only their own file used are local now.
This commit is contained in:
@@ -41,8 +41,15 @@ function failureMessage(reason: ProbeFailure): string {
|
||||
}
|
||||
}
|
||||
|
||||
function el<K extends keyof HTMLElementTagNameMap>(tag: K, props: Partial<HTMLElementTagNameMap[K]> = {}, ...children: (Node | string)[]) {
|
||||
const node = Object.assign(document.createElement(tag), props)
|
||||
function el<K extends keyof HTMLElementTagNameMap>(
|
||||
tag: K,
|
||||
props: Partial<HTMLElementTagNameMap[K]> = {},
|
||||
...children: (Node | string)[]
|
||||
): HTMLElementTagNameMap[K] {
|
||||
// Typed as the plain element, not as Object.assign's intersection with the
|
||||
// props, which strict mode cannot represent for an <input>.
|
||||
const node: HTMLElementTagNameMap[K] = document.createElement(tag)
|
||||
Object.assign(node, props)
|
||||
node.append(...children)
|
||||
return node
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user