filter-anything
Advanced tools
Comparing version 2.1.0 to 2.1.1
{ | ||
"name": "filter-anything", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "A simple (TypeScript) integration of \"pick\" and \"omit\" to filter props of an object", |
@@ -37,20 +37,20 @@ # Filter anything ⚔️ | ||
```js | ||
import { fillable } from 'filter-anything' | ||
import { pick } from 'filter-anything' | ||
const squirtle = { id: '007', name: 'Squirtle', type: 'water' } | ||
const withoutId = fillable(squirtle, ['name', 'type']) | ||
const withoutId = pick(squirtle, ['name', 'type']) | ||
// returns { name: 'Squirtle', type: 'water' } | ||
``` | ||
### Guard | ||
### Omit | ||
With `guard` you pass an object and an array of keys of an object - the props which should be removed. | ||
With `omit` you pass an object and an array of keys of an object - the props which should be removed. | ||
```js | ||
import { guard } from 'filter-anything' | ||
import { omit } from 'filter-anything' | ||
const squirtle = { id: '007', name: 'Squirtle', type: 'water' } | ||
const withoutId = guard(squirtle, ['name', 'type']) | ||
const withoutId = omit(squirtle, ['name', 'type']) | ||
// returns { name: 'Squirtle', type: 'water' } | ||
@@ -57,0 +57,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156812