remeda
Version:
A utility library for JavaScript and Typescript.
1 lines • 607 B
Source Map (JSON)
{"version":3,"file":"isDate.cjs","names":[],"sources":["../src/isDate.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is a Date and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a Date, false otherwise.\n * @signature\n * R.isDate(data)\n * @example\n * R.isDate(new Date()) //=> true\n * R.isDate('somethingElse') //=> false\n * @category Guard\n */\nexport function isDate(data: unknown): data is Date {\n return data instanceof Date;\n}\n"],"mappings":"AAYA,SAAgB,EAAO,EAA6B,CAClD,OAAO,aAAgB"}