From d8da6a80e4f71b30d72b8118a62793abe64c5815 Mon Sep 17 00:00:00 2001 From: Grazziani Xavier Date: Tue, 30 Jan 2024 17:56:52 -0300 Subject: [PATCH] bkp --- src/Utils.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Utils.js b/src/Utils.js index 3cfe6b4..cbf132e 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -121,6 +121,21 @@ module.exports = { }, Object: { pickObject, - toString + toString, + + removeObjectAttributes: (obj, ...attributes) => { + if (obj && typeof obj === "object") { + let updatedObj = {}; + Object.keys(obj).forEach(k => { + if (!attributes.includes(k)) { + updatedObj[k] = obj[k] + } + }) + + return updatedObj; + } else { + return obj + } + } } };