TypeError: Object.keys called on non-object
at Function.keys (native)
at JSONDeepEquals (/var/task/node_modules/cfn-lambda/src/JSONDeepEquals.js:13:19)
at /var/task/node_modules/cfn-lambda/src/JSONDeepEquals.js:21:16
at Array.every (native)
at JSONDeepEquals (/var/task/node_modules/cfn-lambda/src/JSONDeepEquals.js:20:34)
at /var/task/node_modules/cfn-lambda/src/JSONDeepEquals.js:29:9
at Array.every (native)
at JSONDeepEquals (/var/task/node_modules/cfn-lambda/src/JSONDeepEquals.js:24:40)
at CfnLambda (/var/task/node_modules/cfn-lambda/index.js:172:11)
with these parameters.
var Params = {
"arr": [
"str"
]
};
var OldParams= {
"arr": [
"str"
]
};
console.log(JSONDeepEquals(Params, OldParams));
Perhaps , I think that because node version is v0.10.36.
On node v5.6.0 environment , Object.keys('string') is no problem.
But, on v0.10.36 environment , error occurs .
I suggest that you change the order of processing .
if (Object(a) !== a) {
return a === b;
}
var ka = Object.keys(a).sort();
var kb = Object.keys(b).sort();
I encountered an error .
with these parameters.
Perhaps , I think that because node version is v0.10.36. On node v5.6.0 environment ,
Object.keys('string')
is no problem. But, on v0.10.36 environment , error occurs .I suggest that you change the order of processing .