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

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`.
This commit is contained in:
Simon Podlipsky 2023-10-26 14:56:07 +02:00
parent f10e2caf3d
commit ab4a3e99a0
No known key found for this signature in database
GPG key ID: 9EEEDB31F3A8D760
2 changed files with 5 additions and 2 deletions

View file

@ -73,3 +73,5 @@ export type NodeStream = {
} & NodeJS.EventEmitter;
export type Predicate = (value: unknown) => boolean;
export type NonEmptyString = string & {0: string};