68abe0029a3b3b1d6c796042cffd890892a7514b
[platform/framework/web/crosswalk-tizen.git] /
1 "use strict"
2
3 import protochain from 'protochain'
4
5 export default serializerr
6
7 function serializerr(obj = {}) {
8   let chain = protochain(obj)
9   .filter(obj => obj !== Object.prototype)
10   return [obj]
11   .concat(chain)
12   .map(item => Object.getOwnPropertyNames(item))
13   .reduce((result, names) => {
14     names.forEach(name => result[name] = obj[name])
15     return result
16   }, {})
17 }
18
19 serializerr.serializerr = serializerr