检查文件路径是否为图像
Check if a file path is an image
It just checks the extension. Use image-type if you want to check the actual file.
npm install is-imageimport isImage from 'is-image';
isImage('source/unicorn.png');
//=> true
isImage('source/unicorn.txt');
//=> false暂无开放 Issues,或尚未同步最近议题。