Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
//#region src/compat/predicate/isString.ts
/**
* Checks if a given value is string.
*
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `string`.
*
* @param {unknown} value The value to check if it is string.
* @returns {value is string} Returns `true` if `value` is a string, else `false`.
*
* @example
* const value1 = 'abc';
* const value2 = 123;
* const value3 = true;
*
* console.log(isString(value1)); // true
* console.log(isString(value2)); // false
* console.log(isString(value3)); // false
*/
function isString(value) {
return typeof value === "string" || value instanceof String;
}
//#endregion
export { isString };