aemonge / path-ify

Converts a neested object, into a single object with path as keys. It's aim is to aid using objects as queries for mongodb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Forms a object composed of the path from the given object.

  it('2.1 to be ', function() {
    (pathify.toPath({b: {a: 1, c: 2}})).should.deepEqual({
      'b.a': 1,
      'b.c': 2
    });
  });

  it('2.2 to be ', function() {
    (pathify.toPath({b: {a: 1, c: 2}, d: {a: {j: [0, 1, 2]}}})).should.deepEqual({
      'b.a': 1,
      'b.c': 2,
      'd.a.j': [0, 1, 2]
    });
  });

About

Converts a neested object, into a single object with path as keys. It's aim is to aid using objects as queries for mongodb


Languages

Language:JavaScript 100.0%