From 4bb989d36798243df1eb186c4ec01d9fd97d1f26 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 5 Jul 2022 09:35:20 +0200 Subject: [PATCH] fix(types): remove unnecessary readonly --- packages/router/src/matcher/pathParserRanker.ts | 2 +- packages/router/src/query.ts | 4 ++-- packages/router/src/types/index.ts | 11 ++++------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/router/src/matcher/pathParserRanker.ts b/packages/router/src/matcher/pathParserRanker.ts index 605d2326..0a98fd00 100644 --- a/packages/router/src/matcher/pathParserRanker.ts +++ b/packages/router/src/matcher/pathParserRanker.ts @@ -1,7 +1,7 @@ import { Token, TokenType } from './pathTokenizer' import { assign, isArray } from '../utils' -export type PathParams = Record +export type PathParams = Record /** * A param in a url like `/users/:id` diff --git a/packages/router/src/query.ts b/packages/router/src/query.ts index d315a84b..94d91461 100644 --- a/packages/router/src/query.ts +++ b/packages/router/src/query.ts @@ -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 @@ -39,7 +39,7 @@ export type LocationQuery = Record< */ export type LocationQueryRaw = Record< string | number, - LocationQueryValueRaw | readonly LocationQueryValueRaw[] + LocationQueryValueRaw | LocationQueryValueRaw[] > /** diff --git a/packages/router/src/types/index.ts b/packages/router/src/types/index.ts index b693aa84..b13e936d 100644 --- a/packages/router/src/types/index.ts +++ b/packages/router/src/types/index.ts @@ -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 export type RouteParamsRaw = Record< string, - RouteParamValueRaw | readonly Exclude[] + RouteParamValueRaw | Exclude[] > /** @@ -320,7 +317,7 @@ export interface RouteRecordSingleViewWithChildren extends _RouteRecordBase { /** * Array of nested routes. */ - children: Readonly + children: RouteRecordRaw[] /** * Allow passing down params as props to the component rendered by `router-view`. @@ -356,7 +353,7 @@ export interface RouteRecordMultipleViewsWithChildren extends _RouteRecordBase { components?: Record | null | undefined component?: never - children: Readonly[] + children: RouteRecordRaw[] /** * Allow passing down params as props to the component rendered by -- 2.47.3