Skip to content

fix: handle objects with length or size in isEmpty (fixes #366)#474

Open
Sigmabrogz wants to merge 1 commit into
sodiray:masterfrom
Sigmabrogz:fix/isEmpty-length-bug
Open

fix: handle objects with length or size in isEmpty (fixes #366)#474
Sigmabrogz wants to merge 1 commit into
sodiray:masterfrom
Sigmabrogz:fix/isEmpty-length-bug

Conversation

@Sigmabrogz

Copy link
Copy Markdown

This PR fixes a bug in isEmpty where plain objects containing a length or size property with value 0 (such as { status: 'DRAFT', length: 0 }) are incorrectly identified as empty.

  • Limited .length checks to Array and String types.
  • Limited .size checks to Maps and Sets.
  • Added test coverage to prevent regression.

Fixes #366.

@vercel

vercel Bot commented Mar 19, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the rayunishinedev's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

isEmpty() returns true if one of the keys in object is "length"

1 participant