From 5f922131e5e5d73dff340a387af4931ff273b6a0 Mon Sep 17 00:00:00 2001 From: Per-Kristian Nordnes Date: Tue, 6 Dec 2022 09:28:20 +0100 Subject: [PATCH] refactor(validation): remove deprecated block validation rule. Should be using 'Rule.custom' in v3. --- packages/@sanity/validation/src/Rule.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/@sanity/validation/src/Rule.ts b/packages/@sanity/validation/src/Rule.ts index f0ac379b0cb..d563c58d7f3 100644 --- a/packages/@sanity/validation/src/Rule.ts +++ b/packages/@sanity/validation/src/Rule.ts @@ -10,7 +10,6 @@ import { ValidationMarker, RuleTypeConstraint, Validator, - Block, } from '@sanity/types' import {cloneDeep, get} from 'lodash' import ValidationErrorClass from './ValidationError' @@ -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): Rule { - return this.cloneWithRules([{flag: 'custom', constraint: fn as CustomValidator}]) - } - min(len: number): Rule { return this.cloneWithRules([{flag: 'min', constraint: len}]) }