1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00

Merge branch 'dev' of https://github.com/youzan/vant into dev

This commit is contained in:
陈嘉涵 2019-05-16 11:09:35 +08:00
commit 3b89baedab
2 changed files with 2 additions and 1 deletions
packages/utils

@ -88,4 +88,5 @@ test('is-src', () => {
expect(isSrc('')).toBeFalsy();
expect(isSrc('blob:http://img.cdn.com')).toBeTruthy();
expect(isSrc('blob:https://img.cdn.com')).toBeTruthy();
expect(isSrc('xdata:image/jpeg;base64,/9j/4AAQSkZ')).toBeFalsy();
});

@ -2,5 +2,5 @@
* Is image source
*/
export function isSrc(url: string): boolean {
return /^((blob:)?https?:)?\/\/|data:image/.test(url);
return /^(((blob:)?https?:)?\/\/|data:image)/.test(url);
}