• Traverses and mutates values in a JSON schema-based structure, applying the given mutation function to each value. The function is designed to work with nested maps and arrays, recursively processing each element.

    Parameters

    • jsonSchema: JsonSchemaExtended

      The JSON schema object that describes the structure of the value. It must have a serializationType of 'map', 'array', or other custom types like 'entity'.

    • value: unknown

      The value to be mutated, which should conform to the provided JSON schema.

    • mutateFn: ((value: unknown, valueType: JsonSchemaExtended) => {
          changed: boolean;
          value?: any;
      })

      A function that takes a value and its corresponding valueType (JsonSchemaExtended) as arguments and returns a tuple [boolean, any]. The boolean indicates whether the mutation should be applied, and the second element is the mutated value.

        • (value: unknown, valueType: JsonSchemaExtended): {
              changed: boolean;
              value?: any;
          }
        • Parameters

          Returns {
              changed: boolean;
              value?: any;
          }

          • changed: boolean
          • Optional value?: any

    Returns void