Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Latest commit

 

History

History
27 lines (21 loc) · 511 Bytes

callable.md

File metadata and controls

27 lines (21 loc) · 511 Bytes

Callable

Validates if the input is a callable.

Valid values:

const obj: any = {
    foo(): string {
        return 'foo';
    }
};

validator.callable().validate((): string => 'foo');
validator.callable().validate('eval');
validator.callable().validate('Array.isArray');
validator.callable().validate([obj, 'foo']);

Invalid values:

validator.callable().validate('');
validator.callable().validate('foo');
validator.callable().validate(null);
validator.callable().validate(undefined);