ts-error-translator icon indicating copy to clipboard operation
ts-error-translator copied to clipboard

Translation request for 2790

Open mhdalmajid opened this issue 1 year ago • 0 comments

Error Text

The operand of a 'delete' operator must be optional.

Supporting Information

Please provide other information which led to this error, and any specific questions you have about it: I am following sequalize suggestion for using the lib with lambda Here

export const getSequelize = async () => {
  if (!sequelize) {
    sequelize = await loadSequelize()
  } else {
    // restart connection pool to ensure connections are not re-used across invocations
    sequelize.connectionManager.initPools()

    // restore `getConnection()` if it has been overwritten by `close()`
    if (sequelize.connectionManager.hasOwnProperty('getConnection')) {
      delete sequelize.connectionManager.getConnection // Error: The operand of a 'delete' operator must be optional.
    }
  }

  return sequelize
}

mhdalmajid avatar Oct 13 '24 12:10 mhdalmajid