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

@octokit/webhooks

Package Overview
Dependencies
Maintainers
4
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/webhooks - npm Package Compare versions

Comparing version 10.5.1 to 10.6.0

11

dist-node/index.js

@@ -205,3 +205,8 @@ 'use strict';

// See https://github.com/octokit/webhooks.js/pull/23
if (request.body) return Promise.resolve(request.body);
if (request.body) {
if (typeof request.body !== "string") {
console.error("[@octokit/webhooks] Passing the payload as a JSON object in `request.body` is deprecated and will be removed in a future release of `@octokit/webhooks`, please pass it as a a `string` instead.");
}
return Promise.resolve(request.body);
}
return new Promise((resolve, reject) => {

@@ -215,3 +220,5 @@ let data = "";

try {
resolve(JSON.parse(data));
// Call JSON.parse() only to check if the payload is valid JSON
JSON.parse(data);
resolve(data);
} catch (error) {

@@ -218,0 +225,0 @@ error.message = "Invalid JSON";

10

dist-src/middleware/node/get-payload.js

@@ -6,4 +6,8 @@ // @ts-ignore to address #245

// See https://github.com/octokit/webhooks.js/pull/23
if (request.body)
if (request.body) {
if (typeof request.body !== "string") {
console.error("[@octokit/webhooks] Passing the payload as a JSON object in `request.body` is deprecated and will be removed in a future release of `@octokit/webhooks`, please pass it as a a `string` instead.");
}
return Promise.resolve(request.body);
}
return new Promise((resolve, reject) => {

@@ -17,3 +21,5 @@ let data = "";

try {
resolve(JSON.parse(data));
// Call JSON.parse() only to check if the payload is valid JSON
JSON.parse(data);
resolve(data);
}

@@ -20,0 +26,0 @@ catch (error) {

import { WebhookEvent } from "@octokit/webhooks-types";
type IncomingMessage = any;
export declare function getPayload(request: IncomingMessage): Promise<WebhookEvent>;
export declare function getPayload(request: IncomingMessage): Promise<WebhookEvent | string>;
export {};

@@ -460,4 +460,8 @@ import AggregateError from 'aggregate-error';

// See https://github.com/octokit/webhooks.js/pull/23
if (request.body)
if (request.body) {
if (typeof request.body !== "string") {
console.error("[@octokit/webhooks] Passing the payload as a JSON object in `request.body` is deprecated and will be removed in a future release of `@octokit/webhooks`, please pass it as a a `string` instead.");
}
return Promise.resolve(request.body);
}
return new Promise((resolve, reject) => {

@@ -471,3 +475,5 @@ let data = "";

try {
resolve(JSON.parse(data));
// Call JSON.parse() only to check if the payload is valid JSON
JSON.parse(data);
resolve(data);
}

@@ -474,0 +480,0 @@ catch (error) {

{
"name": "@octokit/webhooks",
"description": "GitHub webhook events toolset for Node.js",
"version": "10.5.1",
"version": "10.6.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "files": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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