modules/react-native-mlkit-face-detection/ios/RNMLKitFaceDetectionModule.swift has this helper function:
// Function to reject a promise with a specified message and domain
func rejectPromiseWithMessage(promise: Promise, message: String, domain: String) {
promise.reject(
NSError(domain: domain, code: 1, userInfo: [NSLocalizedDescriptionKey: message])
)
}
Which I have need for in Barcode Scanning. We should package that up with core, IMO.