@valkyriestudios/validator
Version:
A lightweight configurable javascript validator
33 lines (32 loc) • 1.14 kB
TypeScript
export declare const IMAGE_EXTENSIONS: Set<string>;
export declare const VIDEO_EXTENSIONS: Set<string>;
export declare const AUDIO_EXTENSIONS: Set<string>;
export declare const MEDIA_EXTENSIONS: Set<string>;
/**
* Validate that a provided value is a url linking to an image file (eg: https://mywebsite.com/123.jpg)
*
* @param {unknown} val - Value to verify
*/
declare function vUrlImage(val: unknown): val is string;
/**
* Validate that a provided value is a url linking to a video file
* (eg: https://mywebsite.com/123.mp4)
*
* @param {unknown} val - Value to verify
*/
declare function vUrlVideo(val: unknown): val is string;
/**
* Validate that a provided value is a url linking to an audio file
* (eg: https://mywebsite.com/123.mp4)
*
* @param {unknown} val - Value to verify
*/
declare function vUrlAudio(val: unknown): val is string;
/**
* Validate that a provided value is a url linking to an audio/video/image file
* (eg: https://mywebsite.com/123.mp4)
*
* @param {unknown} val - Value to verify
*/
declare function vUrlMedia(val: unknown): val is string;
export { vUrlImage, vUrlVideo, vUrlAudio, vUrlMedia };