mirror of
https://github.com/chylex/objtree.git
synced 2025-04-29 11:34:08 +02:00
Fix single letter key names being put in []
This commit is contained in:
parent
09de177735
commit
9f984a3181
@ -74,8 +74,8 @@ OBJECT TREE
|
||||
|-- [var] testObject['testSpecial-Name!'] > (null)
|
||||
|-- [fun] testClass()
|
||||
|-- testClass.prototype
|
||||
|-- [fun] testClass.prototype['a']()
|
||||
|-- [fun] testClass.prototype['b']()
|
||||
|-- [fun] testClass.prototype.a()
|
||||
|-- [fun] testClass.prototype.b()
|
||||
|-- [var] testClass.CONSTANT > true
|
||||
|-- [var] testClass.data > 10
|
||||
|-- [fun] testFunction(a, b, c)
|
||||
|
@ -131,7 +131,7 @@
|
||||
return v === 0 ? +(entry1[0] > entry2[0]) : v;
|
||||
};
|
||||
|
||||
var keyRegex = /^[a-z_$][a-z0-9_$]+$/i;
|
||||
var keyRegex = /^[a-z_$][a-z0-9_$]*$/i;
|
||||
|
||||
var getKeyAccess = function(key){
|
||||
return keyRegex.test(key) ? "."+key : "['"+key+"']";
|
||||
|
Loading…
Reference in New Issue
Block a user