add swapCase method

This commit is contained in:
Pine Mizune
2017-02-21 03:06:36 +09:00
parent e9a122097f
commit 42a183cbc2
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -27,6 +27,7 @@ declare namespace v {
kebabCase(subject?: string): string;
lowerCase(subject?: string): string;
snakeCase(subject?: string): string;
swapCase(subject?: string): string;
titleCase(subject?: string, ignoreWords?: string[]): string;
upperCase(subject?: string): string;
@@ -126,6 +127,7 @@ declare namespace v {
kebabCase(): Chain;
lowerCase(): Chain;
snakeCase(): Chain;
swapCase(): Chain;
titleCase(ignoreWordsopt?: string[]): Chain;
upperCase(): Chain;
@@ -221,6 +223,7 @@ declare namespace v {
kebabCase(): ExplicitChain<string>;
lowerCase(): ExplicitChain<string>;
snakeCase(): ExplicitChain<string>;
swapCase(): ExplicitChain<string>;
titleCase(ignoreWordsopt?: string[]): ExplicitChain<string>;
upperCase(): ExplicitChain<string>;
+5
View File
@@ -23,6 +23,11 @@ str = v.decapitalize('Sun');
str = v.kebabCase('goodbye blue sky');
str = v.lowerCase('Green');
str = v.snakeCase('learning to fly');
str = v.swapCase('learning to fly');
str = v('learning to fly').swapCase().value();
str = v.chain('learning to fly').swapCase().value();
str = v.titleCase('learning to fly');
str = v.titleCase('another brick in the wall', ['in', 'the']);
str = v.upperCase('school');