gnablib
Version:
A lean, zero dependency library to provide a useful base for your project.
2 lines • 385 B
JavaScript
/*! Copyright 2023 the gnablib contributors MPL-1.1 */
export class BinResult{constructor(t,e){this.byteLen=t,this.value=e}}export class FromBinResult{constructor(t,e,s){this.byteLen=t,this.value=e,this.reason=s}get success(){return this.byteLen>0}switchT(){if(null!=this.value)throw new TypeError("Unable to convert T to U");return new FromBinResult(this.byteLen,void 0,this.reason)}}