Skip to content

18.0.0 Release Notes #2926

@Marsup

Description

@Marsup

Summary

joi v18.0.0 is a small maintenance release which goal is mainly to drop node < 20 support by upgrading all the dependencies.

  • Upgrade time: low - no expected change in behavior
  • Complexity: low - no expected change in your code
  • Risk: medium - no major unit test had to change for this release, but a lot of dependencies changed
  • Dependencies: low - no changes to the extension system

Breaking Changes

Updated dependencies

  • address from v4.x to v5.x and changed to @hapi namespace
  • formula still in v3.x and changed to @hapi namespace
  • hoek from v10.x to v11.x
  • pinpoint still in v2.x and changed to @hapi namespace
  • topo from v5.x to v6.x
  • tlds added with v1.x

New Features

Migration Checklist

Drop node.js < v20

Check that you are using at least node v20.

Change in cidr option validation

cidr option passed to string().ip() is now validated differently and throws options.cidr must be one of required, optional, forbidden instead of options.cidr must be a string when you provide a bad cidr.

This change should not be a problem as it is usually a programmer's mistake which would have already been detected in joi v17.x. Unless you allow user input for this rule and rely on this message to detect a bad input.

Typescript array() change

In an effort to have better types, some types have moved a bit, the most notable being array. If you previously used explicit types with Joi.array<T>.items(...), you're likely going to have to change to Joi.array().items<T>(...).

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing codefeatureNew functionality or improvementrelease notesMajor release documentation

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions