Skip to content

Commit 6110203

Browse files
committed
v0.3.0
2 parents 60c8cf8 + 921be6c commit 6110203

File tree

3 files changed

+440
-34
lines changed

3 files changed

+440
-34
lines changed

caps.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (ti TokenizerImpl) Tokenize(str string, allowedSymbols []rune, numberRules
302302
} else {
303303
current = token.AppendRune(ti.caser, current, r)
304304
}
305-
} else if ti.delimiters.Contains(r) {
305+
} else if ti.delimiters.Contains(r) || unicode.IsSpace(r) {
306306
if current.Len() > 0 {
307307
if foundLower {
308308
tokens = append(tokens, current)
@@ -746,20 +746,20 @@ func ToScreamingKebab[T ~string](str T, options ...Opts) T {
746746
return ToDelimited(str, '-', false, options...)
747747
}
748748

749-
// ToDot transforms the case of str into Lower Dot Notation Case (e.g. an.example.string) using
749+
// ToDotNotation transforms the case of str into Lower Dot Notation Case (e.g. an.example.string) using
750750
// either the provided Converter or the DefaultConverter otherwise.
751751
//
752-
// caps.ToDot("This is [an] {example}${id32}.") // this.is.an.example.id.32
753-
func ToDot[T ~string](str T, options ...Opts) T {
752+
// caps.ToDotNotation("This is [an] {example}${id32}.") // this.is.an.example.id.32
753+
func ToDotNotation[T ~string](str T, options ...Opts) T {
754754
return ToDelimited(str, '.', true, options...)
755755
}
756756

757-
// ToScreamingKebab transforms the case of str into Screaming Kebab Case (e.g.
758-
// AN-EXAMPLE-STRING) using either the provided Converter or the
757+
// ToScreamingDotNotation transforms the case of str into Screaming Kebab Case (e.g.
758+
// AN.EXAMPLE.STRING) using either the provided Converter or the
759759
// DefaultConverter otherwise.
760760
//
761-
// caps.ToScreamingDot("This is [an] {example}${id32}.") // THIS.IS.AN.EXAMPLE.ID.32
762-
func ToScreamingDot[T ~string](str T, options ...Opts) T {
761+
// caps.ToScreamingDotNotation("This is [an] {example}${id32}.") // THIS.IS.AN.EXAMPLE.ID.32
762+
func ToScreamingDotNotation[T ~string](str T, options ...Opts) T {
763763
return ToDelimited(str, '.', false, options...)
764764
}
765765

examples_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ func ExampleToScreamingKebab() {
4747
}
4848

4949
func ExampleToDotNotation() {
50-
fmt.Println(caps.ToScreamingDot("This is [an] {example}${id32}."))
50+
fmt.Println(caps.ToDotNotation("This is [an] {example}${id32}."))
5151
// Output:
5252
// this.is.an.example.id.32
5353
}
5454

5555
func ExampleToScreamingDotNotation() {
56-
fmt.Println(caps.ToScreamingDot("This is [an] {example}${id32}."))
56+
fmt.Println(caps.ToScreamingDotNotation("This is [an] {example}${id32}."))
5757
// Output:
5858
// THIS.IS.AN.EXAMPLE.ID.32
5959
}

0 commit comments

Comments
 (0)