/** * 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 ); }