import Taro from '@tarojs/taro'

// 获取当前平台
export const getPlatform = () => {
  return Taro.getEnv()
}

// 是否为小程序
export const isWeapp = (): boolean => {
  return getPlatform() === Taro.ENV_TYPE.WEAPP
}

// 是否为H5
export const isH5 = (): boolean => {
  return getPlatform() === Taro.ENV_TYPE.WEB
}