Merge pull request #232 from vatesfr/fix-xapi-updateObjectMapProperty
Xapi#_updateObjectMapProperty(): fix major issue.
This commit is contained in:
commit
1a2ef6479e
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 prepareXapiParam = param => {
|
||||
// if (isFinite(param) && !isInteger(param)) { return asFloat(param) }
|
||||
if (isInteger(param)) { return asInteger(param) }
|
||||
if (isBoolean(param)) { return asBoolean(param) }
|
||||
if (isObject(param)) { return map(filterUndefineds(param), prepareXapiParam) }
|
||||
// if (isFinite(param) && !isInteger(param)) {
|
||||
// return asFloat(param)
|
||||
// }
|
||||
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