miniprogram-platform 0.0.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/platform.js +23 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/platform.js +21 -0
- package/dist/index.d.ts +6 -0
- package/package.json +30 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
function getPlatform() {
|
|
5
|
+
let u = "undefined", f = "function", r = "request";
|
|
6
|
+
let platform;
|
|
7
|
+
platform =
|
|
8
|
+
(typeof wx !== u && typeof (wx === null || wx === void 0 ? void 0 : wx[r]) === f && wx && { mp: wx, name: "WeChat" }) || // 微信
|
|
9
|
+
(typeof my !== u && typeof (my === null || my === void 0 ? void 0 : my[r]) === f && my && { mp: my, name: "Alipay" }) || // 支付宝
|
|
10
|
+
(typeof qq !== u && typeof (qq === null || qq === void 0 ? void 0 : qq[r]) === f && qq && { mp: qq, name: "QQ" }) || // QQ
|
|
11
|
+
(typeof jd !== u && typeof (jd === null || jd === void 0 ? void 0 : jd[r]) === f && jd && { mp: jd, name: "JD" }) || // 京东
|
|
12
|
+
(typeof swan !== u && typeof (swan === null || swan === void 0 ? void 0 : swan[r]) === f && swan && { mp: swan, name: "Baidu" }) || // 百度
|
|
13
|
+
(typeof tt !== u && typeof (tt === null || tt === void 0 ? void 0 : tt[r]) === f && tt && { mp: tt, name: "ByteDance" }) || // 抖音 | 飞书
|
|
14
|
+
(typeof ks !== u && typeof (ks === null || ks === void 0 ? void 0 : ks[r]) === f && ks && { mp: ks, name: "Kwai" }) || // 快手
|
|
15
|
+
(typeof qh !== u && typeof (qh === null || qh === void 0 ? void 0 : qh[r]) === f && qh && { mp: qh, name: "Qihu" }) || // 360
|
|
16
|
+
(typeof xhs !== u && typeof (xhs === null || xhs === void 0 ? void 0 : xhs[r]) === f && xhs && { mp: xhs, name: "RedNote" }) || // 小红书
|
|
17
|
+
(typeof uni !== u && typeof (uni === null || uni === void 0 ? void 0 : uni[r]) === f && uni && { mp: uni, name: "UniApp" }) || // UniApp
|
|
18
|
+
(typeof Taro !== u && typeof (Taro === null || Taro === void 0 ? void 0 : Taro[r]) === f && Taro && { mp: Taro, name: "Taro" }) || // Taro
|
|
19
|
+
undefined;
|
|
20
|
+
return platform;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.getPlatform = getPlatform;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getPlatform } from './platform.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
function getPlatform() {
|
|
3
|
+
let u = "undefined", f = "function", r = "request";
|
|
4
|
+
let platform;
|
|
5
|
+
platform =
|
|
6
|
+
(typeof wx !== u && typeof (wx === null || wx === void 0 ? void 0 : wx[r]) === f && wx && { mp: wx, name: "WeChat" }) || // 微信
|
|
7
|
+
(typeof my !== u && typeof (my === null || my === void 0 ? void 0 : my[r]) === f && my && { mp: my, name: "Alipay" }) || // 支付宝
|
|
8
|
+
(typeof qq !== u && typeof (qq === null || qq === void 0 ? void 0 : qq[r]) === f && qq && { mp: qq, name: "QQ" }) || // QQ
|
|
9
|
+
(typeof jd !== u && typeof (jd === null || jd === void 0 ? void 0 : jd[r]) === f && jd && { mp: jd, name: "JD" }) || // 京东
|
|
10
|
+
(typeof swan !== u && typeof (swan === null || swan === void 0 ? void 0 : swan[r]) === f && swan && { mp: swan, name: "Baidu" }) || // 百度
|
|
11
|
+
(typeof tt !== u && typeof (tt === null || tt === void 0 ? void 0 : tt[r]) === f && tt && { mp: tt, name: "ByteDance" }) || // 抖音 | 飞书
|
|
12
|
+
(typeof ks !== u && typeof (ks === null || ks === void 0 ? void 0 : ks[r]) === f && ks && { mp: ks, name: "Kwai" }) || // 快手
|
|
13
|
+
(typeof qh !== u && typeof (qh === null || qh === void 0 ? void 0 : qh[r]) === f && qh && { mp: qh, name: "Qihu" }) || // 360
|
|
14
|
+
(typeof xhs !== u && typeof (xhs === null || xhs === void 0 ? void 0 : xhs[r]) === f && xhs && { mp: xhs, name: "RedNote" }) || // 小红书
|
|
15
|
+
(typeof uni !== u && typeof (uni === null || uni === void 0 ? void 0 : uni[r]) === f && uni && { mp: uni, name: "UniApp" }) || // UniApp
|
|
16
|
+
(typeof Taro !== u && typeof (Taro === null || Taro === void 0 ? void 0 : Taro[r]) === f && Taro && { mp: Taro, name: "Taro" }) || // Taro
|
|
17
|
+
undefined;
|
|
18
|
+
return platform;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { getPlatform };
|
package/dist/index.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "miniprogram-platform",
|
|
3
|
+
"version": "0.0.1-beta",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Xingzeng Bao",
|
|
6
|
+
"homepage": "",
|
|
7
|
+
"description": "",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/cjs/index.js",
|
|
10
|
+
"module": "dist/esm/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"README.md",
|
|
14
|
+
"dist",
|
|
15
|
+
"!dist/types/**/*",
|
|
16
|
+
"!dist/cjs/types/**/*",
|
|
17
|
+
"!dist/esm/types/**/*"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rollup --config",
|
|
22
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
26
|
+
"rollup": "^4.61.0",
|
|
27
|
+
"rollup-plugin-dts": "^6.4.1",
|
|
28
|
+
"tslib": "^2.8.1"
|
|
29
|
+
}
|
|
30
|
+
}
|