New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cfworker/web

Package Overview
Dependencies
Maintainers
0
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cfworker/web - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

4

dist/cjs/cookies.d.ts

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

import { CookieSerializeOptions } from 'cookie';
import { SerializeOptions } from 'cookie';
export declare class Cookies {

@@ -7,3 +7,3 @@ private readonly responseHeaders;

get(name: string): string | null;
set(name: string, val: string, options?: CookieSerializeOptions): void;
set(name: string, val: string, options?: SerializeOptions): void;
}

@@ -26,9 +26,9 @@ "use strict";

const Path = (pattern, options) => {
const regExp = (0, path_to_regexp_1.pathToRegexp)(pattern, options);
const { regexp, keys } = (0, path_to_regexp_1.pathToRegexp)(pattern, options);
return ({ req: { url, params } }) => {
const match = url.pathname.match(regExp);
const match = url.pathname.match(regexp);
if (!match) {
return false;
}
collectParameters(regExp.keys, match, params);
collectParameters(keys, match, params);
return true;

@@ -39,3 +39,3 @@ };

exports.defaultRouterOptions = {
pathToRegExpOptions: { strict: true }
pathToRegExpOptions: {}
};

@@ -42,0 +42,0 @@ class Router {

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

import { CookieSerializeOptions } from 'cookie';
import { SerializeOptions } from 'cookie';
export declare class Cookies {

@@ -7,3 +7,3 @@ private readonly responseHeaders;

get(name: string): string | null;
set(name: string, val: string, options?: CookieSerializeOptions): void;
set(name: string, val: string, options?: SerializeOptions): void;
}

@@ -20,9 +20,9 @@ import { pathToRegexp } from 'path-to-regexp';

export const Path = (pattern, options) => {
const regExp = pathToRegexp(pattern, options);
const { regexp, keys } = pathToRegexp(pattern, options);
return ({ req: { url, params } }) => {
const match = url.pathname.match(regExp);
const match = url.pathname.match(regexp);
if (!match) {
return false;
}
collectParameters(regExp.keys, match, params);
collectParameters(keys, match, params);
return true;

@@ -32,3 +32,3 @@ };

export const defaultRouterOptions = {
pathToRegExpOptions: { strict: true }
pathToRegExpOptions: {}
};

@@ -35,0 +35,0 @@ export class Router {

{
"name": "@cfworker/web",
"type": "module",
"version": "3.0.0",
"version": "4.0.0",
"description": "Web framework for Cloudflare Workers and service workers, inspired by Koa and fastify",

@@ -42,10 +42,10 @@ "keywords": [

"dependencies": {
"@cfworker/json-schema": "^3.0.0",
"@types/cookie": "^0.6.0",
"@cfworker/json-schema": "^3.0.1",
"@types/cookie": "^1.0.0",
"@types/html-escaper": "^3.0.2",
"@types/statuses": "^2.0.5",
"cookie": "^0.6.0",
"cookie": "^1.0.1",
"html-escaper": "^3.0.3",
"negotiator": "^0.6.3",
"path-to-regexp": "^7.1.0",
"negotiator": "^1.0.0",
"path-to-regexp": "^8.2.0",
"secure-json-parse": "^2.7.0",

@@ -55,11 +55,11 @@ "statuses": "^2.0.1"

"devDependencies": {
"@types/chai": "^4.3.17",
"@types/mocha": "^10.0.7",
"chai": "^5.1.1",
"esbuild": "^0.23.1",
"@types/chai": "^5.0.1",
"@types/mocha": "^10.0.9",
"chai": "^5.1.2",
"esbuild": "^0.24.0",
"jsonpointer": "^5.0.1",
"mocha": "^10.7.3",
"typescript": "^5.5.4",
"wrangler": "^3.72.1"
"mocha": "^10.8.2",
"typescript": "^5.6.3",
"wrangler": "^3.87.0"
}
}
import {
CookieSerializeOptions,
parse as parseCookie,
serialize as serializeCookie
serialize as serializeCookie,
SerializeOptions
} from 'cookie';

@@ -24,7 +24,3 @@

public set(
name: string,
val: string,
options?: CookieSerializeOptions
): void {
public set(name: string, val: string, options?: SerializeOptions): void {
this.responseHeaders.append(

@@ -31,0 +27,0 @@ 'Set-Cookie',

@@ -33,10 +33,10 @@ import { Key, pathToRegexp, PathToRegexpOptions } from 'path-to-regexp';

) => Predicate = (pattern: string, options?: PathToRegexpOptions) => {
const regExp = pathToRegexp(pattern, options);
const { regexp, keys } = pathToRegexp(pattern, options);
return ({ req: { url, params } }: Context) => {
const match = url.pathname.match(regExp);
const match = url.pathname.match(regexp);
if (!match) {
return false;
}
collectParameters(regExp.keys, match, params);
collectParameters(keys, match, params);
return true;

@@ -58,3 +58,3 @@ };

export const defaultRouterOptions: RouterOptions = {
pathToRegExpOptions: { strict: true }
pathToRegExpOptions: {}
};

@@ -61,0 +61,0 @@

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