A mandatory dependency is:
- a function that your function calls
- that your function receives as a parameter from the caller
- and the parameter has no default value
For example:
// `logger` is a mandatory dependency
// the caller has to provide it
//
// `db` is also a mandatory dependency
// the caller has to provide it as well
function doQuery(logger: Logger, db: DbConn, sql: string): unknown {
logger.debug("executing query: " + sql);
return db.query(sql);
}