Skip to content

feat(object/deepFreeze): add deepFreeze function for recursively freezing objects#1680

Open
sukvvon wants to merge 3 commits intotoss:mainfrom
sukvvon:feat/object-deep-freeze
Open

feat(object/deepFreeze): add deepFreeze function for recursively freezing objects#1680
sukvvon wants to merge 3 commits intotoss:mainfrom
sukvvon:feat/object-deep-freeze

Conversation

@sukvvon
Copy link
Copy Markdown
Contributor

@sukvvon sukvvon commented Apr 3, 2026

Summary

  • Add deepFreeze function that recursively freezes an object and all nested objects/arrays
  • Unlike Object.freeze, handles deep nesting and circular references
  • 100% test coverage (8 test cases)
  • Docs in all 4 languages (en, ko, ja, zh_hans)

Closes #1356

Test Plan

  • Freeze nested objects
  • Freeze nested arrays with nested objects
  • Return the same object reference
  • Handle primitives (number, string, null, undefined, boolean)
  • Handle deeply nested objects
  • Handle circular references
  • Handle empty objects
  • Prevent modifications in strict mode
  • Full test suite passes (4339 tests)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
es-toolkit Ready Ready Preview, Comment Apr 3, 2026 11:19am

Request Review

@sukvvon sukvvon marked this pull request as ready for review April 3, 2026 03:12
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.97%. Comparing base (cd553ee) to head (232e6a8).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1680   +/-   ##
=======================================
  Coverage   99.97%   99.97%           
=======================================
  Files         497      498    +1     
  Lines        4662     4672   +10     
  Branches     1348     1350    +2     
=======================================
+ Hits         4661     4671   +10     
  Misses          1        1           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add deepFreeze function to object utilities

2 participants