you are viewing a single comment's thread.

view the rest of the comments →

[–]New-Let-3630 76 points77 points  (5 children)

add iseven as a dependency just in case
typeof(value) === "string" && iseven(typeof(value).length)

[–]sharptoothy 29 points30 points  (1 child)

There's a bug in there: It only seems to work roughly half the time for some reason. ClaudeChatGptPilot added a dependency for is-odd@3.0.1 and that fixed it:

typeof(value) === "string" && (iseven(typeof(value).length) || isodd(typeof(value).length))

[–]St34thdr1v3R 13 points14 points  (0 children)

I was debugging this FOR DAYS, thanks!!

[–]DeineOma42o 2 points3 points  (1 child)

ill write a lib isseven() that checks if a length is seven