mirror of
https://github.com/cdr/code-server.git
synced 2025-12-06 08:27:17 +01:00
Remove import from express-serve-static-core
Mostly because express-serve-static-core is an implicit dependency. We could make it explicit, but the type we imported from it is just an alias for qs.ParsedQs anyway.
This commit is contained in:
parent
e54467fb85
commit
3f23840756
2 changed files with 4 additions and 10 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import { field, logger } from "@coder/logger"
|
||||
import * as express from "express"
|
||||
import * as expressCore from "express-serve-static-core"
|
||||
import * as http from "http"
|
||||
import * as net from "net"
|
||||
import * as qs from "qs"
|
||||
import qs from "qs"
|
||||
import { Disposable } from "../common/emitter"
|
||||
import { CookieKeys, HttpCode, HttpError } from "../common/http"
|
||||
import { normalize } from "../common/util"
|
||||
|
|
@ -185,12 +184,7 @@ export const constructRedirectPath = (req: express.Request, query: qs.ParsedQs,
|
|||
* preserved. `to` should be a simple path without any query parameters
|
||||
* `override` will merge with the existing query (use `undefined` to unset).
|
||||
*/
|
||||
export const redirect = (
|
||||
req: express.Request,
|
||||
res: express.Response,
|
||||
to: string,
|
||||
override: expressCore.Query = {},
|
||||
): void => {
|
||||
export const redirect = (req: express.Request, res: express.Response, to: string, override: qs.ParsedQs = {}): void => {
|
||||
const query = Object.assign({}, req.query, override)
|
||||
Object.keys(override).forEach((key) => {
|
||||
if (typeof override[key] === "undefined") {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { logger } from "@coder/logger"
|
||||
import { Query } from "express-serve-static-core"
|
||||
import type { ParsedQs } from "qs"
|
||||
import { promises as fs } from "fs"
|
||||
|
||||
export type Settings = { [key: string]: Settings | string | boolean | number }
|
||||
|
|
@ -52,5 +52,5 @@ export interface UpdateSettings {
|
|||
* Global code-server settings.
|
||||
*/
|
||||
export interface CoderSettings extends UpdateSettings {
|
||||
query?: Query
|
||||
query?: ParsedQs
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue