You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.
for example, here is properties file which includes two items as followings:
CHAT_ENV=TEST
CHAT_ENV.LOCATION=US
in node version 0.10, it seems work fine, the only console is the type of data.CHAT_ENV.LOCATION is function
but in node version 4.2.3 , this line will throw a exception. because the tail = 'TEST, whose type is string , not a object.
The properties file is invalid in this case. The proposed solution would allow spud to silently skip over key/value pairs you thought you were defining.
The error message is currently pretty good as well. It is not difficult to infer the cause based on the fact that the error message includes the KVP strings where the problem originates.
The change I could envision making would be to throw an error here that's more specific: "Invalid key-value-pair detected. Don't assign a child key to a key which already defines a value."
Given the current default behavior is somewhat desirable but not perfect, this does not look like a high priority to me. But a PR would be welcome.
I looked into the code of parse.js file.
In line 83, when executing tail[prop] = value, it may throws an exception if the tail[prop] is a string.
could someone please add one if-statement, in order to avoid this exception, the code like:
if(typeof tail === 'object') {
tail[prop] = value; //current code
}
Thanks,
The text was updated successfully, but these errors were encountered: