@ray-js/api 0.6.17 → 0.6.19

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.
Files changed (2) hide show
  1. package/lib/utils.js +7 -4
  2. package/package.json +5 -5
package/lib/utils.js CHANGED
@@ -3,22 +3,25 @@ import { isWechat } from '@ray-js/env';
3
3
  export function factory(name) {
4
4
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5
5
  return function () {
6
- var _ty$opts$namespace;
6
+ var _inst$opts$namespace;
7
7
 
8
8
  if (opts.deprecated) {
9
9
  console.warn("\u8BE5\u65B9\u6CD5 ".concat(name, " \u5DF2\u5F03\u7528"));
10
10
  }
11
11
 
12
12
  if (isWechat) {
13
- if (!wx[name]) {
13
+ var _inst = typeof wx === 'undefined' ? {} : wx;
14
+
15
+ if (!_inst[name]) {
14
16
  console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u65B9\u6CD5 wx.".concat(name));
15
17
  return;
16
18
  }
17
19
 
18
- return wx[name].apply(this, arguments);
20
+ return _inst[name].apply(this, arguments);
19
21
  }
20
22
 
21
- var method = opts.namespace ? ((_ty$opts$namespace = ty[opts.namespace]) !== null && _ty$opts$namespace !== void 0 ? _ty$opts$namespace : {})[name] : ty[name];
23
+ var inst = typeof ty === 'undefined' ? {} : ty;
24
+ var method = opts.namespace ? ((_inst$opts$namespace = inst[opts.namespace]) !== null && _inst$opts$namespace !== void 0 ? _inst$opts$namespace : {})[name] : inst[name];
22
25
 
23
26
  if (!method) {
24
27
  console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u65B9\u6CD5 ".concat(opts.namespace ? opts.namespace + '.' : '').concat(name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "0.6.17",
3
+ "version": "0.6.19",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -26,11 +26,11 @@
26
26
  "build:kit:api": "node scripts/api-creator.mjs"
27
27
  },
28
28
  "dependencies": {
29
- "@ray-js/framework": "^0.6.17",
30
- "@ray-js/router": "^0.6.17"
29
+ "@ray-js/framework": "^0.6.19",
30
+ "@ray-js/router": "^0.6.19"
31
31
  },
32
32
  "devDependencies": {
33
- "@ray-js/cli": "^0.6.17",
33
+ "@ray-js/cli": "^0.6.19",
34
34
  "art-template": "^4.13.2",
35
35
  "fs-extra": "^10.1.0",
36
36
  "miniprogram-api-typings": "^3.4.3",
@@ -42,6 +42,6 @@
42
42
  "email": "tuyafe@tuya.com"
43
43
  }
44
44
  ],
45
- "gitHead": "a098d6138bbfc1210f9b2c166dfe983b9a86cc40",
45
+ "gitHead": "5636ff7eb026ed0c16d309c1277bb755810163db",
46
46
  "repository": {}
47
47
  }