Skip to content
Client
Server

Reference / @open-music-sdk/core / listOf

Function: listOf() ​

ts
function listOf(
   fn, 
   name, 
   value
): readonly string[];

Defined in: packages/core/src/check.ts:188

value as a list of one or more strings, of the caller's ids, types or codes: this call's own copy, taken before it is checked, so what was checked is what is sent.

Parameters ​

fn ​

string

The name of the function the list was handed to, for the error.

name ​

string

What the function calls this argument, for the error, such as "ids".

value ​

unknown

What the caller gave as a list.

Returns ​

readonly string[]

A new array of the list's strings, in their order.

Throws ​

TypeError if value is not an array of 1 to 300 strings, each of 1 to 64 characters with no comma in it.

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