Type guard to check if a value is NOT an empty string
npm install @thinice/is-not-empty-stringType guard to check if a value is a non-empty string.
``bash`
npm install @thinice/is-not-empty-string
`typescript
import { isNotEmptyString } from "@thinice/is-not-empty-string";
isNotEmptyString("foo"); // true
isNotEmptyString(" "); // true (whitespace is not empty)
isNotEmptyString(""); // false
isNotEmptyString(null); // false (not a string)
isNotEmptyString(42); // false (not a string)
if (isNotEmptyString(value)) {
value.toUpperCase(); // value is string
}
``