From c70f0bcc244679ab18b8a4d5ed571a00a1e276e0 Mon Sep 17 00:00:00 2001 From: Brandon Gano Date: Thu, 7 Nov 2024 21:10:33 -0800 Subject: [PATCH] Clarify documentation for empty() --- API.md | 4 ++-- lib/index.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/API.md b/API.md index 68651cc6..84e3e549 100755 --- a/API.md +++ b/API.md @@ -723,8 +723,8 @@ const schema = Joi.any().description('this key will match anything you give it') #### `any.empty(schema)` -Considers anything that matches the schema to be empty (`undefined`). -- `schema` - any object or **joi** schema to match. An undefined schema unsets that rule. +Considers anything that matches the schema to be empty (`undefined`). Overrides any previous calls to empty. +- `schema` - an object, value, or **joi** schema to match or an array of objects, values, and **joi** schemas to match. An undefined schema unsets that rule. ```js let schema = Joi.string().empty(''); diff --git a/lib/index.d.ts b/lib/index.d.ts index c224c991..0c27b832 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1057,8 +1057,8 @@ declare namespace Joi { disallow(...values: any[]): this; /** - * Considers anything that matches the schema to be empty (undefined). - * @param schema - any object or joi schema to match. An undefined schema unsets that rule. + * Considers anything that matches the schema to be empty (undefined). Overrides any previous calls to empty. + * @param schema - an object, value, or joi schema to match or an array of objects, values, and joi schemas to match. An undefined schema unsets that rule. */ empty(schema?: SchemaLike): this;