routup 3.3.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import type { ParseOptions, TokensToRegexpOptions } from 'path-to-regexp';
2
- export type PathMatcherOptions = TokensToRegexpOptions & ParseOptions;
1
+ import type { ParseOptions, PathToRegexpOptions } from 'path-to-regexp';
2
+ export type PathMatcherOptions = PathToRegexpOptions & ParseOptions;
3
3
  export type PathMatcherExecResult = {
4
4
  path: string;
5
5
  params: Record<string, any>;
6
6
  };
7
- export type Path = string | RegExp;
7
+ export type Path = string;
@@ -1,6 +1,6 @@
1
1
  import type { Request } from '../types';
2
- export declare function setRequestEnv(req: Request, key: string, value: unknown): void;
3
- export declare function setRequestEnv(req: Request, record: Record<string, any>, append?: boolean): void;
2
+ export declare function setRequestEnv(req: Request, key: string | symbol, value: unknown): void;
3
+ export declare function setRequestEnv(req: Request, record: Record<string | symbol, any>, append?: boolean): void;
4
4
  export declare function useRequestEnv(req: Request): Record<string, any>;
5
- export declare function useRequestEnv(req: Request, key: string): unknown | undefined;
6
- export declare function unsetRequestEnv(req: Request, key: string): void;
5
+ export declare function useRequestEnv(req: Request, key: PropertyKey): unknown | undefined;
6
+ export declare function unsetRequestEnv(req: Request, key: PropertyKey): void;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { IncomingMessage } from 'node:http';
3
2
  export declare function getRequestAcceptableEncodings(req: IncomingMessage): string[];
4
3
  export declare function getRequestAcceptableEncoding(req: IncomingMessage, input: string | string[]): string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { IncomingHttpHeaders } from 'node:http';
3
2
  import type { Request } from '../types';
4
3
  export declare function getRequestHeader<K extends keyof IncomingHttpHeaders>(req: Request, name: K): IncomingHttpHeaders[K];
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { IncomingMessage } from 'node:http';
3
2
  import type { RequestCreateContext } from './types';
4
3
  export declare function createRequest(context: RequestCreateContext): IncomingMessage;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { IncomingMessage } from 'node:http';
3
2
  import type { NodeReadableStream, WebReadableStream } from '../types';
4
3
  export type RequestBody = null | Iterable<any> | AsyncIterable<any> | NodeReadableStream | WebReadableStream;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { OutgoingHttpHeader } from 'node:http';
3
2
  import type { Response } from '../types';
4
3
  export declare function appendResponseHeader(res: Response, name: string, value: OutgoingHttpHeader): void;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ServerResponse } from 'node:http';
3
2
  export interface Response extends ServerResponse {
4
3
  }
package/dist/types.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import type { Readable as NodeReadable } from 'node:stream';
4
2
  import type { Readable } from 'readable-stream';
5
3
  import type { ReadableStream } from 'stream/web';
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { Buffer } from 'buffer';
4
2
  import { type Stats } from 'node:fs';
5
3
  import type { EtagOptions } from './type';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export type EtagOptions = {
3
2
  /**
4
3
  * Create a weak ETag?
@@ -1 +1,3 @@
1
1
  export declare function isObject(item: unknown): item is Record<string, any>;
2
+ export declare function setProperty(record: Record<PropertyKey, any>, property: PropertyKey, value: any): void;
3
+ export declare function getProperty<T = any>(req: Record<PropertyKey, any>, property: PropertyKey): T;
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import type { ReadableStream as WebReadableStream } from 'stream/web';
4
2
  import type { Readable as NodeReadable } from 'node:stream';
5
3
  import type { Readable } from 'readable-stream';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "routup",
3
- "version": "3.3.0",
3
+ "version": "4.0.0",
4
4
  "description": "Routup is a minimalistic http based routing framework.",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -54,33 +54,33 @@
54
54
  "buffer": "^6.0.3",
55
55
  "mime-explorer": "^1.1.0",
56
56
  "negotiator": "^0.6.3",
57
- "path-to-regexp": "^6.2.1",
57
+ "path-to-regexp": "^7.0.0",
58
58
  "proxy-addr": "^2.0.7",
59
59
  "readable-stream": "^4.5.2",
60
60
  "smob": "^1.5.0",
61
61
  "uncrypto": "^0.1.3"
62
62
  },
63
63
  "devDependencies": {
64
- "@rollup/plugin-commonjs": "^25.0.7",
64
+ "@rollup/plugin-commonjs": "^26.0.1",
65
65
  "@rollup/plugin-node-resolve": "^15.2.3",
66
- "@swc/core": "^1.4.11",
66
+ "@swc/core": "^1.6.5",
67
67
  "@swc/jest": "^0.2.36",
68
- "@tada5hi/commitlint-config": "^1.2.0",
69
- "@tada5hi/eslint-config-typescript": "^1.2.10",
68
+ "@tada5hi/commitlint-config": "^1.2.1",
69
+ "@tada5hi/eslint-config-typescript": "^1.2.11",
70
70
  "@tada5hi/semantic-release": "^0.3.1",
71
71
  "@tada5hi/tsconfig": "^0.5.1",
72
72
  "@types/jest": "^29.5.12",
73
73
  "@types/negotiator": "^0.6.3",
74
74
  "@types/node": "^20.12.2",
75
75
  "@types/proxy-addr": "^2.0.3",
76
- "@types/readable-stream": "^4.0.11",
76
+ "@types/readable-stream": "^4.0.14",
77
77
  "@types/supertest": "^6.0.2",
78
78
  "cross-env": "^7.0.3",
79
79
  "jest": "^29.7.0",
80
- "rimraf": "^5.0.5",
81
- "rollup": "^4.13.2",
80
+ "rimraf": "^5.0.7",
81
+ "rollup": "^4.18.0",
82
82
  "semantic-release": "^22.0.12",
83
- "supertest": "^6.3.4",
84
- "typescript": "5.4.3"
83
+ "supertest": "^7.0.0",
84
+ "typescript": "5.5.2"
85
85
  }
86
86
  }