1.0.8 • Published 9 years ago

french-toast v1.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

french-toast

Convert a flat JSON structure (like a SQL result) into a nested object. It will flatten it back up again. Also breakfast.

Example

var brunch = require('french-toast');

var main = {
    'address.street.main': '123 Test Dr',
    'address.street.secondary': 'Apt 404',
    'address.city': 'Testville',
    'address.state': 'Florida',
    'name': 'Testing',
    'age': 25,
    'likes.pop_tarts': false,
    'likes.toaster_strudles': null,
    'likes.french_toast': true
};


// Scramble will create better associations for flat data
var a = brunch.scramble([main, main], ':');
console.log(a);

// Just a peek, since we go kind of deep into that object
console.log('Street:', a[0].address.street)

// Flatten it back up again!
var b = brunch.pancake(a);
console.log(b);
1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago