Files
30-seconds-of-code/node_modules/property-information/lib/util/merge.js
2019-08-20 15:52:05 +02:00

29 lines
494 B
JavaScript

'use strict'
var xtend = require('xtend')
var Schema = require('./schema')
module.exports = merge
function merge(definitions) {
var length = definitions.length
var property = []
var normal = []
var index = -1
var info
var space
while (++index < length) {
info = definitions[index]
property.push(info.property)
normal.push(info.normal)
space = info.space
}
return new Schema(
xtend.apply(null, property),
xtend.apply(null, normal),
space
)
}