[fix] toPrimitive 空字符串转数字错误
This commit is contained in:
parent
51082bf78b
commit
a43a286dfa
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user