Type Utils
    Preparing search index...

    Function replaceSchemaTree

    • Replaces key guards in a (object) schema tree partially.

      Type Parameters

      • TOrigin extends {}

        The original schema type.

      • TReplace extends Partial<Record<keyof TOrigin, any>>

        The replacement schema type.

      Parameters

      Returns TypeGuard<
          {
              [K in string
              | number
              | symbol]: (Omit<TOrigin, keyof TReplace> & TReplace)[K]
          },
      >

      The modified schema with replaced key guards.

      If the schema is not a type guard or if the schema is not an object schema.