var _isSupportWebp;

/**
 * 判断是否支持webp
 */
function isSupportWebp() {
  if (_isSupportWebp === undefined) {
    try {
      _isSupportWebp = document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') > -1;
    } catch (err) {
      _isSupportWebp = false;
    }
  }

  return _isSupportWebp;
}

export default isSupportWebp;
