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

@hapi/shot

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/shot - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

42

lib/index.js
'use strict';
const Hoek = require('@hapi/hoek');
const Joi = require('@hapi/joi');
const Validate = require('@hapi/validate');

@@ -14,26 +14,26 @@ const Request = require('./request');

internals.options = Joi.object().keys({
url: Joi.alternatives([
Joi.string(),
Joi.object().keys({
protocol: Joi.string(),
hostname: Joi.string(),
port: Joi.any(),
pathname: Joi.string().required(),
query: Joi.any()
internals.options = Validate.object().keys({
url: Validate.alternatives([
Validate.string(),
Validate.object().keys({
protocol: Validate.string(),
hostname: Validate.string(),
port: Validate.any(),
pathname: Validate.string().required(),
query: Validate.any()
})
])
.required(),
headers: Joi.object(),
payload: Joi.any(),
headers: Validate.object(),
payload: Validate.any(),
simulate: {
end: Joi.boolean(),
split: Joi.boolean(),
error: Joi.boolean(),
close: Joi.boolean()
end: Validate.boolean(),
split: Validate.boolean(),
error: Validate.boolean(),
close: Validate.boolean()
},
authority: Joi.string(),
remoteAddress: Joi.string(),
method: Joi.string(),
validate: Joi.boolean()
authority: Validate.string(),
remoteAddress: Validate.string(),
method: Validate.string(),
validate: Validate.boolean()
});

@@ -49,3 +49,3 @@

Hoek.assert(typeof dispatchFunc === 'function', 'Invalid dispatch function');
Joi.assert(options, internals.options);
Validate.assert(options, internals.options);
}

@@ -52,0 +52,0 @@ catch (err) {

'use strict';
const Joi = require('@hapi/joi');
const Validate = require('@hapi/joi');

@@ -9,31 +9,31 @@

internals.url = Joi.alternatives(Joi.string().required(), Joi.object().keys({
protocol: Joi.string(),
hostname: Joi.string(),
port: Joi.any(),
pathname: Joi.string().required(),
query: Joi.any()
internals.url = Validate.alternatives(Validate.string().required(), Validate.object().keys({
protocol: Validate.string(),
hostname: Validate.string(),
port: Validate.any(),
pathname: Validate.string().required(),
query: Validate.any()
}).required());
internals.options = Joi.object().keys({
internals.options = Validate.object().keys({
url: internals.url.required(),
headers: Joi.object(),
payload: Joi.any(),
simulate: Joi.object().keys({
end: Joi.boolean(),
split: Joi.boolean(),
error: Joi.boolean(),
close: Joi.boolean()
headers: Validate.object(),
payload: Validate.any(),
simulate: Validate.object().keys({
end: Validate.boolean(),
split: Validate.boolean(),
error: Validate.boolean(),
close: Validate.boolean()
}),
authority: Joi.string(),
remoteAddress: Joi.string(),
method: Joi.string().regex(/^[a-zA-Z0-9!#\$%&'\*\+\-\.^_`\|~]+$/)
authority: Validate.string(),
remoteAddress: Validate.string(),
method: Validate.string().regex(/^[a-zA-Z0-9!#\$%&'\*\+\-\.^_`\|~]+$/)
}).min(1);
module.exports = Joi.object().keys({
dispatchFunc: Joi.func().required(),
options: Joi.alternatives(internals.options, internals.url).required(),
callback: Joi.func()
module.exports = Validate.object().keys({
dispatchFunc: Validate.func().required(),
options: Validate.alternatives(internals.options, internals.url).required(),
callback: Validate.func()
});
{
"name": "@hapi/shot",
"description": "Injects a fake HTTP request/response into a node HTTP server",
"version": "5.0.0",
"version": "5.0.1",
"repository": "git://github.com/hapijs/shot",

@@ -18,7 +18,7 @@ "main": "lib/index.js",

"@hapi/hoek": "9.x.x",
"@hapi/joi": "17.x.x"
"@hapi/validate": "1.x.x"
},
"devDependencies": {
"@hapi/code": "8.x.x",
"@hapi/lab": "22.x.x"
"@hapi/lab": "23.x.x"
},

@@ -25,0 +25,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