purescript/purescript-strings

Data.String.null

dbushenko opened this issue · 5 comments

Please check if variable s is not null before calling s.length

I'm not sure this should be done.
I wouldn't advise passing null around pretending it's a string.
If a null check is added here, it'd be inconsistent not to check on every function.
The function Data.String.null is a check for if a string is empty, nothing to do with JavaString null.

Agreed, a null string as input is a sign something is wrong elsewhere.

Another 👎 - the value should be a Nullable String or read as a Maybe String or something before reaching the functions in here most likely.

I believe this can be closed?

Agreed, thanks.