@ray-js/api 1.0.2 → 1.0.3

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/lib/utils.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import "core-js/modules/es.array.concat.js";
2
- import { isWechat } from '@ray-js/env';
3
2
  export function factory(name) {
4
3
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5
4
  return function () {
@@ -9,17 +8,6 @@ export function factory(name) {
9
8
  console.warn("\u8BE5\u65B9\u6CD5 ".concat(name, " \u5DF2\u5F03\u7528"));
10
9
  }
11
10
 
12
- if (isWechat) {
13
- var _inst = typeof wx === 'undefined' ? {} : wx;
14
-
15
- if (!_inst[name]) {
16
- console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u65B9\u6CD5 wx.".concat(name));
17
- return;
18
- }
19
-
20
- return _inst[name].apply(this, arguments);
21
- }
22
-
23
11
  var inst = typeof ty === 'undefined' ? {} : ty;
24
12
  var method = opts.namespace ? ((_inst$opts$namespace = inst[opts.namespace]) !== null && _inst$opts$namespace !== void 0 ? _inst$opts$namespace : {})[name] : inst[name];
25
13
 
@@ -38,17 +26,6 @@ export function factoryContants(name) {
38
26
  console.warn("\u8BE5\u53D8\u91CF ".concat(name, " \u5DF2\u5F03\u7528"));
39
27
  }
40
28
 
41
- if (isWechat) {
42
- var _inst2 = typeof wx === 'undefined' ? {} : wx;
43
-
44
- if (!_inst2[name]) {
45
- console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u53D8\u91CF wx.".concat(name));
46
- return;
47
- }
48
-
49
- return _inst2[name];
50
- }
51
-
52
29
  var inst = typeof ty === 'undefined' ? {} : ty;
53
30
 
54
31
  if (!inst[name]) {
@@ -6,4 +6,5 @@ export declare function factory(name: string, opts?: Opts): (option: {
6
6
  key: string;
7
7
  data?: any;
8
8
  }) => any;
9
+ export declare function factoryContants(name: string, opts?: Opts): any;
9
10
  export {};
@@ -34,4 +34,20 @@ export function factory(name) {
34
34
 
35
35
  return wx[name].apply(this, arguments);
36
36
  };
37
+ }
38
+ export function factoryContants(name) {
39
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
40
+
41
+ if (opts.deprecated) {
42
+ console.warn("\u8BE5\u53D8\u91CF ".concat(name, " \u5DF2\u5F03\u7528"));
43
+ }
44
+
45
+ var inst = typeof wx === 'undefined' ? {} : wx;
46
+
47
+ if (!inst[name]) {
48
+ console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u53D8\u91CF ".concat(name));
49
+ return;
50
+ }
51
+
52
+ return inst[name];
37
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -26,13 +26,13 @@
26
26
  "build:kit:api": "node scripts/api-creator.mjs"
27
27
  },
28
28
  "dependencies": {
29
- "@ray-js/framework": "^1.0.2",
30
- "@ray-js/router": "^1.0.2",
31
- "@ray-js/wechat": "^0.0.8",
29
+ "@ray-js/framework": "^1.0.3",
30
+ "@ray-js/router": "^1.0.3",
31
+ "@ray-js/wechat": "^0.0.16",
32
32
  "base64-browser": "^1.0.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@ray-js/cli": "^1.0.2",
35
+ "@ray-js/cli": "^1.0.3",
36
36
  "art-template": "^4.13.2",
37
37
  "fs-extra": "^10.1.0",
38
38
  "miniprogram-api-typings": "^3.4.3",
@@ -44,6 +44,6 @@
44
44
  "email": "tuyafe@tuya.com"
45
45
  }
46
46
  ],
47
- "gitHead": "d8691c70c89bde2745befe845aeed6d184709bc4",
47
+ "gitHead": "7a18f8a7c25ba12c499e2a7ac6fc6317c315bdf0",
48
48
  "repository": {}
49
49
  }