osc listener: only json-parse stringified objects/arrays/bool/null, not stringified primitives
This commit is contained in:
parent
1946549514
commit
7e0921fb89
2 changed files with 8 additions and 3 deletions
|
|
@ -43,6 +43,11 @@ module.exports = {
|
|||
// ref in source: https://github.com/douglascrockford/JSON-js
|
||||
return ' \n+-eE{([0123456789tfn"'.indexOf(str[0]) !== -1
|
||||
|
||||
},
|
||||
|
||||
isJSONObject: function(str) {
|
||||
// same, but only for object/array/bool/null
|
||||
return '{[tfn'.indexOf(str[0]) !== -1
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue