diff --git a/packages/classes/src/lib/utils/index.ts b/packages/classes/src/lib/utils/index.ts index 8d577f8b3..378040a0d 100644 --- a/packages/classes/src/lib/utils/index.ts +++ b/packages/classes/src/lib/utils/index.ts @@ -1,4 +1,2 @@ export * from './instantiate.util'; -export * from './is-primitive-constructor.util'; -export * from './is-date-constructor.util'; export * from './is-class.util'; diff --git a/packages/classes/src/lib/utils/instantiate.util.ts b/packages/classes/src/lib/utils/instantiate.util.ts index 4fd8d2bd1..f166d6b01 100644 --- a/packages/classes/src/lib/utils/instantiate.util.ts +++ b/packages/classes/src/lib/utils/instantiate.util.ts @@ -1,9 +1,12 @@ -import { isDefined, isEmpty } from '@automapper/core'; +import { + isDateConstructor, + isDefined, + isEmpty, + isPrimitiveConstructor, +} from '@automapper/core'; import type { Dictionary } from '@automapper/types'; import type { ClassInstanceStorage, ClassMetadataStorage } from '../storages'; import type { Constructible } from '../types'; -import { isDateConstructor } from './is-date-constructor.util'; -import { isPrimitiveConstructor } from './is-primitive-constructor.util'; /** * Recursively instantiate a model with its metadata diff --git a/packages/classes/src/lib/utils/is-date-constructor.util.ts b/packages/classes/src/lib/utils/is-date-constructor.util.ts deleted file mode 100644 index 9d1e56f89..000000000 --- a/packages/classes/src/lib/utils/is-date-constructor.util.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Check if value is a Date constructor - * - * @param {Function} value - */ -export function isDateConstructor(value: unknown): boolean { - return value === Date; -} diff --git a/packages/classes/src/lib/utils/is-primitive-constructor.util.ts b/packages/classes/src/lib/utils/is-primitive-constructor.util.ts deleted file mode 100644 index ec9285ca9..000000000 --- a/packages/classes/src/lib/utils/is-primitive-constructor.util.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Check if value is a String/Number/Boolean constructor - * - * @param {Function} value - */ -export function isPrimitiveConstructor(value: unknown): boolean { - return ( - value === String || value === Number || value === Boolean || value === Array - ); -} diff --git a/packages/classes/src/lib/utils/specs/is-date-constructor.util.spec.ts b/packages/classes/src/lib/utils/specs/is-date-constructor.util.spec.ts deleted file mode 100644 index fa7517c18..000000000 --- a/packages/classes/src/lib/utils/specs/is-date-constructor.util.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { isDateConstructor } from '../is-date-constructor.util'; - -describe('isDateConstructor', () => { - it('should work', () => { - expect(isDateConstructor(Date)).toEqual(true); - expect(isDateConstructor(String)).toEqual(false); - expect(isDateConstructor(Number)).toEqual(false); - }); -}); diff --git a/packages/classes/src/lib/utils/specs/is-primitive-constructor.util.spec.ts b/packages/classes/src/lib/utils/specs/is-primitive-constructor.util.spec.ts deleted file mode 100644 index 9be0ef551..000000000 --- a/packages/classes/src/lib/utils/specs/is-primitive-constructor.util.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { isPrimitiveConstructor } from '../is-primitive-constructor.util'; - -describe('isPrimitiveConstructor', () => { - it('should work', () => { - expect(isPrimitiveConstructor(String)).toEqual(true); - expect(isPrimitiveConstructor(Number)).toEqual(true); - expect(isPrimitiveConstructor(Boolean)).toEqual(true); - expect(isPrimitiveConstructor(Array)).toEqual(true); - expect(isPrimitiveConstructor(Date)).toEqual(false); - }); -});