@resk/core
Version:
An innovative TypeScript framework that empowers developers to build applications with a fully decorator-based architecture for efficient resource management. By combining the power of decorators with a resource-oriented design, DecorRes enhances code cla
18 lines (17 loc) • 665 B
TypeScript
/**
* Checks if the provided value is a non-empty string.
*
* A value is considered a non-empty string if it is not null and is a string.
*
* @param {any} val The value to check.
* @returns {boolean} True if the value is a non-empty string, false otherwise.
* @example
* ```typescript
* console.log(isNonNullString('hello')); // Output: true
* console.log(isNonNullString('')); // Output: false
* console.log(isNonNullString(null)); // Output: false
* console.log(isNonNullString(undefined)); // Output: false
* console.log(isNonNullString(123)); // Output: false
* ```
*/
export default function isNonNullString<T = any>(val: T): val is T & string;