src/IndusBlogBundle/Resources/vue-app/utils/formatting.js
/*
if param length and param[0] === string  in simplifySchema
is because in makeSchema, array.some transform empty array too.
*/
if param length and param[0] === string  in simplifySchema
is because in makeSchema, array.some transform empty array too.
if param length and param [ 0 ] === string in simplifySchema is because in makeSchema array . some transform empty array too .
function simplifySchema(obj) {
  if (obj.interactions) {
    obj.interactions.forEach(i => {
      let x = parameterSchema;
      if (i.parameters) {
        if (i.parameters.length === 1 && i.parameters[0] === "string") {
          i.parameters = [x];
        } else if (i.parameters.every(e => deepEqual(e, x))) {
          i.parameters = [x];
        }
      }
    });
    let x = obj.interactions[0];
    if (obj.interactions.every(i => deepEqual(i, x))) {
      obj.interactions = [x];
    }
  }
  return obj;
}
function simplifySchema ( obj ) { if ( obj . interactions ) { obj . interactions . forEach ( i => { let x = parameterSchema ; if ( i . parameters ) { if ( i . parameters . length === 1 && i . parameters [ 0 ] === "string" ) { i . parameters = [ x ] ; } else if ( i . parameters . every ( e => deepEqual ( e , x ) ) ) { i . parameters = [ x ] ; } } } ) ; let x = obj . interactions [ 0 ] ; if ( obj . interactions . every ( i => deepEqual ( i , x ) ) ) { obj . interactions = [ x ] ; } } return obj ; }
if param length and param[0] === string  in simplifySchema
is because in makeSchema, array.some transform empty array too.
if param length and param [ 0 ] === string in simplifySchema is because in makeSchema array . some transform empty array too .