@mimik/userlib
v2.1.1
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.
Kind: inner method of userlib
Returns: Object - The partial user with matched properties and filtered attributes.
Category: sync
Note: The `attributes` key is always handled via `selectedUser.attributes`, never via `selectedUser.properties`.
| 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 on the user. |
| selectedUser.properties | Array.<string> | The top-level property names to include. |
| selectedUser.attributes | Array.<string> | The attribute names to include. |
