sindresorhus / is

Type check values
MIT License
1.68k stars 109 forks source link

feat: ensure there's at least 1 char in non-empty string #200

Closed simPod closed 1 year ago

simPod commented 1 year ago

This is useful e.g. when trying to leverage a non-empty string for accessing its first character. We can say there's always at least 1 char in non-empty string so this allows us to do s[0] with TS option noUncheckedIndexedAccess: true.