Socket
Socket
Sign inDemoInstall

cool-text-package

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cool-text-package

these are amazing utilities that everyone should use.


Version published
Weekly downloads
10
increased by100%
Maintainers
1
Install size
54.5 kB
Created
Weekly downloads
 

Readme

Source

Coverage Status

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())

Keywords

FAQs

Last updated on 16 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc