Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@now/node

Package Overview
Dependencies
Maintainers
16
Versions
300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@now/node - npm Package Compare versions

Comparing version
1.7.5-canary.1
to
1.7.5-canary.2
+12
-0
dist/helpers.js

@@ -712,2 +712,13 @@ module.exports =

}
function redirect(res, statusOrUrl, url) {
if (typeof statusOrUrl === 'string') {
url = statusOrUrl;
statusOrUrl = 307;
}
if (typeof statusOrUrl !== 'number' || typeof url !== 'string') {
throw new Error(`Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').`);
}
res.writeHead(statusOrUrl, { Location: url }).end();
return res;
}
function setCharset(type, charset) {

@@ -872,2 +883,3 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires

res.status = statusCode => status(res, statusCode);
res.redirect = (statusOrUrl, url) => redirect(res, statusOrUrl, url);
res.send = body => send(req, res, body);

@@ -874,0 +886,0 @@ res.json = jsonBody => json(req, res, jsonBody);

+1
-0

@@ -19,3 +19,4 @@ /// <reference types="node" />

status: (statusCode: number) => NowResponse;
redirect: (statusOrUrl: string | number, url?: string) => NowResponse;
};
export declare type NowApiHandler = (req: NowRequest, res: NowResponse) => void;
+1
-1
{
"name": "@now/node",
"version": "1.7.5-canary.1",
"version": "1.7.5-canary.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "./dist/index",