code: function(node, name, data) {
    typeCheckString(key, 'key');
    typeCheckObject(data, 'data');
    typeCheckObject(node, 'node');
    runValidator(node, 'node');
  
    if (typeof node !== 'object') {
      throw new error.InvalidParameterError(
        'Parameter ast must be a well-defined JSON object.'
      );
    }
    if (validator(node)) {
      throw new error.MalformedAstError(
        'Parameter ast needs to be a JSON structure according to the schema.'
      );
    }
    if (typeof data !== 'object') {
      throw new error.InvalidParameterError(
        'Parameter data must be a well-defined JSON object.'
      );
    }
    if (typeof name !== 'string') {
      throw new error.InvalidParameterError('Parameter name must be a string.');
    }
    const newNode = Object.assign({}, node);
    if (newNode.properties) {
      newNode.properties[name] = data;
    }
    return newNode;
  }
docs: /* value ==> data 
  @name setProperty
  @description
  Function to add a property to a node or change the value if the property already exists.
  @param {*} node
  @param {*} name
  @param {*} data
  @return {object} Modfied Node