@ray-js/api 1.7.52 → 1.7.54

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 (46) hide show
  1. package/@types/api-extend.d.ts +56 -11
  2. package/lib/cloud/alarm.js +2 -2
  3. package/lib/cloud/core.js +1 -1
  4. package/lib/cloud/device.js +8 -7
  5. package/lib/cloud/deviceFile.js +5 -5
  6. package/lib/cloud/doorlock/auth.js +8 -8
  7. package/lib/cloud/doorlock/device.js +13 -13
  8. package/lib/cloud/doorlock/fittings.js +4 -4
  9. package/lib/cloud/doorlock/log.js +7 -7
  10. package/lib/cloud/doorlock/member-opmode.js +6 -6
  11. package/lib/cloud/doorlock/member.js +13 -13
  12. package/lib/cloud/doorlock/offline-pwd.js +4 -4
  13. package/lib/cloud/doorlock/sence.js +3 -3
  14. package/lib/cloud/doorlock/service.js +1 -1
  15. package/lib/cloud/doorlock/setting.js +11 -11
  16. package/lib/cloud/doorlock/temp-pwd.js +7 -7
  17. package/lib/cloud/doorlock/unlock-method.js +3 -3
  18. package/lib/cloud/doorlock/unlock.js +3 -3
  19. package/lib/cloud/electrician/tariffService.js +2 -2
  20. package/lib/cloud/highlights.js +8 -7
  21. package/lib/cloud/linkage.js +17 -17
  22. package/lib/cloud/outdoor.js +9 -9
  23. package/lib/cloud/recipe/basket.js +11 -10
  24. package/lib/cloud/recipe/category-list.js +2 -2
  25. package/lib/cloud/recipe/custom.js +5 -4
  26. package/lib/cloud/recipe/menu.js +6 -5
  27. package/lib/cloud/recipe/query.js +4 -3
  28. package/lib/cloud/recipe/record.js +3 -3
  29. package/lib/cloud/recipe/score.js +4 -3
  30. package/lib/cloud/recipe/star.js +6 -5
  31. package/lib/cloud/remoteGroup.js +2 -2
  32. package/lib/cloud/statistic.js +9 -9
  33. package/lib/cloud/timer.js +14 -14
  34. package/lib/getBoundingClientRect/index.thing.js +1 -0
  35. package/lib/getBoundingClientRect/index.wechat.js +1 -0
  36. package/lib/getCdnUrl/index.thing.js +20 -18
  37. package/lib/getCdnUrl/index.wechat.js +5 -5
  38. package/lib/getElementById/index.thing.js +1 -1
  39. package/lib/getElementById/index.wechat.js +1 -1
  40. package/lib/panel/i18n/index.js +16 -12
  41. package/lib/panel/i18n/index.wechat.js +16 -12
  42. package/lib/panel/publishDps.js +1 -1
  43. package/lib/redirectTo/index.js +2 -0
  44. package/lib/utils.js +9 -9
  45. package/lib/utils.wechat.js +6 -5
  46. package/package.json +5 -5
@@ -1,3 +1,5 @@
1
+ import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
1
3
  import get from 'lodash/get';
