code: function toMysqlObj(obj) {
    if (obj === undefined || obj === null)
      return "NULL";
  
    switch (obj.constructor) {
    case Date:
      return `'${formatDate(obj)}'`;
  
    case String:
      return `'${obj.replace(/'/g, "''")}'`;
  
    case Number:
      return obj;
  
    default:
      throw new TypeError(`${util.inspect(obj)}`);
    }
  }
docs: Transform normal Javascript object to Mysql object. Only String, Number,
  Date are supported.