@tarojs/api 3.7.0-alpha.2 → 3.7.0-alpha.4

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/index.esm.js CHANGED
@@ -1,14 +1,12 @@
1
1
  import _typeof from '@babel/runtime/helpers/typeof';
2
- import { Current, getCurrentInstance, options, nextTick, eventCenter, Events as Events$1 } from '@tarojs/runtime';
3
- import '@babel/runtime/helpers/toConsumableArray';
4
- import _inherits from '@babel/runtime/helpers/inherits';
5
- import _createSuper from '@babel/runtime/helpers/createSuper';
2
+ import { Current, getCurrentInstance, options, nextTick, eventCenter, Events } from '@tarojs/runtime';
3
+ import { isWebPlatform } from '@tarojs/shared';
4
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
6
5
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
7
6
  import _createClass from '@babel/runtime/helpers/createClass';
8
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
9
7
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
10
8
 
11
- function isFunction$1(x) {
9
+ function isFunction(x) {
12
10
  return typeof x === 'function';
13
11
  }
14
12
  function isUndefined(x) {
@@ -24,7 +22,7 @@ var isBadObj = function isBadObj(x) {
24
22
  function throwTypeError(s) {
25
23
  throw new TypeError(s);
26
24
  }
27
- if (!isFunction$1(Object.assign)) {
25
+ if (!isFunction(Object.assign)) {
28
26
  // Must be writable: true, enumerable: false, configurable: true
29
27
  Object.assign = function (target) {
30
28
  // .length of function is 2
@@ -48,7 +46,7 @@ if (!isFunction$1(Object.assign)) {
48
46
  return to;
49
47
  };
50
48
  }
51
- if (!isFunction$1(Object.defineProperties)) {
49
+ if (!isFunction(Object.defineProperties)) {
52
50
  Object.defineProperties = function (obj, properties) {
53
51
  function convertToDescriptor(desc) {
54
52
  function hasProperty(obj, prop) {
@@ -66,14 +64,14 @@ if (!isFunction$1(Object.defineProperties)) {
66
64
  if (hasProperty(desc, 'writable')) d.writable = !!desc.writable;
67
65
  if (hasProperty(desc, 'get')) {
68
66
  var g = desc.get;
69
- if (!isFunction$1(g) && !isUndefined(g)) {
67
+ if (!isFunction(g) && !isUndefined(g)) {
70
68
  throwTypeError('bad get');
71
69
  }
72
70
  d.get = g;
73
71
  }
74
72
  if (hasProperty(desc, 'set')) {
75
73
  var s = desc.set;
76
- if (!isFunction$1(s) && !isUndefined(s)) {
74
+ if (!isFunction(s) && !isUndefined(s)) {
77
75
  throwTypeError('bad set');
78
76
  }
79
77
  d.set = s;
@@ -97,446 +95,6 @@ if (!isFunction$1(Object.defineProperties)) {
97
95
  };
98
96
  }
99
97
 
100
- var DEFAULT_EMPTY_ARRAY = '[]';
101
- var NO_DEFAULT_VALUE = '';
102
- var DEFAULT_TRUE = '!0';
103
- var DEFAULT_FALSE = '!1';
104
- var touchEvents = {
105
- bindTouchStart: NO_DEFAULT_VALUE,
106
- bindTouchMove: NO_DEFAULT_VALUE,
107
- bindTouchEnd: NO_DEFAULT_VALUE,
108
- bindTouchCancel: NO_DEFAULT_VALUE,
109
- bindLongTap: NO_DEFAULT_VALUE
110
- };
111
- var animation = {
112
- animation: NO_DEFAULT_VALUE,
113
- bindAnimationStart: NO_DEFAULT_VALUE,
114
- bindAnimationIteration: NO_DEFAULT_VALUE,
115
- bindAnimationEnd: NO_DEFAULT_VALUE,
116
- bindTransitionEnd: NO_DEFAULT_VALUE
117
- };
118
- function singleQuote(s) {
119
- return "'".concat(s, "'");
120
- }
121
- Object.assign(Object.assign({
122
- 'hover-class': singleQuote('none'),
123
- 'hover-stop-propagation': DEFAULT_FALSE,
124
- 'hover-start-time': '50',
125
- 'hover-stay-time': '400'
126
- }, touchEvents), animation);
127
- Object.assign({
128
- longitude: NO_DEFAULT_VALUE,
129
- latitude: NO_DEFAULT_VALUE,
130
- scale: '16',
131
- markers: DEFAULT_EMPTY_ARRAY,
132
- covers: NO_DEFAULT_VALUE,
133
- polyline: DEFAULT_EMPTY_ARRAY,
134
- circles: DEFAULT_EMPTY_ARRAY,
135
- controls: DEFAULT_EMPTY_ARRAY,
136
- 'include-points': DEFAULT_EMPTY_ARRAY,
137
- 'show-location': NO_DEFAULT_VALUE,
138
- 'layer-style': '1',
139
- bindMarkerTap: NO_DEFAULT_VALUE,
140
- bindControlTap: NO_DEFAULT_VALUE,
141
- bindCalloutTap: NO_DEFAULT_VALUE,
142
- bindUpdated: NO_DEFAULT_VALUE
143
- }, touchEvents);
144
- Object.assign({
145
- size: singleQuote('default'),
146
- type: NO_DEFAULT_VALUE,
147
- plain: DEFAULT_FALSE,
148
- disabled: NO_DEFAULT_VALUE,
149
- loading: DEFAULT_FALSE,
150
- 'form-type': NO_DEFAULT_VALUE,
151
- 'open-type': NO_DEFAULT_VALUE,
152
- 'hover-class': singleQuote('button-hover'),
153
- 'hover-stop-propagation': DEFAULT_FALSE,
154
- 'hover-start-time': '20',
155
- 'hover-stay-time': '70',
156
- name: NO_DEFAULT_VALUE
157
- }, touchEvents);
158
- Object.assign({
159
- 'scroll-top': DEFAULT_FALSE
160
- }, touchEvents);
161
- Object.assign(Object.assign({
162
- direction: 'none',
163
- inertia: DEFAULT_FALSE,
164
- 'out-of-bounds': DEFAULT_FALSE,
165
- x: NO_DEFAULT_VALUE,
166
- y: NO_DEFAULT_VALUE,
167
- damping: '20',
168
- friction: '2',
169
- disabled: NO_DEFAULT_VALUE,
170
- scale: DEFAULT_FALSE,
171
- 'scale-min': '0.5',
172
- 'scale-max': '10',
173
- 'scale-value': '1',
174
- bindChange: NO_DEFAULT_VALUE,
175
- bindScale: NO_DEFAULT_VALUE,
176
- bindHTouchMove: NO_DEFAULT_VALUE,
177
- bindVTouchMove: NO_DEFAULT_VALUE,
178
- width: singleQuote('10px'),
179
- height: singleQuote('10px')
180
- }, touchEvents), animation);
181
- Object.assign(Object.assign({
182
- 'scroll-x': DEFAULT_FALSE,
183
- 'scroll-y': DEFAULT_FALSE,
184
- 'upper-threshold': '50',
185
- 'lower-threshold': '50',
186
- 'scroll-top': NO_DEFAULT_VALUE,
187
- 'scroll-left': NO_DEFAULT_VALUE,
188
- 'scroll-into-view': NO_DEFAULT_VALUE,
189
- 'scroll-with-animation': DEFAULT_FALSE,
190
- 'enable-back-to-top': DEFAULT_FALSE,
191
- bindScrollToUpper: NO_DEFAULT_VALUE,
192
- bindScrollToLower: NO_DEFAULT_VALUE,
193
- bindScroll: NO_DEFAULT_VALUE
194
- }, touchEvents), animation);
195
- Object.assign({
196
- 'indicator-dots': DEFAULT_FALSE,
197
- 'indicator-color': singleQuote('rgba(0, 0, 0, .3)'),
198
- 'indicator-active-color': singleQuote('#000000'),
199
- autoplay: DEFAULT_FALSE,
200
- current: '0',
201
- interval: '5000',
202
- duration: '500',
203
- circular: DEFAULT_FALSE,
204
- vertical: DEFAULT_FALSE,
205
- 'previous-margin': singleQuote('0px'),
206
- 'next-margin': singleQuote('0px'),
207
- 'display-multiple-items': '1',
208
- bindChange: NO_DEFAULT_VALUE,
209
- bindTransition: NO_DEFAULT_VALUE,
210
- bindAnimationFinish: NO_DEFAULT_VALUE
211
- }, touchEvents);
212
- Object.assign({
213
- src: NO_DEFAULT_VALUE,
214
- mode: singleQuote('scaleToFill'),
215
- 'lazy-load': DEFAULT_FALSE,
216
- bindError: NO_DEFAULT_VALUE,
217
- bindLoad: NO_DEFAULT_VALUE
218
- }, touchEvents);
219
- Object.assign({
220
- src: NO_DEFAULT_VALUE,
221
- autoplay: DEFAULT_FALSE,
222
- muted: DEFAULT_FALSE,
223
- orientation: singleQuote('vertical'),
224
- 'object-fit': singleQuote('contain'),
225
- 'background-mute': DEFAULT_FALSE,
226
- 'min-cache': '1',
227
- 'max-cache': '3',
228
- bindStateChange: NO_DEFAULT_VALUE,
229
- bindFullScreenChange: NO_DEFAULT_VALUE,
230
- bindNetStatus: NO_DEFAULT_VALUE
231
- }, animation);
232
- Object.assign({
233
- src: NO_DEFAULT_VALUE,
234
- duration: NO_DEFAULT_VALUE,
235
- controls: DEFAULT_TRUE,
236
- 'danmu-list': NO_DEFAULT_VALUE,
237
- 'danmu-btn': NO_DEFAULT_VALUE,
238
- 'enable-danmu': NO_DEFAULT_VALUE,
239
- autoplay: DEFAULT_FALSE,
240
- loop: DEFAULT_FALSE,
241
- muted: DEFAULT_FALSE,
242
- 'initial-time': '0',
243
- 'page-gesture': DEFAULT_FALSE,
244
- direction: NO_DEFAULT_VALUE,
245
- 'show-progress': DEFAULT_TRUE,
246
- 'show-fullscreen-btn': DEFAULT_TRUE,
247
- 'show-play-btn': DEFAULT_TRUE,
248
- 'show-center-play-btn': DEFAULT_TRUE,
249
- 'enable-progress-gesture': DEFAULT_TRUE,
250
- 'object-fit': singleQuote('contain'),
251
- poster: NO_DEFAULT_VALUE,
252
- 'show-mute-btn': DEFAULT_FALSE,
253
- bindPlay: NO_DEFAULT_VALUE,
254
- bindPause: NO_DEFAULT_VALUE,
255
- bindEnded: NO_DEFAULT_VALUE,
256
- bindTimeUpdate: NO_DEFAULT_VALUE,
257
- bindFullScreenChange: NO_DEFAULT_VALUE,
258
- bindWaiting: NO_DEFAULT_VALUE,
259
- bindError: NO_DEFAULT_VALUE
260
- }, animation);
261
- Object.assign({
262
- 'canvas-id': NO_DEFAULT_VALUE,
263
- 'disable-scroll': DEFAULT_FALSE,
264
- bindError: NO_DEFAULT_VALUE
265
- }, touchEvents);
266
- var PLATFORM_TYPE;
267
- (function (PLATFORM_TYPE) {
268
- PLATFORM_TYPE["MINI"] = "mini";
269
- PLATFORM_TYPE["WEB"] = "web";
270
- PLATFORM_TYPE["RN"] = "rn";
271
- PLATFORM_TYPE["HARMONY"] = "harmony";
272
- PLATFORM_TYPE["QUICK"] = "quickapp";
273
- })(PLATFORM_TYPE || (PLATFORM_TYPE = {}));
274
- ({
275
- h5: {
276
- type: PLATFORM_TYPE.WEB
277
- },
278
- harmony: {
279
- type: PLATFORM_TYPE.HARMONY
280
- },
281
- mini: {
282
- type: PLATFORM_TYPE.MINI
283
- },
284
- rn: {
285
- type: PLATFORM_TYPE.RN
286
- },
287
- quickapp: {
288
- type: PLATFORM_TYPE.QUICK
289
- }
290
- });
291
- var Events = /*#__PURE__*/function () {
292
- function Events(opts) {
293
- _classCallCheck(this, Events);
294
- var _a;
295
- this.callbacks = (_a = opts === null || opts === void 0 ? void 0 : opts.callbacks) !== null && _a !== void 0 ? _a : {};
296
- }
297
- _createClass(Events, [{
298
- key: "on",
299
- value: function on(eventName, callback, context) {
300
- var event, node, tail, list;
301
- if (!callback) {
302
- return this;
303
- }
304
- eventName = eventName.split(Events.eventSplitter);
305
- this.callbacks || (this.callbacks = {});
306
- var calls = this.callbacks;
307
- while (event = eventName.shift()) {
308
- list = calls[event];
309
- node = list ? list.tail : {};
310
- node.next = tail = {};
311
- node.context = context;
312
- node.callback = callback;
313
- calls[event] = {
314
- tail: tail,
315
- next: list ? list.next : node
316
- };
317
- }
318
- return this;
319
- }
320
- }, {
321
- key: "once",
322
- value: function once(events, callback, context) {
323
- var _this = this;
324
- var wrapper = function wrapper() {
325
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
326
- args[_key] = arguments[_key];
327
- }
328
- callback.apply(_this, args);
329
- _this.off(events, wrapper, context);
330
- };
331
- this.on(events, wrapper, context);
332
- return this;
333
- }
334
- }, {
335
- key: "off",
336
- value: function off(events, callback, context) {
337
- var event, calls, node, tail, cb, ctx;
338
- if (!(calls = this.callbacks)) {
339
- return this;
340
- }
341
- if (!(events || callback || context)) {
342
- delete this.callbacks;
343
- return this;
344
- }
345
- events = events ? events.split(Events.eventSplitter) : Object.keys(calls);
346
- while (event = events.shift()) {
347
- node = calls[event];
348
- delete calls[event];
349
- if (!node || !(callback || context)) {
350
- continue;
351
- }
352
- tail = node.tail;
353
- while ((node = node.next) !== tail) {
354
- cb = node.callback;
355
- ctx = node.context;
356
- if (callback && cb !== callback || context && ctx !== context) {
357
- this.on(event, cb, ctx);
358
- }
359
- }
360
- }
361
- return this;
362
- }
363
- }, {
364
- key: "trigger",
365
- value: function trigger(events) {
366
- var event, node, calls, tail;
367
- if (!(calls = this.callbacks)) {
368
- return this;
369
- }
370
- events = events.split(Events.eventSplitter);
371
- var rest = [].slice.call(arguments, 1);
372
- while (event = events.shift()) {
373
- if (node = calls[event]) {
374
- tail = node.tail;
375
- while ((node = node.next) !== tail) {
376
- node.callback.apply(node.context || this, rest);
377
- }
378
- }
379
- }
380
- return this;
381
- }
382
- }]);
383
- return Events;
384
- }();
385
- Events.eventSplitter = ','; // Note: Harmony ACE API 8 开发板不支持使用正则 split 字符串 /\s+/
386
- function isFunction(o) {
387
- return typeof o === 'function';
388
- }
389
- var isWebPlatform = function isWebPlatform() {
390
- return process.env.TARO_ENV === 'h5' || process.env.TARO_PLATFORM === 'web';
391
- };
392
- var HOOK_TYPE;
393
- (function (HOOK_TYPE) {
394
- HOOK_TYPE[HOOK_TYPE["SINGLE"] = 0] = "SINGLE";
395
- HOOK_TYPE[HOOK_TYPE["MULTI"] = 1] = "MULTI";
396
- HOOK_TYPE[HOOK_TYPE["WATERFALL"] = 2] = "WATERFALL";
397
- })(HOOK_TYPE || (HOOK_TYPE = {}));
398
- var defaultMiniLifecycle = {
399
- app: ['onLaunch', 'onShow', 'onHide'],
400
- page: ['onLoad', 'onUnload', 'onReady', 'onShow', 'onHide', ['onPullDownRefresh', 'onReachBottom', 'onPageScroll', 'onResize', 'onTabItemTap', 'onTitleClick', 'onOptionMenuClick', 'onPopMenuClick', 'onPullIntercept', 'onAddToFavorites'], ['onShareAppMessage', 'onShareTimeline']],
401
- component: ['attached', 'detached']
402
- };
403
- function TaroHook(type, initial) {
404
- return {
405
- type: type,
406
- initial: initial || null
407
- };
408
- }
409
- var TaroHooks = /*#__PURE__*/function (_Events) {
410
- _inherits(TaroHooks, _Events);
411
- var _super = _createSuper(TaroHooks);
412
- function TaroHooks(hooks, opts) {
413
- var _this2;
414
- _classCallCheck(this, TaroHooks);
415
- _this2 = _super.call(this, opts);
416
- _this2.hooks = hooks;
417
- for (var hookName in hooks) {
418
- var initial = hooks[hookName].initial;
419
- if (isFunction(initial)) {
420
- _this2.on(hookName, initial);
421
- }
422
- }
423
- return _this2;
424
- }
425
- _createClass(TaroHooks, [{
426
- key: "tapOneOrMany",
427
- value: function tapOneOrMany(hookName, callback) {
428
- var _this3 = this;
429
- var list = isFunction(callback) ? [callback] : callback;
430
- list.forEach(function (cb) {
431
- return _this3.on(hookName, cb);
432
- });
433
- }
434
- }, {
435
- key: "tap",
436
- value: function tap(hookName, callback) {
437
- var hooks = this.hooks;
438
- var _hooks$hookName = hooks[hookName],
439
- type = _hooks$hookName.type,
440
- initial = _hooks$hookName.initial;
441
- if (type === HOOK_TYPE.SINGLE) {
442
- this.off(hookName);
443
- this.on(hookName, isFunction(callback) ? callback : callback[callback.length - 1]);
444
- } else {
445
- initial && this.off(hookName, initial);
446
- this.tapOneOrMany(hookName, callback);
447
- }
448
- }
449
- }, {
450
- key: "call",
451
- value: function call(hookName) {
452
- var _a;
453
- var hook = this.hooks[hookName];
454
- if (!hook) return;
455
- var type = hook.type;
456
- var calls = this.callbacks;
457
- if (!calls) return;
458
- var list = calls[hookName];
459
- if (list) {
460
- var tail = list.tail;
461
- var node = list.next;
462
- for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
463
- rest[_key2 - 1] = arguments[_key2];
464
- }
465
- var args = rest;
466
- var res;
467
- while (node !== tail) {
468
- res = (_a = node.callback) === null || _a === void 0 ? void 0 : _a.apply(node.context || this, args);
469
- if (type === HOOK_TYPE.WATERFALL) {
470
- var params = [res];
471
- args = params;
472
- }
473
- node = node.next;
474
- }
475
- return res;
476
- }
477
- }
478
- }, {
479
- key: "isExist",
480
- value: function isExist(hookName) {
481
- var _a;
482
- return Boolean((_a = this.callbacks) === null || _a === void 0 ? void 0 : _a[hookName]);
483
- }
484
- }]);
485
- return TaroHooks;
486
- }(Events);
487
- new TaroHooks({
488
- getMiniLifecycle: TaroHook(HOOK_TYPE.SINGLE, function (defaultConfig) {
489
- return defaultConfig;
490
- }),
491
- getMiniLifecycleImpl: TaroHook(HOOK_TYPE.SINGLE, function () {
492
- return this.call('getMiniLifecycle', defaultMiniLifecycle);
493
- }),
494
- getLifecycle: TaroHook(HOOK_TYPE.SINGLE, function (instance, lifecycle) {
495
- return instance[lifecycle];
496
- }),
497
- getPathIndex: TaroHook(HOOK_TYPE.SINGLE, function (indexOfNode) {
498
- return "[".concat(indexOfNode, "]");
499
- }),
500
- getEventCenter: TaroHook(HOOK_TYPE.SINGLE, function (Events) {
501
- return new Events();
502
- }),
503
- isBubbleEvents: TaroHook(HOOK_TYPE.SINGLE, function (eventName) {
504
- /**
505
- * 支持冒泡的事件, 除 支付宝小程序外,其余的可冒泡事件都和微信保持一致
506
- * 详见 见 https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html
507
- */
508
- var BUBBLE_EVENTS = new Set(['touchstart', 'touchmove', 'touchcancel', 'touchend', 'touchforcechange', 'tap', 'longpress', 'longtap', 'transitionend', 'animationstart', 'animationiteration', 'animationend']);
509
- return BUBBLE_EVENTS.has(eventName);
510
- }),
511
- getSpecialNodes: TaroHook(HOOK_TYPE.SINGLE, function () {
512
- return ['view', 'text', 'image'];
513
- }),
514
- onRemoveAttribute: TaroHook(HOOK_TYPE.SINGLE),
515
- batchedEventUpdates: TaroHook(HOOK_TYPE.SINGLE),
516
- mergePageInstance: TaroHook(HOOK_TYPE.SINGLE),
517
- modifyPageObject: TaroHook(HOOK_TYPE.SINGLE),
518
- createPullDownComponent: TaroHook(HOOK_TYPE.SINGLE),
519
- getDOMNode: TaroHook(HOOK_TYPE.SINGLE),
520
- modifyHydrateData: TaroHook(HOOK_TYPE.SINGLE),
521
- modifySetAttrPayload: TaroHook(HOOK_TYPE.SINGLE),
522
- modifyRmAttrPayload: TaroHook(HOOK_TYPE.SINGLE),
523
- onAddEvent: TaroHook(HOOK_TYPE.SINGLE),
524
- modifyMpEvent: TaroHook(HOOK_TYPE.MULTI),
525
- modifyMpEventImpl: TaroHook(HOOK_TYPE.SINGLE, function (e) {
526
- try {
527
- // 有些小程序的事件对象的某些属性只读
528
- this.call('modifyMpEvent', e);
529
- } catch (error) {
530
- console.warn('[Taro modifyMpEvent hook Error]: ' + (error === null || error === void 0 ? void 0 : error.message));
531
- }
532
- }),
533
- modifyTaroEvent: TaroHook(HOOK_TYPE.MULTI),
534
- modifyDispatchEvent: TaroHook(HOOK_TYPE.MULTI),
535
- initNativeApi: TaroHook(HOOK_TYPE.MULTI),
536
- patchElement: TaroHook(HOOK_TYPE.MULTI)
537
- });
538
- new Date().getTime().toString();
539
-
540
98
  var ENV_TYPE = {
541
99
  WEAPP: 'WEAPP',
542
100
  SWAN: 'SWAN',
@@ -597,7 +155,7 @@ var Chain = /*#__PURE__*/function () {
597
155
  return Promise.reject(err);
598
156
  });
599
157
  Object.keys(p).forEach(function (k) {
600
- return isFunction$1(p[k]) && (res[k] = p[k]);
158
+ return isFunction(p[k]) && (res[k] = p[k]);
601
159
  });
602
160
  return res;
603
161
  }
@@ -644,6 +202,11 @@ var Link = /*#__PURE__*/function () {
644
202
  }]);
645
203
  return Link;
646
204
  }();
205
+ function interceptorify(promiseifyApi) {
206
+ return new Link(function (chain) {
207
+ return promiseifyApi(chain.requestParams);
208
+ });
209
+ }
647
210
 
648
211
  function timeoutInterceptor(chain) {
649
212
  var requestParams = chain.requestParams;
@@ -663,7 +226,7 @@ function timeoutInterceptor(chain) {
663
226
  reject(err);
664
227
  });
665
228
  });
666
- if (!isUndefined(p) && isFunction$1(p.abort)) res.abort = p.abort;
229
+ if (!isUndefined(p) && isFunction(p.abort)) res.abort = p.abort;
667
230
  return res;
668
231
  }
669
232
  function logInterceptor(chain) {
@@ -671,19 +234,16 @@ function logInterceptor(chain) {
671
234
  var method = requestParams.method,
672
235
  data = requestParams.data,
673
236
  url = requestParams.url;
674
- if (process.env.NODE_ENV !== 'production') {
675
- // eslint-disable-next-line no-console
676
- console.log("http ".concat(method || 'GET', " --> ").concat(url, " data: "), data);
677
- }
237
+
238
+ // eslint-disable-next-line no-console
239
+ console.log("http ".concat(method || 'GET', " --> ").concat(url, " data: "), data);
678
240
  var p = chain.proceed(requestParams);
679
241
  var res = p.then(function (res) {
680
- if (process.env.NODE_ENV !== 'production') {
681
- // eslint-disable-next-line no-console
682
- console.log("http <-- ".concat(url, " result:"), res);
683
- }
242
+ // eslint-disable-next-line no-console
243
+ console.log("http <-- ".concat(url, " result:"), res);
684
244
  return res;
685
245
  });
686
- if (isFunction$1(p.abort)) res.abort = p.abort;
246
+ if (isFunction(p.abort)) res.abort = p.abort;
687
247
  return res;
688
248
  }
689
249
 
@@ -737,7 +297,7 @@ function getPxTransform(taro) {
737
297
  var baseFontSize = config.baseFontSize;
738
298
  var designWidth = function () {
739
299
  var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
740
- return isFunction$1(config.designWidth) ? config.designWidth(input) : config.designWidth || defaultDesignWidth;
300
+ return isFunction(config.designWidth) ? config.designWidth(input) : config.designWidth || defaultDesignWidth;
741
301
  }(size);
742
302
  if (!(designWidth in deviceRatio)) {
743
303
  throw new Error("deviceRatio \u914D\u7F6E\u4E2D\u4E0D\u5B58\u5728 ".concat(designWidth, " \u7684\u8BBE\u7F6E\uFF01"));
@@ -772,8 +332,9 @@ var Taro = {
772
332
  options: options,
773
333
  nextTick: nextTick,
774
334
  eventCenter: eventCenter,
775
- Events: Events$1,
776
- getInitPxTransform: getInitPxTransform
335
+ Events: Events,
336
+ getInitPxTransform: getInitPxTransform,
337
+ interceptorify: interceptorify
777
338
  };
778
339
  Taro.initPxTransform = getInitPxTransform(Taro);
779
340
  Taro.preload = getPreload(Current);