2
4
  const regionMap = {
3
5
  AY: 'https://images.tuyacn.com',
@@ -46,9 +48,9 @@ export function getRegionCode() {
46
48
  const concatRegionOrigin = (regionCode, path) => {
47
49
  const regionOrigin = get(regionMap, [regionCode]) || get(regionMap, ['EU']);
48
50
  if (path.indexOf('/') === 0) {
49
- return `${regionOrigin}${path}`;
51
+ return "".concat(regionOrigin).concat(path);
50
52
  }
51
- return `${regionOrigin}/${path}`;
53
+ return "".concat(regionOrigin, "/").concat(path);
52
54
  };
53
55
  const isEmptyOrUndefined = obj => {
54
56
  return !obj || Object.keys(obj).length === 0;
@@ -66,10 +68,10 @@ const buildOperationChain = opts => {
66
68
  y
67
69
  } = opts.crop;
68
70
  const cropParts = ['crop'];
69
- if (w != null) cropParts.push(`w_${w}`);
70
- if (h != null) cropParts.push(`h_${h}`);
71
- if (x != null) cropParts.push(`x_${x}`);
72
- if (y != null) cropParts.push(`y_${y}`);
71
+ if (w != null) cropParts.push("w_".concat(w));
72
+ if (h != null) cropParts.push("h_".concat(h));
73
+ if (x != null) cropParts.push("x_".concat(x));
74
+ if (y != null) cropParts.push("y_".concat(y));
73
75
  seg.push(cropParts.join(','));
74
76
  }
75
77
  if (opts.resize && !isEmptyOrUndefined(opts.resize)) {
@@ -78,15 +80,15 @@ const buildOperationChain = opts => {
78
80
  h
79
81
  } = opts.resize;
80
82
  const resizeParts = ['resize'];
81
- if (w != null) resizeParts.push(`w_${w}`);
82
- if (h != null) resizeParts.push(`h_${h}`);
83
+ if (w != null) resizeParts.push("w_".concat(w));
84
+ if (h != null) resizeParts.push("h_".concat(h));
83
85
  seg.push(resizeParts.join(','));
84
86
  }
85
87
  if (opts.rotate && opts.rotate.value) {
86
- seg.push(`rotate,${opts.rotate.value}`);
88
+ seg.push("rotate,".concat(opts.rotate.value));
87
89
  }
88
90
  if (opts.format && opts.format.value) {
89
- seg.push(`format,${opts.format.value}`);
91
+ seg.push("format,".concat(opts.format.value));
90
92
  }
91
93
  if (seg.length === 1) return '';
92
94
  return seg.join('/');
@@ -98,12 +100,12 @@ const buildProcessQuery = (regionCode, opts) => {
98
100
  const chain = buildOperationChain(opts);
99
101
  if (!chain) return '';
100
102
  const key = regionCode === 'AY' ? 'x-oss-process' : 'process';
101
- return `${key}=${chain}`;
103
+ return "".concat(key, "=").concat(chain);
102
104
  };
103
105
  const appendQuery = (url, query) => {
104
106
  if (!query) return url;
105
- if (url.indexOf('?') === -1) return `${url}?${query}`;
106
- return url.endsWith('?') || url.endsWith('&') ? `${url}${query}` : `${url}&${query}`;
107
+ if (url.indexOf('?') === -1) return "".concat(url, "?").concat(query);
108
+ return url.endsWith('?') || url.endsWith('&') ? "".concat(url).concat(query) : "".concat(url, "&").concat(query);
107
109
  };
108
110
 
109
111
  /**
@@ -122,7 +124,7 @@ export default function getCdnUrl(path, cdnMap, region, process) {
122
124
  const queryPart = buildProcessQuery(regionCode, process);
123
125
  if (isEmptyOrUndefined(cdnMap)) {
124
126
  if (hasProcess && regionCode !== 'AY') {
125
- const url = path.indexOf('/') === 0 ? `${unifiedProcessDomain}${path}` : `${unifiedProcessDomain}/${path}`;
127
+ const url = path.indexOf('/') === 0 ? "".concat(unifiedProcessDomain).concat(path) : "".concat(unifiedProcessDomain, "/").concat(path);
126
128
  return appendQuery(url, queryPart);
127
129
  }
128
130
  return appendQuery(concatRegionOrigin(regionCode, path), queryPart);
@@ -131,9 +133,9 @@ export default function getCdnUrl(path, cdnMap, region, process) {
131
133
  // 总是使用 EU 进行兜底
132
134
  const cdnShortPath = get(cdnMap, [regionCode, path]) || get(cdnMap, ['EU', path]) || get(cdnMap, [path]);
133
135
  if (!cdnShortPath) {
134
- console.warn(`[App] cdn "${path}" is not exist.`);
136
+ console.warn("[App] cdn \"".concat(path, "\" is not exist."));
135
137
  if (hasProcess && regionCode !== 'AY') {
136
- const url = path.indexOf('/') === 0 ? `${unifiedProcessDomain}${path}` : `${unifiedProcessDomain}/${path}`;
138
+ const url = path.indexOf('/') === 0 ? "".concat(unifiedProcessDomain).concat(path) : "".concat(unifiedProcessDomain, "/").concat(path);
137
139
  return appendQuery(url, queryPart);
138
140
  }
139
141
  return appendQuery(path, queryPart);
@@ -142,9 +144,9 @@ export default function getCdnUrl(path, cdnMap, region, process) {
142
144
  if (cdnShortPath.indexOf('http') === 0 || cdnShortPath.indexOf('//') === 0) {
143
145
  finalUrl = cdnShortPath;
144
146
  } else if (cdnShortPath.indexOf('/') === 0) {
145
- finalUrl = `${regionMap[regionCode]}${cdnShortPath}`;
147
+ finalUrl = "".concat(regionMap[regionCode]).concat(cdnShortPath);
146
148
  } else {
147
- finalUrl = `${regionMap[regionCode]}/${cdnShortPath}`;
149
+ finalUrl = "".concat(regionMap[regionCode], "/").concat(cdnShortPath);
148
150
  }
149
151
  if (hasProcess && regionCode !== 'AY') {
150
152
  const originPrefix = regionMap[regionCode];
@@ -5,9 +5,9 @@ const regionMap = {
5
5
  const concatRegionOrigin = (regionCode, path) => {
6
6
  const regionOrigin = get(regionMap, [regionCode]) || get(regionMap, ['EU']);
7
7
  if (path.indexOf('/') === 0) {
8
- return `${regionOrigin}${path}`;
8
+ return "".concat(regionOrigin).concat(path);
9
9
  }
10
- return `${regionOrigin}/${path}`;
10
+ return "".concat(regionOrigin, "/").concat(path);
11
11
  };
12
12
  const isEmptyOrUndefined = obj => {
13
13
  return !obj || Object.keys(obj).length === 0;
@@ -32,16 +32,16 @@ export default function getCdnUrl(path, cdnMap) {
32
32
  // 总是使用 EU 进行兜底
33
33
  const cdnShortPath = get(cdnMap, [regionCode, path]) || get(cdnMap, ['AY', path]) || get(cdnMap, [path]);
34
34
  if (!cdnShortPath) {
35
- console.warn(`[App] cdn "${path}" is not exist.`);
35
+ console.warn("[App] cdn \"".concat(path, "\" is not exist."));
36
36
  return path;
37
37
  }
38
38
  if (cdnShortPath.indexOf('http') === 0 || cdnShortPath.indexOf('//') === 0) {
39
39
  return cdnShortPath;
40
40
  }
41
41
  if (cdnShortPath.indexOf('/') === 0) {
42
- return `${regionMap[regionCode]}${cdnShortPath}`;
42
+ return "".concat(regionMap[regionCode]).concat(cdnShortPath);
43
43
  }
44
- return `${regionMap[regionCode]}/${cdnShortPath}`;
44
+ return "".concat(regionMap[regionCode], "/").concat(cdnShortPath);
45
45
  }
46
46
 
47
47
  /**
@@ -1,6 +1,6 @@
1
1
  export default function getElementById(id) {
2
2
  return new Promise(resolve => {
3
- const nodeRef = ty.createSelectorQuery().select(`#${id}`);
3
+ const nodeRef = ty.createSelectorQuery().select("#".concat(id));
4
4
  resolve(nodeRef);
5
5
  });
6
6
  }
@@ -1,6 +1,6 @@
1
1
  export default function getElementById(id) {
2
2
  return new Promise(resolve => {
3
- const nodeRef = wx.createSelectorQuery().select(`#${id}`);
3
+ const nodeRef = wx.createSelectorQuery().select("#".concat(id));
4
4
  resolve(nodeRef);
5
5
  });
6
6
  }
@@ -1,3 +1,7 @@
1
+ import "core-js/modules/es.regexp.constructor.js";
2
+ import "core-js/modules/es.regexp.dot-all.js";
3
+ import "core-js/modules/es.regexp.exec.js";
4
+ import "core-js/modules/es.string.replace.js";
1
5
  import "core-js/modules/esnext.iterator.constructor.js";
2
6
  import "core-js/modules/esnext.iterator.map.js";
3
7
  import { requestCloud, getSystemInfoSync, THING } from '../..';
@@ -27,7 +31,7 @@ export default class I18N {
27
31
  }
28
32
  forceUpdateNetworkLang(productId) {
29
33
  requestCloud({
30
- api: `${THING}.m.i18n.get`,
34
+ api: "".concat(THING, ".m.i18n.get"),
31
35
  version: '1.0',
32
36
  data: {
33
37
  productId,
@@ -118,14 +122,14 @@ export default class I18N {
118
122
  formatString(str) {
119
123
  let res = str;
120
124
  for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
121
- res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
125
+ res = this._replaceAll("{".concat(i, "}"), i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
122
126
  }
123
127
  return res;
124
128
  }
125
129
  formatValue(key) {
126
130
  let res = this.getLang(key);
127
131
  for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
128
- res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
132
+ res = this._replaceAll("{".concat(i, "}"), i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
129
133
  }
130
134
  return res;
131
135
  }
@@ -138,17 +142,17 @@ export default class I18N {
138
142
  getDpLang(code, value) {
139
143
  let key;
140
144
  if (typeof value === 'undefined') {
141
- key = `dp_${code}`.toLowerCase();
145
+ key = "dp_".concat(code).toLowerCase();
142
146
  } else if (typeof value === 'boolean') {
143
147
  const valStr = value ? 'on' : 'off';
144
- key = `dp_${code}_${valStr}`.toLowerCase();
148
+ key = "dp_".concat(code, "_").concat(valStr).toLowerCase();
145
149
  } else {
146
- key = `dp_${code}_${value}`.toLowerCase();
150
+ key = "dp_".concat(code, "_").concat(value).toLowerCase();
147
151
  }
148
152
  return hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
149
153
  }
150
154
  getDpName(code, defaultName) {
151
- const key = `dp_${code}`.toLowerCase();
155
+ const key = "dp_".concat(code).toLowerCase();
152
156
  return hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : defaultName;
153
157
  }
154
158
  getDpsLang(key) {
@@ -180,7 +184,7 @@ export default class I18N {
180
184
  if (typeof schema === 'undefined') return result;
181
185
  const lists = schema.range;
182
186
  lists.map(v => {
183
- const key = `dp_${dpCode}_${v}`.toLowerCase();
187
+ const key = "dp_".concat(dpCode, "_").concat(v).toLowerCase();
184
188
  result[v] = hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
185
189
  return null;
186
190
  });
@@ -194,12 +198,12 @@ export default class I18N {
194
198
  * @param {*} power 设备当前的开关状态 (如果当前设备为开启状态, 则倒计时显示为关闭)
195
199
  */
196
200
  parseCountdown(t, power) {
197
- const h = parseFloat(`${t / 3600}`);
198
- const m = parseFloat(`${t / 60 - h * 60}`);
201
+ const h = parseFloat("".concat(t / 3600));
202
+ const m = parseFloat("".concat(t / 60 - h * 60));
199
203
  const tHour = hasKey('t_hour') ? I18n.t('t_hour') : typeof this.t_hour !== 'undefined' ? this.t_hour : I18n.t('t_hour');
200
204
  const tMinute = hasKey('t_minute') ? I18n.t('t_minute') : typeof this.t_minute !== 'undefined' ? this.t_minute : I18n.t('t_minute');
201
- const time = h >= 1.0 ? `${Math.round(h)}${tHour}` : `${Math.round(m)}${tMinute}`;
202
- const key = `countdown_${power ? 'on' : 'off'}`;
205
+ const time = h >= 1.0 ? "".concat(Math.round(h)).concat(tHour) : "".concat(Math.round(m)).concat(tMinute);
206
+ const key = "countdown_".concat(power ? 'on' : 'off');
203
207
  const str = hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
204
208
  return this.formatString(str, time);
205
209
  }
@@ -1,3 +1,7 @@
1
+ import "core-js/modules/es.regexp.constructor.js";
2
+ import "core-js/modules/es.regexp.dot-all.js";
3
+ import "core-js/modules/es.regexp.exec.js";
4
+ import "core-js/modules/es.string.replace.js";
1
5
  import "core-js/modules/esnext.iterator.constructor.js";
2
6
  import "core-js/modules/esnext.iterator.map.js";
3
7
  import { requestCloud, getSystemInfoSync, THING } from '../..';
@@ -17,7 +21,7 @@ export default class I18N {
17
21
  }
18
22
  forceUpdateNetworkLang(productId) {
19
23
  requestCloud({
20
- api: `${THING}.m.i18n.get`,
24
+ api: "".concat(THING, ".m.i18n.get"),
21
25
  version: '1.0',
22
26
  data: {
23
27
  productId,
@@ -108,14 +112,14 @@ export default class I18N {
108
112
  formatString(str) {
109
113
  let res = str;
110
114
  for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
111
- res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
115
+ res = this._replaceAll("{".concat(i, "}"), i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
112
116
  }
113
117
  return res;
114
118
  }
115
119
  formatValue(key) {
116
120
  let res = typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
117
121
  for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
118
- res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
122
+ res = this._replaceAll("{".concat(i, "}"), i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
119
123
  }
120
124
  return res;
121
125
  }
@@ -128,17 +132,17 @@ export default class I18N {
128
132
  getDpLang(code, value) {
129
133
  let key;
130
134
  if (typeof value === 'undefined') {
131
- key = `dp_${code}`.toLowerCase();
135
+ key = "dp_".concat(code).toLowerCase();
132
136
  } else if (typeof value === 'boolean') {
133
137
  const valStr = value ? 'on' : 'off';
134
- key = `dp_${code}_${valStr}`.toLowerCase();
138
+ key = "dp_".concat(code, "_").concat(valStr).toLowerCase();
135
139
  } else {
136
- key = `dp_${code}_${value}`.toLowerCase();
140
+ key = "dp_".concat(code, "_").concat(value).toLowerCase();
137
141
  }
138
142
  return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
139
143
  }
140
144
  getDpName(code, defaultName) {
141
- const key = `dp_${code}`.toLowerCase();
145
+ const key = "dp_".concat(code).toLowerCase();
142
146
  return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : defaultName;
143
147
  }
144
148
  getDpsLang(key) {
@@ -170,7 +174,7 @@ export default class I18N {
170
174
  if (typeof schema === 'undefined') return result;
171
175
  const lists = schema.range;
172
176
  lists.map(v => {
173
- const key = `dp_${dpCode}_${v}`.toLowerCase();
177
+ const key = "dp_".concat(dpCode, "_").concat(v).toLowerCase();
174
178
  result[v] = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
175
179
  return null;
176
180
  });
@@ -184,12 +188,12 @@ export default class I18N {
184
188
  * @param {*} power 设备当前的开关状态 (如果当前设备为开启状态, 则倒计时显示为关闭)
185
189
  */
186
190
  parseCountdown(t, power) {
187
- const h = parseFloat(`${t / 3600}`);
188
- const m = parseFloat(`${t / 60 - h * 60}`);
191
+ const h = parseFloat("".concat(t / 3600));
192
+ const m = parseFloat("".concat(t / 60 - h * 60));
189
193
  const tHour = I18n.t('t_hour') !== 't_hour' ? I18n.t('t_hour') : typeof this.t_hour !== 'undefined' ? this.t_hour : I18n.t('t_hour');
190
194
  const tMinute = I18n.t('t_minute') !== 't_minute' ? I18n.t('t_minute') : typeof this.t_minute !== 'undefined' ? this.t_minute : I18n.t('t_minute');
191
- const time = h >= 1.0 ? `${Math.round(h)}${tHour}` : `${Math.round(m)}${tMinute}`;
192
- const key = `countdown_${power ? 'on' : 'off'}`;
195
+ const time = h >= 1.0 ? "".concat(Math.round(h)).concat(tHour) : "".concat(Math.round(m)).concat(tMinute);
196
+ const key = "countdown_".concat(power ? 'on' : 'off');
193
197
  const str = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
194
198
  return this.formatString(str, time);
195
199
  }
@@ -29,7 +29,7 @@ export function sendDps(data) {
29
29
  const codeIds = (devInfo === null || devInfo === void 0 ? void 0 : devInfo.codeIds) || {};
30
30
  Object.keys(data).forEach(code => {
31
31
  if (codeIds[code] !== undefined) {
32
- dps[`${codeIds[code]}`] = data[code];
32
+ dps["".concat(codeIds[code])] = data[code];
33
33
  } else {
34
34
  dps[code] = data[code];
35
35
  }
@@ -1,3 +1,5 @@
1
+ import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
1
3
  /// <reference path="../../@types/api.d.ts" />
2
4
 
3
5
  import router from '@ray-js/router';
package/lib/utils.js CHANGED
@@ -4,15 +4,15 @@ export function createFactory(kitName) {
4
4
  let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5
5
  return function () {
6
6
  var _inst$opts$namespace;
7
- const methodName = `ty.${opts.namespace ? opts.namespace + '.' : ''}${name}`;
7
+ const methodName = "ty.".concat(opts.namespace ? opts.namespace + '.' : '').concat(name);
8
8
  if (opts.deprecated) {
9
- console.warn(`"${methodName}" method has been deprecated.`);
9
+ console.warn("\"".concat(methodName, "\" method has been deprecated."));
10
10
  }
11
11
  const inst = typeof ty === 'undefined' ? {} : ty;
12
12
  const method = opts.namespace ? ((_inst$opts$namespace = inst[opts.namespace]) !== null && _inst$opts$namespace !== void 0 ? _inst$opts$namespace : {})[name] : inst[name];
13
13
  if (!method) {
14
- console.warn('tips:', `"${methodName}" method not exits.`);
15
- console.warn('tips:', `Please check kit "${kitName}" dependency is enabled.`);
14
+ console.warn('tips:', "\"".concat(methodName, "\" method not exits."));
15
+ console.warn('tips:', "Please check kit \"".concat(kitName, "\" dependency is enabled."));
16
16
  return;
17
17
  }
18
18
  // eslint-disable-next-line prefer-rest-params
@@ -24,14 +24,14 @@ export function factory(name) {
24
24
  let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25
25
  return function () {
26
26
  var _inst$opts$namespace2;
27
- const methodName = `ty.${opts.namespace ? opts.namespace + '.' : ''}${name}`;
27
+ const methodName = "ty.".concat(opts.namespace ? opts.namespace + '.' : '').concat(name);
28
28
  if (opts.deprecated) {
29
- console.warn(`"${methodName}" method has been deprecated.`);
29
+ console.warn("\"".concat(methodName, "\" method has been deprecated."));
30
30
  }
31
31
  const inst = typeof ty === 'undefined' ? {} : ty;
32
32
  const method = opts.namespace ? ((_inst$opts$namespace2 = inst[opts.namespace]) !== null && _inst$opts$namespace2 !== void 0 ? _inst$opts$namespace2 : {})[name] : inst[name];
33
33
  if (!method) {
34
- console.warn('tips:', `"${methodName}" method not exits.`);
34
+ console.warn('tips:', "\"".concat(methodName, "\" method not exits."));
35
35
  return;
36
36
  }
37
37
  // eslint-disable-next-line prefer-rest-params
@@ -41,11 +41,11 @@ export function factory(name) {
41
41
  export function factoryConstants(name) {
42
42
  let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
43
43
  if (opts.deprecated) {
44
- console.warn(`"ty.${name}" constant has been deprecated.`);
44
+ console.warn("\"ty.".concat(name, "\" constant has been deprecated."));
45
45
  }
46
46
  const inst = typeof ty === 'undefined' ? {} : ty;
47
47
  if (!inst[name]) {
48
- console.warn('tips', `"ty.${name}" constant not exits.`);
48
+ console.warn('tips', "\"ty.".concat(name, "\" constant not exits."));
49
49
  return;
50
50
  }
51
51
  return inst[name];
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.regexp.exec.js";
1
2
  // @ts-ignore
2
3
  import * as tyWx from '@ray-js/wechat';
3
4
  import { stringifyUrl as _stringifyUrl, parseUrl as _parseUrl } from 'query-string';
@@ -13,7 +14,7 @@ export function factory(name) {
13
14
  if (/(set|get|remove|clear)+Storage(Sync)?$/.test(name)) {
14
15
  return function (option) {
15
16
  if (opts.deprecated) {
16
- console.warn(`The method ${name} is deprecated`);
17
+ console.warn("The method ".concat(name, " is deprecated"));
17
18
  }
18
19
  // eslint-disable-next-line prefer-rest-params
19
20
  return wx[name].call(this, option.key, option.data);
@@ -21,10 +22,10 @@ export function factory(name) {
21
22
  }
22
23
  return function () {
23
24
  if (opts.deprecated) {
24
- console.warn(`The method ${name} is deprecated`);
25
+ console.warn("The method ".concat(name, " is deprecated"));
25
26
  }
26
27
  if (!tyWx[name] && !wx[name]) {
27
- console.warn(`The method ${name} is not implemented yet`);
28
+ console.warn("The method ".concat(name, " is not implemented yet"));
28
29
  return;
29
30
  }
30
31
  // 优先取得 TTT 能力的方法
@@ -38,11 +39,11 @@ export function factory(name) {
38
39
  export function factoryConstants(name) {
39
40
  let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
40
41
  if (opts.deprecated) {
41
- console.warn(`The constant ${name} is deprecated`);
42
+ console.warn("The constant ".concat(name, " is deprecated"));
42
43
  }
43
44
  const inst = typeof wx === 'undefined' ? {} : wx;
44
45
  if (!inst[name]) {
45
- console.warn(`The constant ${name} is not implemented yet`);
46
+ console.warn("The constant ".concat(name, " is not implemented yet"));
46
47
  return;
47
48
  }
48
49
  return inst[name];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "1.7.52",
3
+ "version": "1.7.54",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -29,8 +29,8 @@
29
29
  "watch": "ray start --type=component"
30
30
  },
31
31
  "dependencies": {
32
- "@ray-js/framework": "1.7.52",
33
- "@ray-js/router": "1.7.52",
32
+ "@ray-js/framework": "1.7.54",
33
+ "@ray-js/router": "1.7.54",
34
34
  "base64-browser": "^1.0.1",
35
35
  "query-string": "^7.1.3"
36
36
  },
@@ -38,7 +38,7 @@
38
38
  "@ray-js/wechat": "^0.3.13"
39
39
  },
40
40
  "devDependencies": {
41
- "@ray-js/cli": "1.7.52",
41
+ "@ray-js/cli": "1.7.54",
42
42
  "art-template": "^4.13.4",
43
43
  "fs-extra": "^10.1.0",
44
44
  "miniprogram-api-typings": "^3.12.3",
@@ -48,5 +48,5 @@
48
48
  "access": "public",
49
49
  "registry": "https://registry.npmjs.org"
50
50
  },
51
- "gitHead": "14ced414dd88e28032bde51c350b8dae60fe6892"
51
+ "gitHead": "5116e3b87db4744a118a9fe97f88a8c708b44a93"
52
52
  }