@@ -55,17 +55,19 @@ type Schema = SchemaWithoutPipe<
5555 *
5656 * partialBy: (schema: BaseSchema<unknown, unknown, BaseIssue<unknown>>) => BaseSchema<unknown, unknown, BaseIssue<unknown>>
5757 */
58- interface ModifierHKT extends BaseHKT < 'partialBy' > {
58+ export interface PartialByModifierHKT extends BaseHKT < 'partialBy' > {
5959 argConstraint : [ schema : BaseSchema < unknown , unknown , BaseIssue < unknown > > ] ;
6060 result : BaseSchema < unknown , unknown , BaseIssue < unknown > > ;
61+
62+ schema : this[ 'args' ] [ 0 ] ;
6163}
6264
6365/**
6466 * Partial entries type.
6567 */
6668type PartialByEntries <
6769 TEntries extends ObjectEntries ,
68- TModifier extends BaseHKTable < ModifierHKT > ,
70+ TModifier extends BaseHKTable < PartialByModifierHKT > ,
6971 TKeys extends readonly ( keyof TEntries ) [ ] | undefined ,
7072> = {
7173 [ TKey in keyof TEntries ] : TKeys extends readonly ( keyof TEntries ) [ ]
@@ -80,7 +82,7 @@ type PartialByEntries<
8082 */
8183export type SchemaWithPartialBy <
8284 TSchema extends Schema ,
83- TModifier extends BaseHKTable < ModifierHKT > ,
85+ TModifier extends BaseHKTable < PartialByModifierHKT > ,
8486 TKeys extends ObjectKeys < TSchema > | undefined ,
8587> = TSchema extends
8688 | ObjectSchema < infer TEntries , ErrorMessage < ObjectIssue > | undefined >
@@ -270,7 +272,7 @@ export type SchemaWithPartialBy<
270272 */
271273export function partialBy <
272274 const TSchema extends Schema ,
273- const TModifier extends BaseHKTable < ModifierHKT > ,
275+ const TModifier extends BaseHKTable < PartialByModifierHKT > ,
274276> (
275277 schema : TSchema ,
276278 modifier : HKTImplementation < TModifier >
@@ -288,7 +290,7 @@ export function partialBy<
288290export function partialBy <
289291 const TSchema extends Schema ,
290292 const TKeys extends ObjectKeys < TSchema > ,
291- const TModifier extends BaseHKTable < ModifierHKT > ,
293+ const TModifier extends BaseHKTable < PartialByModifierHKT > ,
292294> (
293295 schema : TSchema ,
294296 modifier : HKTImplementation < TModifier > ,
@@ -298,17 +300,17 @@ export function partialBy<
298300// @__NO_SIDE_EFFECTS__
299301export function partialBy (
300302 schema : Schema ,
301- modifier : HKTImplementation < BaseHKTable < ModifierHKT > > ,
303+ modifier : HKTImplementation < BaseHKTable < PartialByModifierHKT > > ,
302304 keys ?: ObjectKeys < Schema >
303305) : SchemaWithPartialBy <
304306 Schema ,
305- BaseHKTable < ModifierHKT > ,
307+ BaseHKTable < PartialByModifierHKT > ,
306308 ObjectKeys < Schema > | undefined
307309> {
308310 // Create modified object entries
309311 const entries : PartialByEntries <
310312 ObjectEntries ,
311- BaseHKTable < ModifierHKT > ,
313+ BaseHKTable < PartialByModifierHKT > ,
312314 ObjectKeys < Schema >
313315 > = { } ;
314316 for ( const key in schema . entries ) {
0 commit comments