1.1.1 • Published 10 years ago
object-to-firebase v1.1.1
object-to-firebase 
Recursively transform an object to its Firebase representation
Install
$ npm install object-to-firebaseUsage
var objectToFirebase = require('object-to-firebase')
objectToFirebase({
foo: {
bar: null
}
})
// => nullAPI
objectToFirebase(object) -> object / null
object
Required
Type: object
Traverses an object, converting values with value-to-firebase. The object is copied into its smallest possible Firebase representation, meaning:
- Empty objects are removed
nulland values that convert tonullare removed- These steps are performed recursively
This means the following object become null:
{
foo: {
bar: {
baz: {}
}
}
}And this:
{
foo: {
bar: 'hi',
baz: {
qux: null
}
}
}Becomes this:
{
foo: {
bar: 'hi'
}
}