Skip to content

Commit

Permalink
docs(uinix-fp-props): update API
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrzhou committed Jun 25, 2022
1 parent 3653409 commit 72b2d53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/uinix-fp-props/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ props('a.b.d')(x); // 'D'
props('a')(x); // x.a
props('a.b')(x); // 'AB' (direct property path takes precendence)
props('x.y.z')(x); // undefined
props('x.y.z', { isStrict: true })(x); // throws in strict mode

const propsABC = props('a.b.c'); // curried
propsABC(x); // 'C'
Expand All @@ -48,7 +49,7 @@ propsABC(x); // 'C'

This package exports the following identifiers: `props`. There is no default export.

### `props(k, options)(x) => y`
### `props(k, [options])(x) => y`

##### Parameters (curried)

Expand All @@ -58,6 +59,9 @@ An object property path. Supports accessing nested object properties through th
###### `X` (`object`)
The provided object.

###### `options.isStrict` (boolean)
Options to set strict behavior. Throws an error instead of returning `undefined` if provided object property path is invalid.

##### Returns

###### `v` (`any`)
Expand Down

0 comments on commit 72b2d53

Please sign in to comment.