factor out tuple logic into from-tuple.ts
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export function fromTuple<T>(value: T | [T]): T {
|
||||
if (Array.isArray(value)) {
|
||||
return value[0];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
Reference in New Issue
Block a user