Skip to content

TypeScript API / laikacms/file-sanitizer / JpegSanitizer

Class: JpegSanitizer ​

Interface for file type specific sanitizers

Implements ​

Constructors ​

Constructor ​

ts
new JpegSanitizer(): JpegSanitizer;

Returns ​

JpegSanitizer

Properties ​

fileType ​

ts
readonly fileType: "jpeg";

The file type this sanitizer handles

Implementation of ​

FileSanitizer.fileType

Methods ​

canHandle() ​

ts
canHandle(data): boolean;

Check if this sanitizer can handle the given data

Parameters ​

ParameterType
dataUint8Array

Returns ​

boolean

Implementation of ​

FileSanitizer.canHandle


sanitize() ​

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

Sanitize the file data

Parameters ​

ParameterType
dataUint8Array
_optionsSanitizeOptions

Returns ​

Promise<SanitizeResult>

Throws ​

if the file is corrupted

Implementation of ​

FileSanitizer.sanitize

Released under the MIT License.