sodiray / radash

Functional utility library - modern, simple, typed, powerful
https://radash-docs.vercel.app
MIT License
4.18k stars 167 forks source link

Boolean true/false shouldn't count as empty for isEmpty #318

Open icopp opened 1 year ago

icopp commented 1 year ago

See: https://github.com/rayepps/radash/blob/03dd3152f560414e933cedcd3bda3c6db3e8306b/src/typed.ts#L68

I think it's reasonable to say that most people would find this an unintuitive result, as an explicit true or false is a value that definitely exists.

lamuertepeluda commented 5 months ago

why is a boolean considered empty? And why

1) this is not documented here 2) there si no isNil() that returns true only for undefined or null values?

aleclarson commented 2 months ago

It seems this function is meant to mirror the behavior of lodash.isempty

https://runkit.com/aleclarson/667b64e34cb4b30008f31679