Created
September 25, 2023 03:40
-
-
Save techieshark/782d59fe7ba21f78662e5b5112542242 to your computer and use it in GitHub Desktop.
Revisions
-
techieshark created this gist
Sep 25, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ /** * Is `s` both 1) defined, 2) a string, and 3) not empty? * Can also be used as a TS type predicate to remove `undefined` values. */ export function isNonEmptyString(s?: string): s is string { return Boolean( typeof s === 'string' && s.length > 0 ); }