Xapi#_updateObjectMapProperty(): fix major issue.
This commit is contained in:
parent
ba66af922f
commit
32236962f5
18
src/xapi.js
18
src/xapi.js
@ -113,10 +113,20 @@ const asInteger = value => String(value)
|
|||||||
const filterUndefineds = obj => pick(obj, value => value !== undefined)
|
const filterUndefineds = obj => pick(obj, value => value !== undefined)
|
||||||
|
|
||||||
const prepareXapiParam = param => {
|
const prepareXapiParam = param => {
|
||||||
// if (isFinite(param) && !isInteger(param)) { return asFloat(param) }
|
// if (isFinite(param) && !isInteger(param)) {
|
||||||
if (isInteger(param)) { return asInteger(param) }
|
// return asFloat(param)
|
||||||
if (isBoolean(param)) { return asBoolean(param) }
|
// }
|
||||||
if (isObject(param)) { return map(filterUndefineds(param), prepareXapiParam) }
|
if (isInteger(param)) {
|
||||||
|
return asInteger(param)
|
||||||
|
}
|
||||||
|
if (isBoolean(param)) {
|
||||||
|
return asBoolean(param)
|
||||||
|
}
|
||||||
|
if (isObject(param)) {
|
||||||
|
return map(filterUndefineds(param), prepareXapiParam)
|
||||||
|
}
|
||||||
|
|
||||||
|
return param
|
||||||
}
|
}
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user