Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

joi

Package Overview
Dependencies
Maintainers
6
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi - npm Package Compare versions

Comparing version 17.11.1 to 17.12.0

18

lib/types/string.js

@@ -30,3 +30,7 @@ 'use strict';

dataUriRegex: /^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,
hexRegex: /^[a-f0-9]+$/i,
hexRegex: {
withPrefix: /^0x[0-9a-f]+$/i,
withOptionalPrefix: /^(?:0x)?[0-9a-f]+$/i,
withoutPrefix: /^[0-9a-f]+$/i
},
ipRegex: Ip.regex({ cidr: 'forbidden' }).regex,

@@ -372,6 +376,7 @@ isoDurationRegex: /^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,

Common.assertOptions(options, ['byteAligned']);
Common.assertOptions(options, ['byteAligned', 'prefix']);
options = { byteAligned: false, ...options };
options = { byteAligned: false, prefix: false, ...options };
Assert(typeof options.byteAligned === 'boolean', 'byteAligned must be boolean');
Assert(typeof options.prefix === 'boolean' || options.prefix === 'optional', 'prefix must be boolean or "optional"');

@@ -382,3 +387,8 @@ return this.$_addRule({ name: 'hex', args: { options } });

if (!internals.hexRegex.test(value)) {
const re = options.prefix === 'optional' ?
internals.hexRegex.withOptionalPrefix :
options.prefix === true ?
internals.hexRegex.withPrefix :
internals.hexRegex.withoutPrefix;
if (!re.test(value)) {
return helpers.error('string.hex');

@@ -385,0 +395,0 @@ }

{
"name": "joi",
"description": "Object schema validation",
"version": "17.11.1",
"version": "17.12.0",
"repository": "git://github.com/hapijs/joi",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc