Permalink
Browse files

joinPath fix for values like

_path
path_path
path_
path0path
  • Loading branch information...
1 parent 1c43d5e commit 800e054029d1ba22d8223b540020d80d388ec55d @tu1ly tu1ly committed Jun 19, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/engines/json/joinPath.js
@@ -12,9 +12,9 @@ Validation.prototype.joinPath = function(path, property) {
// Converts the ‘property’ to a string
property = property + '';
- if (property.match(/^[a-zA-Z][a-zA-Z0-9]*$/)) {
+ if (property.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)) {
return (path) ? (path + '.' + property) : property;
- } else if (property.match(/\d+/)) {
+ } else if (property.match(/^\d+$/)) {
return path + '[' + property + ']';
} else {
return path + '["' + property + '"]';

0 comments on commit 800e054

Please sign in to comment.