Forked from bisubus/ES5-ES6-ES2017-ES2019 omit & pick
Created
April 30, 2023 16:31
-
-
Save tonycaputome/c078241cf210a1bd903dbcf4d12f56d5 to your computer and use it in GitHub Desktop.
Revisions
-
bisubus revised this gist
Jul 2, 2019 . 3 changed files with 8 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ Object.fromEntries( Object.entries(obj) .filter(([key]) => !['blacklisted', 'keys'].includes(key)) ); This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ Object.fromEntries( Object.entries(obj) .filter(([key]) => ['whitelisted', 'keys'].includes(key)) ); -
bisubus renamed this gist
Jul 2, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bisubus revised this gist
Oct 25, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
bisubus created this gist
Oct 25, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Object.keys(obj) .filter((key) => ['blacklisted', 'keys'].indexOf(key) < 0) .reduce((newObj, key) => Object.assign(newObj, { [key]: obj[key] }), {}) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Object.entries(obj) .filter(([key]) => !['blacklisted', 'keys'].includes(key)) .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {}); This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Object.keys(obj) .filter((key) => ['whitelisted', 'keys'].indexOf(key) >= 0) .reduce((newObj, key) => Object.assign(newObj, { [key]: obj[key] }), {}) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Object.entries(obj) .filter(([key]) => ['whitelisted', 'keys'].includes(key)) .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {});