diff --git a/src/index.js b/src/index.js index b7befa5..91660df 100644 --- a/src/index.js +++ b/src/index.js @@ -91,6 +91,7 @@ export { split } from "./split/split" export { startsWith } from "./starts-with/starts-with" export { endsWith } from "./ends-with/ends-with" export { toLower } from "./to-lower/to-lower" +export { toUpper } from "./to-upper/to-upper" export { trim } from "./trim/trim" export { contains } from "./contains/contains" export { join } from "./join/join" diff --git a/src/to-lower/to-lower.js b/src/to-lower/to-lower.js index 89f35b7..51ab18c 100644 --- a/src/to-lower/to-lower.js +++ b/src/to-lower/to-lower.js @@ -12,6 +12,4 @@ * toLower("Lorem Ipsum") * // "lorem ipsum" */ -const toLower = source => "".toLowerCase.call(source) - -export { toLower } +export const toLower = source => "".toLowerCase.call(source) diff --git a/src/to-lower/to-lower.test.js b/src/to-lower/to-lower.test.js index 1775dbc..9b026fd 100644 --- a/src/to-lower/to-lower.test.js +++ b/src/to-lower/to-lower.test.js @@ -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() }) diff --git a/src/to-upper/to-upper.js b/src/to-upper/to-upper.js new file mode 100644 index 0000000..bd22615 --- /dev/null +++ b/src/to-upper/to-upper.js @@ -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) diff --git a/src/to-upper/to-upper.test.js b/src/to-upper/to-upper.test.js new file mode 100644 index 0000000..7c0eb0d --- /dev/null +++ b/src/to-upper/to-upper.test.js @@ -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() +})