-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: omitBy | ||
description: Omit unwanted attributes from an object by an identity function | ||
group: Object | ||
--- | ||
|
||
## Basic usage | ||
|
||
Given an object and an identity function, returns a new object without any of the values which makes identity returns true. | ||
|
||
```ts | ||
import { omitBy } from 'radash' | ||
|
||
const fish = { | ||
name: 'Bass', | ||
weight: 8, | ||
source: 'lake', | ||
brackish: false | ||
} | ||
|
||
omitBy(fish, v => v === 8) // => { name, source, brackish } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: pickBy | ||
description: Pick only the desired attributes from an object | ||
group: Object | ||
--- | ||
|
||
## Basic usage | ||
|
||
Given an object and an identity function, returns a new object with only the values which makes identity returns true. | ||
|
||
```ts | ||
import { pickBy } from 'radash' | ||
|
||
const fish = { | ||
name: 'Bass', | ||
weight: 8, | ||
source: 'lake', | ||
barckish: false | ||
} | ||
|
||
pick(fish, v => v === 8) // => { weight } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters