Skip to content

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 ​

ParameterType
dataUint8Array

Returns ​

boolean


sanitize() ​

ts
sanitize(data, options): Promise<SanitizeResult>;

Sanitize the file data

Parameters ​

ParameterType
dataUint8Array
optionsSanitizeOptions

Returns ​

Promise<SanitizeResult>

Throws ​

if the file is corrupted

Released under the MIT License.