Skip to main content

subset

Stentor API Reference


Stentor API Reference / stentor-utils/src / subset

Function: subset()

subset(obj, attrs): object

Defined in: packages/stentor-utils/src/object/index.ts:63

A function that will return a subset of a given object keeping only the attributes that it contains.

The original object is not affected.

Parameters​

obj​

object

Object to create a subset for.

attrs​

string[]

The attributes to retain in the object.

Returns​

object