lib/schema.js
function (schema, process) {
		var that = this;

		if (!(schema instanceof Schema)) {
			throw new Error('first argument must be instance of Schema');
		}

		if (process) {
			var r = process.call(this, schema);

			if (r != null && !r) {
				return this;
			}
		}

		_.each(schema.fields, function (fieldSchema, fieldName) {
			that.field(fieldName).like(fieldSchema, process);
		});

		if (process) {
			return this;
		}

		_.each(schema, function (value, key) {
			if (/^(_.*|fields)$/.test(key)) {
				return;
			}

			that[key] = _.cloneDeep(value);
		});

		return this;
	}
function (schema, process) {
		var that = this;

		if (!(schema instanceof Schema)) {
			throw new Error('first argument must be instance of Schema');
		}

		if (process) {
			var r = process.call(this, schema);

			if (r != null && !r) {
				return this;
			}
		}

		_.each(schema.fields, function (fieldSchema, fieldName) {
			that.field(fieldName).like(fieldSchema, process);
		});

		if (process) {
			return this;
		}

		_.each(schema, function (value, key) {
			if (/^(_.*|fields)$/.test(key)) {
				return;
			}

			that[key] = _.cloneDeep(value);
		});

		return this;
	}
function ( schema , process ) { var that = this ; if ( ! ( schema instanceof Schema ) ) { throw new Error ( 'first argument must be instance of Schema' ) ; } if ( process ) { var r = process . call ( this , schema ) ; if ( r != null && ! r ) { return this ; } } _ . each ( schema . fields , function ( fieldSchema , fieldName ) { that . field ( fieldName ) . like ( fieldSchema , process ) ; } ) ; if ( process ) { return this ; } _ . each ( schema , function ( value , key ) { if ( / ^(_.*|fields)$ / . test ( key ) ) { return ; } that [ key ] = _ . cloneDeep ( value ) ; } ) ; return this ; }
clone schema to this schema object

@method
@this {Schema}
@param {Schema} schema
@param {processFunction} [process]
@returns {Schema} new object (clone)
clone schema to this schema object