@monstermann/fn
Version:
A utility library for TypeScript.
24 lines (22 loc) • 434 B
JavaScript
import { dfdlT } from "@monstermann/dfdl";
//#region src/function/isSymbol.ts
/**
* `isSymbol(target)`
*
* Checks if a value is a symbol.
*
* ```ts
* isSymbol(Symbol("test")); // true
* isSymbol("test"); // false
* ```
*
* ```ts
* pipe(Symbol("test"), isSymbol()); // true
* pipe("test", isSymbol()); // false
* ```
*/
const isSymbol = dfdlT((target) => {
return typeof target === "symbol";
}, 1);
//#endregion
export { isSymbol };