Skip to content

Commit

Permalink
issue-#61 - Removed types from 'list/lookup' method.
Browse files Browse the repository at this point in the history
  • Loading branch information
elycruz committed Aug 28, 2022
1 parent 95b1940 commit 445e6b3
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 53 deletions.
110 changes: 60 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions packages/fjl/src/object/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ export const
* Looks up property and returns it's value; Else `undefined`.
* Method is null safe (will not throw on `null` or `undefined`).
*/
lookup = <X extends object>(key: string | number | symbol, obj: X): any =>
lookup = (key, obj): any =>
!obj ? undefined : obj[key],

$lookup = <X extends object>(key: string | number | symbol) =>
(obj: X) => lookup(key, obj);
$lookup = (key) => obj => lookup(key, obj);

0 comments on commit 445e6b3

Please sign in to comment.