Skip to content

Commit

Permalink
refactor(validation): remove deprecated block validation rule. Should…
Browse files Browse the repository at this point in the history
… be using 'Rule.custom' in v3.
  • Loading branch information
skogsmaskin committed Dec 20, 2022
1 parent 5b5e878 commit 5f92213
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/@sanity/validation/src/Rule.ts
Expand Up @@ -10,7 +10,6 @@ import {
ValidationMarker,
RuleTypeConstraint,
Validator,
Block,
} from '@sanity/types'
import {cloneDeep, get} from 'lodash'
import ValidationErrorClass from './ValidationError'
Expand Down Expand Up @@ -226,13 +225,6 @@ const Rule: RuleClass = class Rule implements IRule {
return this.cloneWithRules([{flag: 'custom', constraint: fn as CustomValidator}])
}

/**
* @deprecated use `Rule.custom` instead
*/
block(fn: CustomValidator<Block>): Rule {
return this.cloneWithRules([{flag: 'custom', constraint: fn as CustomValidator}])
}

min(len: number): Rule {
return this.cloneWithRules([{flag: 'min', constraint: len}])
}
Expand Down

0 comments on commit 5f92213

Please sign in to comment.