@monstermann/fn
Version:
A utility library for TypeScript.
26 lines (24 loc) • 540 B
JavaScript
import { dfdlT } from "@monstermann/dfdl";
//#region src/set/isSet.ts
/**
* `isSet(target)`
*
* Checks if the `target` value is a Set instance. Returns `true` if the value is a Set, `false` otherwise.
*
* ```ts
* isSet(new Set([1, 2, 3])); // true
* isSet([1, 2, 3]); // false
* isSet({}); // false
* ```
*
* ```ts
* pipe(new Set([1, 2, 3]), isSet()); // true
* pipe([1, 2, 3], isSet()); // false
* pipe({}, isSet()); // false
* ```
*/
const isSet = dfdlT((target) => {
return target instanceof Set;
}, 1);
//#endregion
export { isSet };