Skip to content
Client
Server

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

Function: textOf() ​

ts
function textOf(
   fn, 
   name, 
   value
): string;

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

value as a piece of text that is no name, such as what someone typed into a search box: a string of 1 to 256 characters. It is sent in the URL, so how long it may be is not left open.

Parameters ​

fn ​

string

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

name ​

string

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

value ​

unknown

What the caller gave.

Returns ​

string

value itself, as a string.

Throws ​

TypeError if value is not a string of 1 to 256 characters.

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