UNPKG

286 BJavaScriptView Raw
1export function dissoc(prop, obj){
2 if (arguments.length === 1) return _obj => dissoc(prop, _obj)
3
4 if (obj === null || obj === undefined) return {}
5
6 const willReturn = {}
7 for (const p in obj){
8 willReturn[ p ] = obj[ p ]
9 }
10 delete willReturn[ prop ]
11
12 return willReturn
13}