diff --git a/core/src/utils/floating-point/index.ts b/core/src/utils/floating-point/index.ts index 1e25ea3719..1ece5510c8 100644 --- a/core/src/utils/floating-point/index.ts +++ b/core/src/utils/floating-point/index.ts @@ -1,4 +1,4 @@ -import { isSafeNumber } from '../type-guards.ts'; +import { isSafeNumber } from "@utils/helpers"; export function getDecimalPlaces(n: number) { if (!isSafeNumber(n)) return 0; diff --git a/core/src/utils/helpers.ts b/core/src/utils/helpers.ts index a740ff98ac..a005686b77 100644 --- a/core/src/utils/helpers.ts +++ b/core/src/utils/helpers.ts @@ -424,3 +424,10 @@ export const getNextSiblingOfType = (element: Element): T | n } return null; }; + +/** + * Checks input for usable number. Not NaN and not Infinite. + */ +export const isSafeNumber = (input: unknown): input is number => { + return typeof input === 'number' && !isNaN(input) && isFinite(input); +}; diff --git a/core/src/utils/type-guards.ts b/core/src/utils/type-guards.ts deleted file mode 100644 index e5ea629954..0000000000 --- a/core/src/utils/type-guards.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Checks input for usable number. Not NaN and not Infinite. - */ -export const isSafeNumber = (input: unknown): input is number => { - return typeof input === 'number' && !isNaN(input) && isFinite(input); -};