From 5b4edae490c346e29f5a59dc4f633a6960138955 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 2 Apr 2020 20:58:40 +0800 Subject: [PATCH] fix: format-log compatible with array --- packages/vue-cli-plugin-uni/lib/format-log.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vue-cli-plugin-uni/lib/format-log.js b/packages/vue-cli-plugin-uni/lib/format-log.js index b34bf74c2..fb6017e8e 100644 --- a/packages/vue-cli-plugin-uni/lib/format-log.js +++ b/packages/vue-cli-plugin-uni/lib/format-log.js @@ -19,9 +19,9 @@ export default function formatLog () { } var msgs = args.map(function (v) { - var type = Object.prototype.toString.call(v) + var type = Object.prototype.toString.call(v).toLowerCase() - if (type.toLowerCase() === '[object object]') { + if (type === '[object object]' || type === '[object array]') { try { v = '---BEGIN:JSON---' + JSON.stringify(v) + '---END:JSON---' } catch (e) { -- GitLab