structured-clone-es
A redistribution of @ungap/structured-clone that ships Node.js compatible ESM.
by made-in-commonTypeScript
Commit activity
Last 12 weeks · 1 commit
Community health
4 of 6 standards met
Recent fixes
Make the exported function pure by removing its dependency on . It now always uses the serialize/deserialize implementation path. Simplify export to a pure function Remove globalThis checks and native delegation Update documentation to reflect pure implementation Remove global polyfill example (no longer delegates to native) All tests pass.
Summary Port the @ungap/structured-clone source code directly into this repo with TypeScript support and modern tooling. Replaces unbuild with tsdown for bundling and adds comprehensive vitest test suite. Inlines the serialization/deserialization logic as the core of the package. Changes TypeScript conversion: Ported all source files (types, serialize, deserialize, json) to TypeScript with full type safety Build tooling: Replaced unbuild with tsdown for faster, simpler bundling and dts generation Testing: Added comprehensive vitest test suite covering all types, circular refs, lossy/json modes, and roundtrip scenarios Dependencies: Removed @ungap/structured-clone and @types/ungap__structured-clone; inlined source code Documentation**: Updated README with credits to original author, use cases (DevTools, RPC), and guidance on using native structuredClone() in modern envs Verification ✅ All 7 vitest tests pass ✅ TypeScript typecheck passes ✅ ESLint passes ✅ Build produces dist/index.js (6.15 kB minified) and dist/index.d.ts
Repository: made-in-common/structured-clone-es. Description: A redistribution of @ungap/structured-clone that ships Node.js compatible ESM. Stars: 36, Forks: 0. Primary language: TypeScript. Languages: TypeScript (99.4%), JavaScript (0.6%). License: ISC. Latest release: v2.0.1 (4mo ago). Open PRs: 0, open issues: 0. Last activity: 1d ago. Community health: 62%. Top contributors: antfu, antfubot.