bolgia
Version:
Bolgia an helper module for the config hell. It recursively clones mixes updates and improves configuration objects/hashes with nested properties. '..non ragioniam di lor ma guarda e passa..'
13 lines (12 loc) • 490 B
JavaScript
var log = console.log
, util = require( 'util')
, Bolgia = require( '../' )
, toHash = Bolgia.toHash
, list = [
'g' , '9999'
, 'h' , [ 'prop1', new Buffer(0), 'prop2', new Buffer( '-123456' ), 'prop3', [ 'hi', new Date() ] ]
]
, result = toHash( list, true, null, true )
;
log( '\n- nested array:\n', util.inspect( list, !true, null, true ) );
log( '\n- toHash(nested array) with type conversion:\n', util.inspect( result, !true, null, true ) );