import { CommandResult , CommandResultDone } from "../request" ; template T param { CommandResult < T > } commandRes return { T } export function unwrapResult < T > ( commandRes ) { if ( ! commandRes . success ) { throw new Error ( `Request failed with status: ${ commandRes . status }` ) ; } return commandRes ; }