main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
494 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | var xtend = require('xtend')
|
---|
| 4 | var Schema = require('./schema')
|
---|
| 5 |
|
---|
| 6 | module.exports = merge
|
---|
| 7 |
|
---|
| 8 | function merge(definitions) {
|
---|
| 9 | var length = definitions.length
|
---|
| 10 | var property = []
|
---|
| 11 | var normal = []
|
---|
| 12 | var index = -1
|
---|
| 13 | var info
|
---|
| 14 | var space
|
---|
| 15 |
|
---|
| 16 | while (++index < length) {
|
---|
| 17 | info = definitions[index]
|
---|
| 18 | property.push(info.property)
|
---|
| 19 | normal.push(info.normal)
|
---|
| 20 | space = info.space
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | return new Schema(
|
---|
| 24 | xtend.apply(null, property),
|
---|
| 25 | xtend.apply(null, normal),
|
---|
| 26 | space
|
---|
| 27 | )
|
---|
| 28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.