mirror of
https://github.com/chenasraf/simple-scaffold.git
synced 2026-05-18 01:29:09 +00:00
10 lines
299 B
TypeScript
10 lines
299 B
TypeScript
import { Resolver } from "./types"
|
|
|
|
export function handleErr(err: NodeJS.ErrnoException | null): void {
|
|
if (err) throw err
|
|
}
|
|
|
|
export function resolve<T, R = T>(resolver: Resolver<T, R>, arg: T): R {
|
|
return typeof resolver === "function" ? (resolver as (value: T) => R)(arg) : (resolver as R)
|
|
}
|