@@ -11,18 +11,13 @@ import type {
1111 MatcherPatternQuery ,
1212} from './new-matcher-pattern'
1313import { warn } from '../warning'
14- import {
15- SLASH_RE ,
16- encodePath ,
17- encodeQueryValue as _encodeQueryValue ,
18- } from '../encoding'
14+ import { encodeQueryValue as _encodeQueryValue } from '../encoding'
1915import { parseURL , stringifyURL } from '../location'
2016import type {
2117 MatcherLocationAsNamed ,
2218 MatcherLocationAsRelative ,
2319 MatcherParamsFormatted ,
2420} from './matcher-location'
25- import { RouteRecordRaw } from 'test-dts'
2621
2722/**
2823 * Allowed types for a matcher name.
@@ -165,20 +160,20 @@ interface FnStableNull {
165160 ( value : string | number | null | undefined ) : string | null
166161}
167162
168- function encodeParam ( text : null | undefined , encodeSlash ?: boolean ) : null
169- function encodeParam ( text : string | number , encodeSlash ?: boolean ) : string
170- function encodeParam (
171- text : string | number | null | undefined ,
172- encodeSlash ?: boolean
173- ) : string | null
174- function encodeParam (
175- text : string | number | null | undefined ,
176- encodeSlash = true
177- ) : string | null {
178- if ( text == null ) return null
179- text = encodePath ( text )
180- return encodeSlash ? text . replace ( SLASH_RE , '%2F' ) : text
181- }
163+ // function encodeParam(text: null | undefined, encodeSlash?: boolean): null
164+ // function encodeParam(text: string | number, encodeSlash?: boolean): string
165+ // function encodeParam(
166+ // text: string | number | null | undefined,
167+ // encodeSlash?: boolean
168+ // ): string | null
169+ // function encodeParam(
170+ // text: string | number | null | undefined,
171+ // encodeSlash = true
172+ // ): string | null {
173+ // if (text == null) return null
174+ // text = encodePath(text)
175+ // return encodeSlash ? text.replace(SLASH_RE, '%2F') : text
176+ // }
182177
183178// @ts -expect-error: overload are not correctly identified
184179const encodeQueryValue : FnStableNull =
@@ -190,23 +185,6 @@ const encodeQueryValue: FnStableNull =
190185// // for ts
191186// value => (value == null ? null : _encodeQueryKey(value))
192187
193- function transformObject < T > (
194- fnKey : ( value : string | number ) => string ,
195- fnValue : FnStableNull ,
196- query : T
197- ) : T {
198- const encoded : any = { }
199-
200- for ( const key in query ) {
201- const value = query [ key ]
202- encoded [ fnKey ( key ) ] = Array . isArray ( value )
203- ? value . map ( fnValue )
204- : fnValue ( value as string | number | null | undefined )
205- }
206-
207- return encoded
208- }
209-
210188export const NO_MATCH_LOCATION = {
211189 name : __DEV__ ? Symbol ( 'no-match' ) : Symbol ( ) ,
212190 params : { } ,
0 commit comments