File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed
Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ @ {
2+ Parameters = ' Parameter'
3+ Arguments = ' ArgumentList'
4+ Args = ' ArgumentList'
5+ }
Original file line number Diff line number Diff line change 1+ if (-not $this.TypeName.IsGeneric ) { return @ () }
2+ @ (foreach ($typeName in $this.TypeName.GenericArguments ) {
3+ if ($TypeName.IsGeneric ) { continue }
4+ if (-not $TypeName.IsArray ) {
5+ $TypeName.Name
6+ }
7+ })
Original file line number Diff line number Diff line change 1+
2+
3+ function TypeConstraintToArguments (
4+ [Parameter (ValueFromPipeline )]
5+ $TypeName
6+ ) {
7+ begin {
8+ $TypeNameArgs = @ ()
9+ $TypeNameParams = [Ordered ]@ {}
10+
11+ }
12+ process {
13+
14+ if ($TypeName.IsGeneric ) {
15+ $TypeNameParams [$typeName.TypeName.Name ] =
16+ $typeName.GenericArguments |
17+ TypeConstraintToArguments
18+ } elseif (-not $TypeName.IsArray ) {
19+ $TypeNameArgs += $TypeName.Name
20+ }
21+ }
22+ end {
23+ if ($TypeNameParams.Count ) {
24+ $TypeNameParams
25+ } elseif ($TypeNameArgs ) {
26+ $TypeNameArgs
27+ }
28+ }
29+ }
30+
31+ if (-not $this.TypeName.IsGeneric ) { return @ {} }
32+ foreach ($arg in @ ($this.TypeName.GenericArguments | TypeConstraintToArguments)) {
33+ if ($arg -is [Collections.IDictionary ]) {
34+ $arg
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments