< Summary - Kestrun — Combined Coverage

Information
Class: Private.Routing._KrJoin-Route
Assembly: Kestrun.PowerShell.Private
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Private/Routing/_KrJoin-Route.ps1
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 21
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Private/Routing/_KrJoin-Route.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Joins two route paths.
 4    .DESCRIPTION
 5        This function takes a base route and a child route, and joins them into a single route.
 6    .PARAMETER base
 7        The base route to use.
 8    .PARAMETER child
 9        The child route to join with the base route.
 10    .OUTPUTS
 11        String
 12#>
 13function _KrJoin-Route {
 14    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseApprovedVerbs', '')]
 15    param([string]$base, [string]$child)
 016    $b = ($base ?? '').TrimEnd('/')
 017    $c = ($child ?? '').TrimStart('/')
 018    if ([string]::IsNullOrWhiteSpace($b)) { "/$c".TrimEnd('/') -replace '^$', '/' }
 019    elseif ([string]::IsNullOrWhiteSpace($c)) { if ($b) { $b } else { '/' } }
 020    else { "$b/$c" }
 21}

Methods/Properties

_KrJoin-Route()