UNPKG
froebel
Version:
latest (0.23.2)
0.23.2
0.23.1
0.23.0
0.22.0
0.21.3
0.21.2
0.21.1
0.21.0
0.20.0
0.19.0
0.18.0
0.17.0
0.16.1
0.15.0
0.14.4
0.14.3
0.14.1
TypeScript utility library
github.com/MathisBullinger/froebel
MathisBullinger/froebel
froebel
/
omit.mjs
11 lines
(10 loc)
•
282 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
/** * From `obj`, create a new object that does not include `keys`. * *
@example
* ``` * omit({ a: 1, b: 2, c: 3 }, 'a', 'c') // { b: 2 } * ``` */
const
omit
= (
obj, ...keys
) =>
Object
.
fromEntries
(
Object
.
entries
(obj).
filter
(
(
[k]
) =>
!keys.
includes
(k)));
export
default
omit;