@@ -51,8 +51,6 @@ const NO_VALUE = Symbol('no Value');
5151 * - For each element in the `data` recursively sanitize the data, stopping at `maxItems` if specified
5252 * - Otherwise, just return the `data` removing any values after `maxItems` if it is set
5353 * - If the type of the old and new schema `items` are booleans of the same value, return `data` as is
54- * - If the new schema contains a default value then:
55- * - return the default value. We expect this to be a scalar value
5654 * - Otherwise return `undefined`
5755 *
5856 * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
@@ -62,8 +60,7 @@ const NO_VALUE = Symbol('no Value');
6260 * @param [data={ }] - The form data associated with the schema, defaulting to an empty object when undefined
6361 * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas
6462 * @returns - The new form data, with all the fields uniquely associated with the old schema set
65- * to `undefined`. Will return `undefined` if the new schema is not an object containing properties
66- * and doesn't provide a default value
63+ * to `undefined`. Will return `undefined` if the new schema is not an object containing properties.
6764 */
6865export default function sanitizeDataForNewSchema <
6966 T = any ,
@@ -237,12 +234,5 @@ export default function sanitizeDataForNewSchema<
237234 }
238235 // Also probably want to deal with `prefixItems` as tuples with the latest 2020 draft
239236 }
240- // Schema contains a single scalar value
241- else {
242- const newDefaultValue = get ( newSchema , 'default' ) ;
243- if ( newDefaultValue !== undefined ) {
244- newFormData = newDefaultValue ;
245- }
246- }
247237 return newFormData as T ;
248238}
0 commit comments