I know is longer but safer:

`typeof onDeletedError === 'function'`