-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
I added this patch to remove the call to superstruct
from release build if you do a lot of logging in a list this call ads up and was really expensive. Maybe it is something that is interesting for other people as well. I could also do a poll request if helpful.
diff --git a/lib/struct.js b/lib/struct.js
index 0d820e070517d1a9882e3699b2e14030ee93a686..7599af00b2fd60f45021777338b68f72cff3b154 100644
--- a/lib/struct.js
+++ b/lib/struct.js
@@ -18,6 +18,10 @@ import { isUndefined } from '@react-native-firebase/app/lib/common/validate';
import { create } from 'superstruct';
export const validateStruct = (value = {}, struct, prefix = '') => {
+ if(!__DEV__) {
+ return value;
+ }
+
try {
return create(value, struct);
} catch (e) {