Skip to content

Commit

Permalink
fix(types): remove unnecessary readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jul 5, 2022
1 parent 6bbdbae commit 4bb989d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/router/src/matcher/pathParserRanker.ts
@@ -1,7 +1,7 @@
import { Token, TokenType } from './pathTokenizer'
import { assign, isArray } from '../utils'

export type PathParams = Record<string, string | readonly string[]>
export type PathParams = Record<string, string | string[]>

/**
* A param in a url like `/users/:id`
Expand Down
4 changes: 2 additions & 2 deletions packages/router/src/query.ts
Expand Up @@ -28,7 +28,7 @@ export type LocationQueryValueRaw = LocationQueryValue | number | undefined
*/
export type LocationQuery = Record<
string,
LocationQueryValue | readonly LocationQueryValue[]
LocationQueryValue | LocationQueryValue[]
>
/**
* Loose {@link LocationQuery} object that can be passed to functions like
Expand All @@ -39,7 +39,7 @@ export type LocationQuery = Record<
*/
export type LocationQueryRaw = Record<
string | number,
LocationQueryValueRaw | readonly LocationQueryValueRaw[]
LocationQueryValueRaw | LocationQueryValueRaw[]
>

/**
Expand Down
11 changes: 4 additions & 7 deletions packages/router/src/types/index.ts
Expand Up @@ -32,13 +32,10 @@ export type RouteParamValue = string
* @internal
*/
export type RouteParamValueRaw = RouteParamValue | number | null | undefined
export type RouteParams = Record<
string,
RouteParamValue | readonly RouteParamValue[]
>
export type RouteParams = Record<string, RouteParamValue | RouteParamValue[]>
export type RouteParamsRaw = Record<
string,
RouteParamValueRaw | readonly Exclude<RouteParamValueRaw, null | undefined>[]
RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]
>

/**
Expand Down Expand Up @@ -320,7 +317,7 @@ export interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
/**
* Array of nested routes.
*/
children: Readonly<RouteRecordRaw[]>
children: RouteRecordRaw[]

/**
* Allow passing down params as props to the component rendered by `router-view`.
Expand Down Expand Up @@ -356,7 +353,7 @@ export interface RouteRecordMultipleViewsWithChildren extends _RouteRecordBase {
components?: Record<string, RawRouteComponent> | null | undefined
component?: never

children: Readonly<RouteRecordRaw>[]
children: RouteRecordRaw[]

/**
* Allow passing down params as props to the component rendered by
Expand Down

0 comments on commit 4bb989d

Please sign in to comment.