Skip to content
Client
Server

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

Function: isPlain() ​

ts
function isPlain(value): value is object;

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

Whether value is a plain object: one written as {…}, or made with no prototype. A list, a Map, a URLSearchParams, a Buffer and a class's instance are not: what each holds is not in properties of its own, so read as a bag of them it would be an empty bag, and what the caller meant by it would be dropped without a word. The prototype is asked about rather than compared, so an object from another realm is as plain as one from here.

Parameters ​

value ​

unknown

What to look at.

Returns ​

value is object

Whether value is an object whose prototype is null or is itself prototype-less, as Object.prototype is.

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