-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathString.types.ps1xml
105 lines (100 loc) · 4.38 KB
/
String.types.ps1xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="utf-8" ?>
<Types>
<Type>
<Name>System.String</Name>
<Members>
<ScriptMethod>
<Name>Humanize</Name>
<Script>
[OutputType([System.String])]
param([Humanizer.LetterCasing]$LetterCasing = [Humanizer.LetterCasing]::Title)
[Humanizer.StringHumanizeExtensions]::Humanize($this, $LetterCasing)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>Transform</Name>
<Script>
[OutputType([System.String])]
param(
[Parameter(Mandatory)]
[ValidateSet("SentenceCase", "TitleCase", "LowerCase", "UpperCase")]
[string]$Case
)
$ToCase = [Humanizer.To]::$Case
[Humanizer.To]::Transform($this, $ToCase)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>ToSentenceCase</Name>
<Script>
[OutputType([System.String])]
param()
[Humanizer.To]::Transform($this, [Humanizer.To]::SentenceCase)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>ToTitleCase</Name>
<Script>
[OutputType([System.String])]
param()
[Humanizer.To]::Transform($this, [Humanizer.To]::TitleCase)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>ToQuantity</Name>
<Script>
[OutputType([System.String])]
param([Parameter(Mandatory)][int]$Count, [Humanizer.ShowQuantityAs]$ShowQuantityAs = [Humanizer.ShowQuantityAs]::Numeric)
[Humanizer.ToQuantityExtensions]::ToQuantity($this, $Count, $ShowQuantityAs)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>Dehumanize</Name>
<Script>
[OutputType([System.String])]
param()
[Humanizer.StringDehumanizeExtensions]::Dehumanize($this)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>Underscore</Name>
<Script>
[OutputType([System.String])]
param()
[Humanizer.InflectorExtensions]::Underscore($this)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>FromRoman</Name>
<Script>
[OutputType([System.Int32])]
param()
[Humanizer.RomanNumeralExtensions]::FromRoman($this)
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>Truncate</Name>
<Script>
[OutputType([System.String])]
param(
[Parameter(Mandatory)]
[int]$Length,
[ValidateSet("Characters","Words")]
[string]$Truncator = "Characters",
[string]$TruncationString,
[Humanizer.TruncateFrom]$From = "Right"
)
$truncatorString = "FixedNumberOf$Truncator"
$truncatorObj = [Humanizer.Truncator]::$truncatorString
if ($TruncationString) {
[Humanizer.TruncateExtensions]::Truncate($this, $Length, $TruncationString, $truncatorObj, $From)
}
else
{
[Humanizer.TruncateExtensions]::Truncate($this, $Length, $truncatorObj, $From)
}
</Script>
</ScriptMethod>
</Members>
</Type>
</Types>