modules/pencil.js/pencil.js
function from (json) {
    const instance = exportableClasses[json.constructor].from(json);
    if (json.children) {
        instance.add(...json.children.map(child => from(child)));
    }
    return instance;
}
function from (json) {
    const instance = exportableClasses[json.constructor].from(json);
    if (json.children) {
        instance.add(...json.children.map(child => from(child)));
    }
    return instance;
}
function from ( json ) { const instance = exportableClasses [ json . constructor ] . from ( json ) ; if ( json . children ) { instance . add ( ... json . children . map ( child => from ( child ) ) ) ; } return instance ; }
Construct Pencil objects from a JSON
@param {Object} json - Valid JSON
@return {*}
Construct Pencil objects from a JSON