ts-error-translator
ts-error-translator copied to clipboard
Translation request for 2790
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
}