ttaubert/node-accessors — pull request #1 by andyburke (2014-04-30 10:29:54+00:00)
Title: Add array access in addition to appending.

This adds the ability to access arrays in addition to the ability to append to them. It allows both reading an writing into arrays as one might expect.

It also changes the set/get methods to be on the Accessors function and makes the Accessor.prototype.set/get into wrappers for those. This should cut down on unnecessary allocations of new Accessor objects. In the previous implementation, every Accessor.get(...) or Accessor.set(...) call would end up allocating and then releasing an Accessor object. Now that allocation will only happen if they explicitly call Accessor(obj).

I made these changes because I need to be able to access array elements, eg:

```javascript
// before:
// foo: {
// bar: [
// { baz: 'lemur' },
// { baz: 'sloth' },
// { baz: 'seal' }
// ]
// }

Accessor.set( 'foo.bar[1].baz', 'yak' );

// after:
// foo: {
// bar: [
// { baz: 'lemur' },
// { baz: 'yak' },
// { baz: 'seal' }
// ]
// }
```

Open to discussion if you have issues with this PR that we can work through.