Remove an item from an object or array of objects if the key starts with a specific character.
npm install remove-if-prefix
const removeIfPrefix = require("remove-if-prefix");
removeIfPrefix(
{
a: {
_a: "a",
b: 1
},
_b: ["b"]
},
"_"
);
//=> { a: { b: 1 } }
Type: object or array
The object or array to handle.
Type: string
The prefix to check for.