Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/hooks/src/useCountDown/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dayjs from 'dayjs';
import { useEffect, useMemo, useState } from 'react';
import useLatest from '../useLatest';
import { isNumber } from '../utils/index';
import { isNumber } from '../utils';

export type TDate = dayjs.ConfigType;

Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/utils/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import { isBoolean, isFunction, isNumber, isObject, isString, isUndef } from '../index';
import { isBoolean, isFunction, isNumber, isObject, isString, isUndef } from '../';
Comment thread
li-jia-nan marked this conversation as resolved.

describe('shared utils methods', () => {
test('isBoolean', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/hooks/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export const isFunction = (value: unknown): value is (...args: any) => any =>
typeof value === 'function';
export const isString = (value: unknown): value is string => typeof value === 'string';
export const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';
export const isNumber = (value: unknown): value is number => typeof value === 'number';
export const isNumber = (value: unknown): value is number =>
typeof value === 'number' && !Number.isNaN(value);
export const isUndef = (value: unknown): value is undefined => typeof value === 'undefined';
Loading