Skip to content
Client
Server

Reference / @open-music-sdk/validate / tResult

Type Alias: tResult<T> ​

ts
type tResult<T> = 
  | {
  issues?: undefined;
  value: T;
}
  | {
  issues: readonly tIssue[];
};

Defined in: runtime.ts:14

What validating a value comes to: the value, now typed, or everything wrong with it.

Type Parameters ​

T ​

T

Union Members ​

Type Literal ​

ts
{
  issues?: undefined;
  value: T;
}

issues? ​

ts
readonly optional issues?: undefined;

Never set when the value passed: if (result.issues) tells the two apart.

value ​

ts
readonly value: T;

The value as it was given, now known to be a T.


Type Literal ​

ts
{
  issues: readonly tIssue[];
}

issues ​

ts
readonly issues: readonly tIssue[];

Everything wrong with the value, in the order it was found.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.