Skip to content

Commit

Permalink
refactor(guards): make isUnixTimestamp parameter optional
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornware committed May 7, 2022
1 parent 33dcfde commit 1a20135
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/guards/is-unix-timestamp.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { TimestampUnix } from '../types'
*
* [1]: https://unixtimestamp.com
*
* @param {any} timestamp - Value to check
* @param {any} [timestamp] - Value to check
* @return {boolean} `true` if `timestamp` is valid unix timestamp
*/
const isUnixTimestamp = (timestamp: any): timestamp is TimestampUnix => {
const isUnixTimestamp = (timestamp?: any): timestamp is TimestampUnix => {
return typeof timestamp === 'number' && new Date(timestamp).getTime() > 0
}

Expand Down

0 comments on commit 1a20135

Please sign in to comment.