TypeScript API / laikacms/file-sanitizer / FileSanitizer
Interface: FileSanitizer
Interface for file type specific sanitizers
Properties
fileType
ts
readonly fileType: SanitizableFileType;The file type this sanitizer handles
Methods
canHandle()
ts
canHandle(data): boolean;Check if this sanitizer can handle the given data
Parameters
| Parameter | Type |
|---|---|
data | Uint8Array |
Returns
boolean
sanitize()
ts
sanitize(data, options): Promise<SanitizeResult>;Sanitize the file data
Parameters
| Parameter | Type |
|---|---|
data | Uint8Array |
options | SanitizeOptions |
Returns
Promise<SanitizeResult>
Throws
if the file is corrupted