Skip to content

Commit e019da8

Browse files
committed
refactor(common): move back file type validator options type
1 parent b6078fd commit e019da8

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

packages/common/pipes/file/file-type.validator.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import { FileValidator } from './file-validator.interface';
2-
import { FileTypeValidatorOptions, IFile } from './interfaces';
2+
import { IFile } from './interfaces';
3+
4+
export type FileTypeValidatorOptions = {
5+
fileType: string | RegExp;
6+
7+
/**
8+
* If `true`, the validator will skip the magic numbers validation.
9+
* This can be useful when you can't identify some files as there are no common magic numbers available for some file types.
10+
* @default false
11+
*/
12+
skipMagicNumbersValidation?: boolean;
13+
};
314

415
/**
516
* Defines the built-in FileTypeValidator. It validates incoming files by examining

packages/common/pipes/file/interfaces/file.interface.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,3 @@ export interface IFile {
33
size: number;
44
buffer?: Buffer;
55
}
6-
7-
export type FileTypeValidatorOptions = {
8-
fileType: string | RegExp;
9-
10-
/**
11-
* If `true`, the validator will skip the magic numbers validation.
12-
* This can be useful when you can't identify some files as there are no common magic numbers available for some file types.
13-
* @default false
14-
*/
15-
skipMagicNumbersValidation?: boolean;
16-
};

packages/common/pipes/file/parse-file-pipe.builder.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { FileTypeValidator } from './file-type.validator';
1+
import {
2+
FileTypeValidator,
3+
FileTypeValidatorOptions,
4+
} from './file-type.validator';
25
import { FileValidator } from './file-validator.interface';
36
import {
47
MaxFileSizeValidator,
58
MaxFileSizeValidatorOptions,
69
} from './max-file-size.validator';
710
import { ParseFileOptions } from './parse-file-options.interface';
811
import { ParseFilePipe } from './parse-file.pipe';
9-
import { FileTypeValidatorOptions } from './interfaces';
1012

1113
/**
1214
* @publicApi

0 commit comments

Comments
 (0)