@qiniu/miku-delivery-mp-ks
Version:
Kuaishou Mini Program SDK for Miku Delivery
28 lines (27 loc) • 784 B
JavaScript
/**
* @file Vars from enviroment
*/
/** HTTPDNS resolve 接口地址 */
export const httpdnsResolveApi = 'https://api.qiniudns.com/v1/resolve';
/** Log 接口前缀 */
export const logApiPrefix = 'https://api.qiniudns.com';
/**
* 小程序平台,支持
*
* - 微信:`wx`
* - 抖音(头条):`tt`
* - 快手:`ks`
*
* 注入逻辑见 `build/inject-env.js`
*/
export const mpPlatform = assert('MP_PLATFORM', "ks", v => v === 'wx' || v === 'tt' || v === 'ks');
/**
* SDK 版本,形如 `0.1.0`;
* 注入逻辑见 `build/inject-env.js`
*/
export const version = assert('MP_VERSION', "1.2.1", v => typeof v === 'string');
function assert(name, v, check) {
if (check(v))
return v;
throw new Error(`Invalid value for env variable ${name}: ${v}`);
}