es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
25 lines (24 loc) • 675 B
JavaScript
import { isSet as isSet$1 } from "../../predicate/isSet.mjs";
//#region src/compat/predicate/isSet.ts
/**
* Checks if a given value is `Set`.
*
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `Set`.
*
* @param value The value to check if it is a `Set`.
* @returns Returns `true` if `value` is a `Set`, else `false`.
*
* @example
* const value1 = new Set();
* const value2 = new Map();
* const value3 = new WeakSet();
*
* console.log(isSet(value1)); // true
* console.log(isSet(value2)); // false
* console.log(isSet(value3)); // false
*/
function isSet(value) {
return isSet$1(value);
}
//#endregion
export { isSet };