diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-03-02 20:37:17 -0500 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-03-21 12:37:06 -0400 |
| commit | ad49faa9561946ef46c0a66423e55f344876b3e8 (patch) | |
| tree | 6739eac3d5b7cdf63c69417d3f0b9aaee9578da3 /packages/backend/src/misc | |
| parent | fix startup crash caused by circular reference (SWC is not compatible with fo... (diff) | |
| download | sharkey-ad49faa9561946ef46c0a66423e55f344876b3e8.tar.gz sharkey-ad49faa9561946ef46c0a66423e55f344876b3e8.tar.bz2 sharkey-ad49faa9561946ef46c0a66423e55f344876b3e8.zip | |
implement ApResolver.secureResolve to use a provided object only if the authority matches
Diffstat (limited to 'packages/backend/src/misc')
| -rw-r--r-- | packages/backend/src/misc/from-tuple.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/backend/src/misc/from-tuple.ts b/packages/backend/src/misc/from-tuple.ts index 366b1e310f..034bae584b 100644 --- a/packages/backend/src/misc/from-tuple.ts +++ b/packages/backend/src/misc/from-tuple.ts @@ -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]; } |