UNPKG

saven

Version:
24 lines (20 loc) 574 B
import { onAndSyncApis, noPromiseApis, otherApis } from '@savenjs/saven' import request from './api/request' import storage from './api/storage' function processApis (taro) { const weApis = Object.assign({}, onAndSyncApis, noPromiseApis, otherApis) Object.keys(weApis).forEach(key => { taro[key] = () => { console.log(`暂时不支持 ${key}`) } }) } function canIUseWebp () { return true } export default function initNativeApi (taro) { processApis(taro) taro.request = request taro.canIUseWebp = canIUseWebp Object.assign(taro, storage) }