File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -19,17 +19,18 @@ function normalizeName(rawName: unknown): string | undefined {
1919 */
2020function normalizeNamespace ( rawNamespace : unknown ) : string | undefined {
2121 return typeof rawNamespace === 'string'
22- ? normalizePath ( rawNamespace , undefined )
22+ ? normalizePurlPath ( rawNamespace )
2323 : undefined
2424}
2525
2626/**
27- * Normalize path by collapsing separators and filtering segments.
27+ * Normalize purl path component by collapsing separators and filtering segments.
2828 */
29- function normalizePath (
29+ function normalizePurlPath (
3030 pathname : string ,
31- callback ?: ( ( _segment : string ) => boolean ) | undefined ,
31+ options ?: { filter ?: ( ( _segment : string ) => boolean ) | undefined } ,
3232) : string {
33+ const { filter : callback } = options ?? { }
3334 let collapsed = ''
3435 let start = 0
3536 // Leading and trailing slashes, i.e. '/', are not significant and should be
@@ -98,7 +99,7 @@ function normalizeQualifiers(
9899 */
99100function normalizeSubpath ( rawSubpath : unknown ) : string | undefined {
100101 return typeof rawSubpath === 'string'
101- ? normalizePath ( rawSubpath , subpathFilter )
102+ ? normalizePurlPath ( rawSubpath , { filter : subpathFilter } )
102103 : undefined
103104}
104105
@@ -171,7 +172,7 @@ function subpathFilter(segment: string): boolean {
171172export {
172173 normalizeName ,
173174 normalizeNamespace ,
174- normalizePath ,
175+ normalizePurlPath ,
175176 normalizeQualifiers ,
176177 normalizeSubpath ,
177178 normalizeType ,
You can’t perform that action at this time.
0 commit comments