From a43a286dfad494f05b7a2e2627e184cf3aaafb66 Mon Sep 17 00:00:00 2001 From: what Date: Fri, 9 Aug 2024 17:57:03 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20toPrimitive=20=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=BD=AC=E6=95=B0=E5=AD=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/lodash.mixin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lodash.mixin.js b/lib/lodash.mixin.js index 6ad608b..cb31bfb 100755 --- a/lib/lodash.mixin.js +++ b/lib/lodash.mixin.js @@ -9,9 +9,9 @@ const convertFns = { string2json: (data) => data ? JSON.parse(data) : '{}', string2array: (data) => data.substr(0, 1) === '[' && data.substr(-1) === ']' ? JSON.parse(data) : data.split(','), - string2number: (data) => data == '' ? null : +data, - string2integer: (data) => data == '' ? null : +data, - string2float: (data) => data == '' ? null : +data, + string2number: (data) => data == '' ? 0 : +data, + string2integer: (data) => data == '' ? 0 : +data, + string2float: (data) => data == '' ? 0 : +data, string2bool: (data) => { switch (`${data}`.toLowerCase()) { case '0':