
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
collapse-prototypes
Advanced tools
Return an object with prototype properties included as own properties (for serialization purposes)
Return an object with prototype properties included as own properties (for serialization purposes)
import collapse from 'collapse-prototypes';
let parent = {
foo: 1
};
let child = Object.create(parent);
child.bar = 2;
let collapsed = collapse(child);
console.log(collapsed); // { foo: 1, bar: 2 }
yarn add collapse-prototypes
collapse(obj, {
// useful if you're going to serialize, because `toJSON` and getters
// may not like the new prototype-less object
// Default value (false)
stripFunctions: true,
// speeds up collapsing if you don't need them
// Default value (false)
excludeNonenumerable: true,
// useful if you're going to stringify (uses `json-stringify-safe`)
// Default value (false)
dropCycles: true,
// prepend the debug log to differentiate calls using the `debug` package
// (DEBUG=collapse-prototypes)
// Default value ('')
debugLabel: 'obj'
});
FAQs
Return an object with prototype properties included as own properties (for serialization purposes)
We found that collapse-prototypes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.