Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/llhttp/http.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import assert from 'assert';
import { type LLParse, source } from 'llparse';

import Match = source.node.Match;
import Node = source.node.Node;
const { Node } = source.node;

type Match = source.node.Match;
type Node = source.node.Node;

import {
type CharList,
Expand Down Expand Up @@ -171,8 +173,11 @@ export class HTTP {
private readonly span: ISpanMap;
private readonly callback: ICallbackMap;
private readonly nodes = new Map<string, Match>();
private readonly llparse: LLParse;

constructor(llparse: LLParse) {
this.llparse = llparse;

constructor(private readonly llparse: LLParse) {
const p = llparse;

this.url = new URL(p);
Expand Down
10 changes: 6 additions & 4 deletions src/llhttp/url.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type LLParse, source } from 'llparse';
import { type LLParse, type source } from 'llparse';

import Match = source.node.Match;
import Node = source.node.Node;
type Node = source.node.Node;
type Match = source.node.Match;

import {
ALPHA,
Expand Down Expand Up @@ -30,8 +30,10 @@ export class URL {
private readonly spanTable: SpanTable = new Map();
private readonly errorInvalid: Node;
private readonly URL_CHAR: CharList;
private readonly llparse: LLParse;

constructor(private readonly llparse: LLParse, separateSpans = false) {
constructor(llparse: LLParse, separateSpans = false) {
this.llparse = llparse;
const p = this.llparse;

this.errorInvalid = p.error(ERROR.INVALID_URL, 'Invalid characters in url');
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"declaration": true,
"pretty": true,
"sourceMap": true,
"erasableSyntaxOnly": true
},
"include": ["src/**/*.ts"],
}
4 changes: 4 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true
},
"include": ["bench/**/*.ts", "bin/**/*.ts", "src/**/*.ts", "test/**/*.ts", "eslint.config.mjs"],
}
Loading