Code coverage report for src/Common/Schema/Mixins/SchemaSerialization.js

Statements: 85.71% (6 / 7)      Branches: 100% (0 / 0)      Functions: 66.67% (2 / 3)      Lines: 85.71% (6 / 7)      Ignored: none     

All files » src/Common/Schema/Mixins/ » SchemaSerialization.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41    1                       1                 1 21                   1           1
"use strict";
 
var _       = require("lodash"),
    Safe    = require("../../Safe");
 
/**
 *
 * Serialization methods for SchemaDefinition.
 *
 * @scope {SchemaDefinition}
 * 
 * @type {Object}
 *
 */
var Serialization = function(){
 
    /**
     *
     * Serializes the schema definition.
     *
     * @return {Object}
     *
     */
    this.serialize = function(){
        return _.cloneDeep(this);
    };
 
    /**
     *
     * Deserializes the object into a SchemaDefinition
     *
     * @return {SchemaDefinition}
     *
     */
    this.deserialize = function(value){
        return new this.constructor(value);
    };
 
};
 
module.exports = Serialization;