-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add "toUpper" function to convert strings into UPPER CASE
- Loading branch information
Showing
5 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
import test from "tape" | ||
import { toLower } from ".." | ||
import { toLower } from "./to-lower" | ||
|
||
test("toLower", t => { | ||
const source = "Lorem Opsum" | ||
|
||
t.equals( | ||
toLower(source), | ||
"lorem opsum", | ||
"Convert uppercase chars into lowercase" | ||
) | ||
t.equals(toLower(source), "lorem opsum", "Convert chars into lowercase") | ||
|
||
t.end() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Convert string to upper case | ||
* | ||
* @tag String | ||
* @signature (source: string): string | ||
* | ||
* @param {string} source Source string | ||
* | ||
* @return {string} | ||
* | ||
* @example | ||
* toUpper("Lorem Ipsum") | ||
* // "LOREM IPSUM" | ||
*/ | ||
export const toUpper = source => "".toUpperCase.call(source) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import test from "tape" | ||
import { toUpper } from "./to-upper" | ||
|
||
test("toUpper", t => { | ||
const source = "Lorem Opsum" | ||
|
||
t.equals(toUpper(source), "LOREM OPSUM", "Convert chars into uppercase") | ||
|
||
t.end() | ||
}) |