Skip to content

Commit

Permalink
feat(core): add isFileConstructor util
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Nov 10, 2021
1 parent e896a22 commit 54d2b65
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export * from './is-empty.util';
export * from './is-defined.util';
export * from './is-primitive-constructor.util';
export * from './is-date-constructor.util';
export * from './is-file-constructor.util';
export * from './is-resolver.util';
3 changes: 3 additions & 0 deletions packages/core/src/lib/utils/is-file-constructor.util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function isFileConstructor(value: unknown): boolean {
return value === File;
}
8 changes: 8 additions & 0 deletions packages/core/src/lib/utils/specs/is-file-constructor.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { isFileConstructor } from '../is-file-constructor.util';

describe('isFileConstructor', () => {
it('should work', () => {
expect(isFileConstructor(File)).toEqual(true);
expect(isFileConstructor(Date)).toEqual(false);
});
});

0 comments on commit 54d2b65

Please sign in to comment.