0.1.1 • Published 5 years ago

cool-text-package v0.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

npm.io npm.io npm.io npm.io Coverage Status npm.io

check it out on npm!

Features

  1. String.prototype.upperFirst( ) A function that uppercases the first character of string.
    • Example Input: i want this capitalized.
    • Expected Output: I want this capitalized.
  2. String.prototype.lowerFirst( ) A function that lowercases the first character of string.
    • Example Input: I like lowercase
    • Expected Output: i like lowercase
  3. String.prototype.upperWord( ) A function that uppercases the first letter of each word in a string.
    • Example Input: I like caps.
    • Expected Output: I Like Caps.
  4. String.prototype.upperWiggle( ) A function that uppercases every other letter.
    • Example Input: I feel All wiggly.
    • Expected Output: I FeEl aLl wIgGlY.
  5. String.prototype.removeSpaces( ) A function that removes all whitespace from a given string.
    • Example Input: try to decode this!
    • Expected Output: trytodecodethis!
  6. String.prototype.trimSpaces( ) A function that removes only the extra whitespace from a given string (example: “ a b ” → “a b”).
    • Example Input: far out
    • Expected Output: far out
  7. String.prototype.allCaps( ) A function that makes all characters uppercase. (this is the same as .toUppercase()).
    • Example Input: i like to yell!!
    • Expected Output: I LIKE TO YELL!!
  8. String.prototype.kababCase( ) A function that removes extra spaces and replaces spaces with the hyphen "-", and makes all characters lowercase.
    • Example Input: What is kabab-case anyway
    • Expected Output: what-is-kabab-case-anyway
  9. String.prototype.snakeCase( ) Removes extra space and replaces spaces with an underscore "_", and makes all characters lowercase.
    • Example Input: Snakes are Amazing
    • Expected Output: snakes_are_amazing
  10. String.prototype.camelCase( ) Lowercases the first character of the first word. Then uppercases the first character of all other words, and removes all spaces.
    • Example Input: CAMELS are a special sort of animal.
    • Expected Output: camelsAreASpecialSortOfAnimal

See Homework 1

Usage

Just connect any of those functions to a string and see magic! Note, none of these functions take in a parameter. They are methods.

Example:

let superString =
	'wow! this project is    soooooooooooo   cool. Just amazing.    '
console.log(superString.snakeCase())