diff options
author | EuAndreh <eu@euandre.org> | 2024-03-08 08:40:59 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-03-08 08:40:59 -0300 |
commit | ee882ae2ba0275ef32ff7fadcd7414458e273e1c (patch) | |
tree | ec16930784e73dbfe10f4f0398b152d30795cf4e /src/utils.mjs | |
parent | src/web.mjs: Move logging and interceptors to the beginning of the file (diff) | |
download | papod-ee882ae2ba0275ef32ff7fadcd7414458e273e1c.tar.gz papod-ee882ae2ba0275ef32ff7fadcd7414458e273e1c.tar.xz |
src/utils.mjs: Add dissoc()
Diffstat (limited to 'src/utils.mjs')
-rw-r--r-- | src/utils.mjs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils.mjs b/src/utils.mjs index 1080219..9a600e7 100644 --- a/src/utils.mjs +++ b/src/utils.mjs @@ -25,6 +25,12 @@ export const assocIn = (obj, path, value) => ) }; +export const dissoc = (obj, key) => { + const ret = { ...obj }; + delete ret[key] + return ret; +}; + export const getIn = (obj, path) => path.length === 0 ? obj : getIn(obj?.[path[0]], path.slice(1)); |