Optimized some slow parts of the engine.
Last low hanging fruit: parsing is slow, cache parsed calculations
This commit is contained in:
@@ -3,17 +3,8 @@ import { unset } from 'lodash';
|
||||
|
||||
export default function removeSchemaFields(schemas, prop){
|
||||
schemas.forEach(schema => {
|
||||
schema._schemaKeys.forEach(key => {
|
||||
// Skip object and array keys, except the errors array
|
||||
if (
|
||||
schema.getQuickTypeForKey(key) === 'object' ||
|
||||
(
|
||||
schema.getQuickTypeForKey(key) === 'objectArray' &&
|
||||
key.slice(-6)!== 'errors'
|
||||
)
|
||||
) return;
|
||||
// Unset other computed only keys
|
||||
applyFnToKey(prop, key, unset)
|
||||
});
|
||||
schema.removeBeforeComputeFields().forEach(
|
||||
key => applyFnToKey(prop, key, unset)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user