Skip to content

Version 1.0.41#1416

Merged
sinclairzx81 merged 3 commits into
mainfrom
fix
Oct 20, 2025
Merged

Version 1.0.41#1416
sinclairzx81 merged 3 commits into
mainfrom
fix

Conversation

@sinclairzx81
Copy link
Copy Markdown
Owner

This PR applies an update to Repair to support sub schema Refine recovery.

Resolves for the following case

Test('Should Refine 5', () => {
  const T = Type.Object({      
    bounds: Type.Refine(                   // <-- should ONLY correct this value 
      Type.Object({
        max: Type.Integer({ default: 10 }),
        min: Type.Integer({ default: 5 })
      }),
      (value) => value.max > value.min
    ),
    otherData: Type.String({ default: '' }) // <-- should retain this value
  })
  const R = Value.Repair(T, { bounds: { max: 10, min: 15 }, otherData: 'keep this' })
  Assert.IsEqual(R, { bounds: { max: 10, min: 5 }, otherData: 'keep this' })
})

Reference #1414 (comment)

@sinclairzx81 sinclairzx81 merged commit 5584592 into main Oct 20, 2025
6 checks passed
@sinclairzx81 sinclairzx81 deleted the fix branch October 20, 2025 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant