diff --git a/src/guards/__tests__/is-unix-timestamp.spec-d.ts b/src/guards/__tests__/is-unix-timestamp.spec-d.ts deleted file mode 100644 index 0e81ea15..00000000 --- a/src/guards/__tests__/is-unix-timestamp.spec-d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file Type Tests - isUnixTimestamp - * @module tutils/guards/tests/unit-d/isUnixTimestamp - */ - -import type { TimestampUnix } from '#src/types' -import type testSubject from '../is-unix-timestamp' - -describe('unit-d:guards/isUnixTimestamp', () => { - it('should guard TimestampUnix', () => { - expectTypeOf().guards.toEqualTypeOf() - }) -}) diff --git a/src/guards/__tests__/is-unix-timestamp.spec.ts b/src/guards/__tests__/is-unix-timestamp.spec.ts deleted file mode 100644 index bd247562..00000000 --- a/src/guards/__tests__/is-unix-timestamp.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @file Unit Tests - isUnixTimestamp - * @module tutils/guards/tests/unit/isUnixTimestamp - */ - -import type { TestcaseFn } from '#tests/interfaces' -import testSubject from '../is-unix-timestamp' - -describe('unit:guards/isUnixTimestamp', () => { - interface Case extends TestcaseFn {} - - const cases: Case[] = [ - { expected: false, parameters: [null] }, - { expected: true, parameters: [Date.now()] } - ] - - cases.forEach(({ expected, parameters }) => { - it(`should return ${expected} given ${pf(parameters)}`, () => { - expect(testSubject(...parameters)).to.equal(expected) - }) - }) -}) diff --git a/src/guards/index.ts b/src/guards/index.ts index 25e76bb1..8823acdd 100644 --- a/src/guards/index.ts +++ b/src/guards/index.ts @@ -10,4 +10,3 @@ export { default as isEmptyValue } from './is-empty-value' export { default as isJwtType } from './is-jwt-type' export { default as isNIL } from './is-nil' export { default as isNodeEnv } from './is-node-env' -export { default as isUnixTimestamp } from './is-unix-timestamp' diff --git a/src/guards/is-unix-timestamp.ts b/src/guards/is-unix-timestamp.ts deleted file mode 100644 index d8a377b0..00000000 --- a/src/guards/is-unix-timestamp.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file Type Guards - isUnixTimestamp - * @module tutils/guards/isUnixTimestamp - */ - -import type { TimestampUnix } from '#src/types' - -/** - * Checks if the given `value` is a valid [unix timestamp][1]. - * - * [1]: https://unixtimestamp.com - * - * @param {unknown} value - Value to evaluate - * @return {value is TimestampUnix} `true` if `value` is valid unix timestamp - */ -const isUnixTimestamp = (value: unknown): value is TimestampUnix => { - return typeof value === 'number' && new Date(value).getTime() > 0 -} - -export default isUnixTimestamp