Skip to content
Client
Server

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

Function: itemsOf() ​

ts
function itemsOf(
   value, 
   least, 
   most
): unknown[] | undefined;

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

A caller's list as this call's own copy of its items, whatever they are: asked its length once and read by index, as listOf reads a list of strings. undefined when it is no list, or holds fewer than least items or more than most, and a list too long is not read at all. What each item has to be is the caller's to check.

Parameters ​

value ​

unknown

What the caller gave as a list.

least ​

number

The fewest items it may hold.

most ​

number

The most items it may hold.

Returns ​

unknown[] | undefined

A new array of the list's items, or undefined when value is no array or its length is outside least to most.

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