From 5a069e50bbe1f79cb53cc9c20771fd7a39196668 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 19 Apr 2019 20:52:10 +0800 Subject: [PATCH] build uni runtime (includes=>indexOf) --- packages/uni-app-plus/dist/index.js | 14 +++++++------- packages/uni-app-plus/package.json | 2 +- packages/uni-mp-baidu/dist/index.js | 14 +++++++------- packages/uni-mp-baidu/package.json | 2 +- packages/uni-mp-toutiao/dist/index.js | 14 +++++++------- packages/uni-mp-toutiao/package.json | 2 +- packages/uni-mp-weixin/dist/index.js | 14 +++++++------- packages/uni-mp-weixin/package.json | 2 +- src/core/runtime/wrapper.js | 2 +- src/core/runtime/wrapper/util.js | 12 ++++++------ 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 7060d47f7..27ecea610 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -173,7 +173,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; } - } else if (CALLBACKS.includes(key)) { + } else if (CALLBACKS.indexOf(key) !== -1) { toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); } else { if (!keepFromArgs) { @@ -345,10 +345,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} - } - - if (!isPlainObject(data)) { - data = {}; + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { @@ -426,13 +426,13 @@ function getProperties (props, isBehavior = false) { value = value(); } properties[key] = { - type: PROP_TYPES.includes(opts.type) ? opts.type : null, + type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null, value, observer: createObserver(key) }; } else { // content:String properties[key] = { - type: PROP_TYPES.includes(opts) ? opts : null, + type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null, observer: createObserver(key) }; } diff --git a/packages/uni-app-plus/package.json b/packages/uni-app-plus/package.json index 2956a7d62..4466e963d 100644 --- a/packages/uni-app-plus/package.json +++ b/packages/uni-app-plus/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-app-plus", - "version": "0.0.222", + "version": "0.0.223", "description": "uni-app app-plus", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index 003f332cd..356b036ae 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -270,7 +270,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; } - } else if (CALLBACKS.includes(key)) { + } else if (CALLBACKS.indexOf(key) !== -1) { toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); } else { if (!keepFromArgs) { @@ -480,10 +480,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} - } - - if (!isPlainObject(data)) { - data = {}; + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { @@ -561,13 +561,13 @@ function getProperties (props, isBehavior = false) { value = value(); } properties[key] = { - type: PROP_TYPES.includes(opts.type) ? opts.type : null, + type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null, value, observer: createObserver(key) }; } else { // content:String properties[key] = { - type: PROP_TYPES.includes(opts) ? opts : null, + type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null, observer: createObserver(key) }; } diff --git a/packages/uni-mp-baidu/package.json b/packages/uni-mp-baidu/package.json index 63f4cb6f8..506159b0e 100644 --- a/packages/uni-mp-baidu/package.json +++ b/packages/uni-mp-baidu/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-baidu", - "version": "0.0.817", + "version": "0.0.818", "description": "uni-app mp-baidu", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index 9ce594191..655b83ddb 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -331,7 +331,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; } - } else if (CALLBACKS.includes(key)) { + } else if (CALLBACKS.indexOf(key) !== -1) { toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); } else { if (!keepFromArgs) { @@ -525,10 +525,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} - } - - if (!isPlainObject(data)) { - data = {}; + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { @@ -606,13 +606,13 @@ function getProperties (props, isBehavior = false) { value = value(); } properties[key] = { - type: PROP_TYPES.includes(opts.type) ? opts.type : null, + type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null, value, observer: createObserver(key) }; } else { // content:String properties[key] = { - type: PROP_TYPES.includes(opts) ? opts : null, + type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null, observer: createObserver(key) }; } diff --git a/packages/uni-mp-toutiao/package.json b/packages/uni-mp-toutiao/package.json index ec08f6faa..a01bb1a01 100644 --- a/packages/uni-mp-toutiao/package.json +++ b/packages/uni-mp-toutiao/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-toutiao", - "version": "0.0.317", + "version": "0.0.318", "description": "uni-app mp-toutiao", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index 938a0688c..e688db429 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -173,7 +173,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; } - } else if (CALLBACKS.includes(key)) { + } else if (CALLBACKS.indexOf(key) !== -1) { toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); } else { if (!keepFromArgs) { @@ -372,10 +372,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} - } - - if (!isPlainObject(data)) { - data = {}; + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { @@ -453,13 +453,13 @@ function getProperties (props, isBehavior = false) { value = value(); } properties[key] = { - type: PROP_TYPES.includes(opts.type) ? opts.type : null, + type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null, value, observer: createObserver(key) }; } else { // content:String properties[key] = { - type: PROP_TYPES.includes(opts) ? opts : null, + type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null, observer: createObserver(key) }; } diff --git a/packages/uni-mp-weixin/package.json b/packages/uni-mp-weixin/package.json index bc3caa4a9..8f96c5ab6 100644 --- a/packages/uni-mp-weixin/package.json +++ b/packages/uni-mp-weixin/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-weixin", - "version": "0.0.941", + "version": "0.0.942", "description": "uni-app mp-weixin", "main": "dist/index.js", "scripts": { diff --git a/src/core/runtime/wrapper.js b/src/core/runtime/wrapper.js index 8b33a4be5..f6a3e7e21 100644 --- a/src/core/runtime/wrapper.js +++ b/src/core/runtime/wrapper.js @@ -39,7 +39,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value toArgs[keyOption.name ? keyOption.name : key] = keyOption.value } - } else if (CALLBACKS.includes(key)) { + } else if (CALLBACKS.indexOf(key) !== -1) { toArgs[key] = processCallback(methodName, fromArgs[key], returnValue) } else { if (!keepFromArgs) { diff --git a/src/core/runtime/wrapper/util.js b/src/core/runtime/wrapper/util.js index 08e2e9c62..937f86a6a 100644 --- a/src/core/runtime/wrapper/util.js +++ b/src/core/runtime/wrapper/util.js @@ -41,10 +41,10 @@ export function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)) } catch (e) {} - } - - if (!isPlainObject(data)) { - data = {} + } + + if (!isPlainObject(data)) { + data = {} } Object.keys(methods).forEach(methodName => { @@ -122,13 +122,13 @@ export function getProperties (props, isBehavior = false) { value = value() } properties[key] = { - type: PROP_TYPES.includes(opts.type) ? opts.type : null, + type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null, value, observer: createObserver(key) } } else { // content:String properties[key] = { - type: PROP_TYPES.includes(opts) ? opts : null, + type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null, observer: createObserver(key) } } -- GitLab