Continued iterating on calculations, added failing test for bugs found

This commit is contained in:
Stefan Zermatten
2021-09-27 17:26:52 +02:00
parent 85e8756d1d
commit b0ee5cd304
9 changed files with 67 additions and 16 deletions

View File

@@ -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)