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

@hapi/validate

Package Overview
Dependencies
Maintainers
6
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/validate - npm Package Compare versions

Comparing version 1.1.3 to 2.0.0

10

lib/base.js

@@ -194,4 +194,4 @@ 'use strict';

for (const item of conditions) {
Assert(!item.then || item.then.type === 'any' || item.then.type === obj.type, 'Cannot combine', obj.type, 'with', item.then && item.then.type);
Assert(!item.otherwise || item.otherwise.type === 'any' || item.otherwise.type === obj.type, 'Cannot combine', obj.type, 'with', item.otherwise && item.otherwise.type);
Assert(!item.then || item.then.type === 'any' || item.then.type === obj.type, 'Cannot combine', obj.type, 'with', item.then?.type);
Assert(!item.otherwise || item.otherwise.type === 'any' || item.otherwise.type === obj.type, 'Cannot combine', obj.type, 'with', item.otherwise?.type);

@@ -447,3 +447,3 @@ }

const family = this._definition[source][name] && this._definition[source][name].register;
const family = this._definition[source][name]?.register;
if (family !== false) {

@@ -531,4 +531,4 @@ this.$_mutateRegister(item, { family, key });

target._preferences = this._preferences;
target._valids = this._valids && this._valids.clone();
target._invalids = this._invalids && this._invalids.clone();
target._valids = this._valids?.clone();
target._invalids = this._invalids?.clone();
target._rules = this._rules.slice();

@@ -535,0 +535,0 @@ target._singleRules = Clone(this._singleRules, { shallow: true });

@@ -119,3 +119,3 @@ 'use strict';

const string = internals.stringify(rendered, prefs, options.errors);
const result = part.raw || (options.errors && options.errors.escapeHtml) === false ? string : EscapeHtml(string);
const result = (part.raw || options.errors?.escapeHtml === false) ? string : EscapeHtml(string);
parts.push(internals.wrap(result, part.wrapped && prefs.errors.wrap.label));

@@ -122,0 +122,0 @@ }

@@ -51,4 +51,4 @@ 'use strict';

if (typeof value !== 'boolean') {
value = schema.$_terms.truthy && schema.$_terms.truthy.has(value, null, null, !schema._flags.sensitive) ||
(schema.$_terms.falsy && schema.$_terms.falsy.has(value, null, null, !schema._flags.sensitive) ? false : value);
value = schema.$_terms.truthy?.has(value, null, null, !schema._flags.sensitive) ||
(schema.$_terms.falsy?.has(value, null, null, !schema._flags.sensitive) ? false : value);
}

@@ -55,0 +55,0 @@

@@ -148,3 +148,3 @@ 'use strict';

return { perspective: state.schemas[ref.ancestor] && state.schemas[ref.ancestor].schema, path: ref.path };
return { perspective: state.schemas[ref.ancestor]?.schema, path: ref.path };
};

@@ -151,0 +151,0 @@

@@ -395,3 +395,3 @@ 'use strict';

const length = encoding ? Buffer && Buffer.byteLength(value, encoding) : value.length; // $lab:coverage:ignore$
const length = encoding ? Buffer.byteLength(value, encoding) : value.length;
if (Common.compare(length, limit, operator)) {

@@ -606,3 +606,3 @@ return value;

Assert(!encoding || Buffer && Buffer.isEncoding(encoding), 'Invalid encoding:', encoding); // $lab:coverage:ignore$
Assert(!encoding || Buffer.isEncoding(encoding), 'Invalid encoding:', encoding);

@@ -609,0 +609,0 @@ return schema.$_addRule({ name, method: 'length', args: { limit, encoding }, operator });

@@ -1,2 +0,3 @@

Copyright (c) 2012-2020, Sideway Inc, and project contributors
Copyright (c) 2012-2022, Project contributors
Copyright (c) 2012-2020, Sideway Inc
Copyright (c) 2012-2014, Walmart.

@@ -3,0 +4,0 @@ All rights reserved.

{
"name": "@hapi/validate",
"description": "Object schema validation",
"version": "1.1.3",
"version": "2.0.0",
"repository": "git://github.com/hapijs/validate",

@@ -10,10 +10,16 @@ "main": "lib/index.js",

],
"eslintConfig": {
"extends": [
"plugin:@hapi/module"
]
},
"dependencies": {
"@hapi/hoek": "^9.0.0",
"@hapi/topo": "^5.0.0"
"@hapi/hoek": "^10.0.0",
"@hapi/topo": "^6.0.0"
},
"devDependencies": {
"@hapi/bourne": "2.x.x",
"@hapi/code": "8.x.x",
"@hapi/lab": "24.x.x"
"@hapi/bourne": "^3.0.0",
"@hapi/code": "^9.0.0",
"@hapi/eslint-plugin": "*",
"@hapi/lab": "25.0.0-beta.1"
},

@@ -20,0 +26,0 @@ "scripts": {

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