< Summary - Kestrun — Combined Coverage

Information
Class: Private.Routing._KrWith-MRO
Assembly: Kestrun.PowerShell.Private
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Private/Routing/_KrWith-MRO.ps1
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
0%
Covered lines: 0
Uncovered lines: 15
Coverable lines: 15
Total lines: 40
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

Method
_KrWith-MRO()

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Private/Routing/_KrWith-MRO.ps1

#LineLine coverage
 1
 2<#
 3    .SYNOPSIS
 4        Creates a new MapRouteOptions object with the specified base and overrides.
 5    .DESCRIPTION
 6        This function takes an existing MapRouteOptions object and a hashtable of overrides,
 7        and returns a new MapRouteOptions object with the merged properties.
 8        The merged properties will prioritize the values from the Override hashtable.
 9    .PARAMETER Base
 10        The base MapRouteOptions object to use as a template.
 11        This object will be cloned, and the properties will be merged with the Override hashtable.
 12    .PARAMETER Override
 13        A hashtable of properties to override in the base MapRouteOptions object.
 14        Any properties not specified in the Override hashtable will retain their original values from the Base object.
 15    .OUTPUTS
 16        Kestrun.Hosting.Options.MapRouteOptions
 17#>
 18function _KrWith-MRO {
 19    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseApprovedVerbs', '')]
 20    param(
 21        [Parameter(Mandatory)][Kestrun.Hosting.Options.MapRouteOptions]$Base,
 22        [Parameter()][hashtable]$Override = @{}
 23    )
 024    $h = @{
 025        Pattern = $Base.Pattern
 026        HttpVerbs = $Base.HttpVerbs
 027        Code = $Base.Code
 028        Language = $Base.Language
 029        ExtraImports = $Base.ExtraImports
 030        ExtraRefs = $Base.ExtraRefs
 031        RequireSchemes = $Base.RequireSchemes
 032        RequirePolicies = $Base.RequirePolicies
 033        CorsPolicyName = $Base.CorsPolicyName
 034        Arguments = $Base.Arguments
 035        OpenAPI = $Base.OpenAPI
 036        ThrowOnDuplicate = $Base.ThrowOnDuplicate
 37    }
 038    foreach ($k in $Override.Keys) { $h[$k] = $Override[$k] }
 039    return New-KrMapRouteOption -Property $h
 40}

Methods/Properties

_KrWith-MRO()