Socket
Socket
Sign inDemoInstall

@hapi/statehood

Package Overview
Dependencies
9
Maintainers
6
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.4 to 8.0.0

16

lib/index.js

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

this.settings = Hoek.applyToDefaults(internals.defaults, options || {});
this.settings = Hoek.applyToDefaults(internals.defaults, options ?? {});
Validate.assert(this.settings, internals.schema, 'Invalid state definition defaults');

@@ -95,3 +95,3 @@

const settings = Hoek.applyToDefaults(this.settings, options || {}, { nullOverride: true });
const settings = Hoek.applyToDefaults(this.settings, options ?? {}, { nullOverride: true });
Validate.assert(settings, internals.schema, 'Invalid state definition: ' + name);

@@ -161,3 +161,3 @@

const value = state[name];
const definition = this.cookies[name] || this.settings;
const definition = this.cookies[name] ?? this.settings;

@@ -243,3 +243,3 @@ // Validate cookie

const base = this.cookies[cookie.name] || this.settings;
const base = this.cookies[cookie.name] ?? this.settings;
let definition = cookie.options ? Hoek.applyToDefaults(base, cookie.options, { nullOverride: true }) : base;

@@ -419,3 +419,3 @@

const macOptions = Hoek.clone(definition.sign.integrity || Iron.defaults.integrity);
const macOptions = Hoek.clone(definition.sign.integrity ?? Iron.defaults.integrity);
macOptions.salt = hmacSalt;

@@ -444,3 +444,3 @@ const mac = await Iron.hmacWithPassword(definition.sign.password, macOptions, [internals.macPrefix, name, unsigned].join('\n'));

if (definition.encoding === 'iron') {
return await Iron.unseal(value, definition.password, definition.iron || Iron.defaults);
return await Iron.unseal(value, definition.password, definition.iron ?? Iron.defaults);
}

@@ -494,3 +494,3 @@

if (options.encoding === 'iron') {
return Iron.seal(value, options.password, options.iron || Iron.defaults);
return Iron.seal(value, options.password, options.iron ?? Iron.defaults);
}

@@ -521,3 +521,3 @@

const mac = await Iron.hmacWithPassword(options.password, options.integrity || Iron.defaults.integrity, [internals.macPrefix, name, value].join('\n'));
const mac = await Iron.hmacWithPassword(options.password, options.integrity ?? Iron.defaults.integrity, [internals.macPrefix, name, value].join('\n'));
const signed = value + '.' + mac.salt + '*' + mac.digest;

@@ -524,0 +524,0 @@ return signed;

@@ -1,3 +0,4 @@

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

@@ -4,0 +5,0 @@

{
"name": "@hapi/statehood",
"description": "HTTP State Management Utilities",
"version": "7.0.4",
"version": "8.0.0",
"repository": "git://github.com/hapijs/statehood",

@@ -22,14 +22,14 @@ "main": "lib/index.js",

"dependencies": {
"@hapi/boom": "9.x.x",
"@hapi/bounce": "2.x.x",
"@hapi/bourne": "2.x.x",
"@hapi/cryptiles": "5.x.x",
"@hapi/hoek": "9.x.x",
"@hapi/iron": "6.x.x",
"@hapi/validate": "1.x.x"
"@hapi/boom": "^10.0.0",
"@hapi/bounce": "^3.0.0",
"@hapi/bourne": "^3.0.0",
"@hapi/cryptiles": "^6.0.0",
"@hapi/hoek": "^10.0.0",
"@hapi/iron": "^7.0.0",
"@hapi/validate": "^2.0.0"
},
"devDependencies": {
"@hapi/code": "8.x.x",
"@hapi/code": "^9.0.0",
"@hapi/eslint-plugin": "*",
"@hapi/lab": "24.x.x"
"@hapi/lab": "^25.0.1"
},

@@ -36,0 +36,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc