Continued iterating on calculations, added failing test for bugs found
This commit is contained in:
@@ -4,10 +4,13 @@ import { unset } from 'lodash';
|
||||
export default function removeSchemaFields(schemas, prop){
|
||||
schemas.forEach(schema => {
|
||||
schema._schemaKeys.forEach(key => {
|
||||
// Skip object and array keys
|
||||
// Skip object and array keys, except the errors array
|
||||
if (
|
||||
schema.getQuickTypeForKey(key) === 'object' ||
|
||||
schema.getQuickTypeForKey(key) === 'objectArray'
|
||||
(
|
||||
schema.getQuickTypeForKey(key) === 'objectArray' &&
|
||||
key.slice(-6)!== 'errors'
|
||||
)
|
||||
) return;
|
||||
// Unset other computed only keys
|
||||
applyFnToKey(prop, key, unset)
|
||||
|
||||
Reference in New Issue
Block a user