0.3.0 • Published 8 years ago

barrow v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

barrow

Usage

var origin ={
  a: '3',
  b: [
    {
      c: 'Peter'
    },
    {
      c: 'Paul'
    }
  ],
  d: {
    e: '300'
  },
  f: -1
};
var mapping = {
  user: Barrow.Types.repeat('b', {
    name: 'c'
  }),
  _page: 'a',
  _extra: {
    status: 'd.e|number'
  },
  _ok: Barrow.Types.func(function (source) {
    return source.f > -1;
  }),
  _from: Barrow.Types.val('barrow')
};
console.log(Barrow(mapping).transfer(source));
// {
//    user: [
//      {
//        name: 'Peter'
//      },
//      {
//        name: 'Paul'
//      }
//    ],
//    _page: '3',
//    _extra: {
//      status: 300
//    },
//    _ok: false,
//    _from: 'barrow'
//  };

License

the MIT License

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago