@mimik/userlib
v2.1.3
Published
user library for mimik services
Readme
userlib
Example
import { partialUser } from '@mimik/userlib';
// or
import UserLib from '@mimik/userlib';userlib~partialUser(user, selectedUser) ⇒ object
Get partial user.
Note: The attributes key is always handled via selectedUser.attributes, never via selectedUser.properties.
Kind: inner method of userlib
Returns: object - The partial user with matched properties and filtered attributes.
Category: sync
| Param | Type | Description |
| --- | --- | --- |
| user | object | The user to filter. |
| [user.attributes] | Array.<{name: string, value: string}> | The user's attributes. |
| selectedUser | object | The filter to apply to the user. |
| [selectedUser.properties] | Array.<string> | The top-level property names to include. |
| [selectedUser.attributes] | Array.<string> | The attribute names to include. |
