implement ApResolver.secureResolve to use a provided object only if the authority matches

This commit is contained in:
Hazelnoot 2025-03-02 20:37:17 -05:00
parent 1ed2f207f7
commit ad49faa956
2 changed files with 36 additions and 2 deletions

View file

@ -1,4 +1,11 @@
export function fromTuple<T>(value: T | [T]): T {
/*
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
export function fromTuple<T>(value: T | [T]): T;
export function fromTuple<T>(value: T | [T] | T[]): T | undefined;
export function fromTuple<T>(value: T | [T] | T[]): T | undefined {
if (Array.isArray(value)) {
return value[0];
}