Package Exports
- js-utility-kingdom
- js-utility-kingdom/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js-utility-kingdom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
What is js-utility-kingdom
A collection of varoius JavaScript functions
Installation
npm i js-utility-kingdom
Utilities
Text-related
getLettersInArray()
- Parameter :Takes a word as parameter
- Return :Returns all the letters of the word separated as array elements
import { getLettersInArray } from 'js-utility-kingdom'
const lettersInArray = getLettersInArray(word)
getWordsInArray()
- Parameter :Takes a text as parameter
- Return :Returns all the words of the text separated as array elements
import { getWordsInArray } from 'js-utility-kingdom'
const wordsInArray = getWordsInArray(text)
capitalizeFirstLetter()
- Parameter :Takes a word as parameter
- Return :Returns the word with the first letter capitalized
import { capitalizeFirstLetter } from 'js-utility-kingdom'
const capitalizedWord = capitalizeFirstLetter(word)
capitalizeFirstLetters()
- Parameter :Takes a text as parameter
- Return :Returns the text with all the first letters capitalized
import { capitalizeFirstLetters } from 'js-utility-kingdom'
const capitalizedText = capitalizeFirstLetters(text)
isOneWord()
- Parameter :Takes a text as parameter
- Return :Returns true if the text contains only one word. Otherwise, returns false.
import { capitalizeFirstLetters } from 'js-utility-kingdom'
const capitalizedText = capitalizeFirstLetters(text)
Products-related
groupProductsWithCategory()
- Parameter :Takes an array of products as parameter
- presumes each product has a category, for example 'men's clothing'
- makes an array of categories
- grups each product with its corresponding category
- provides each category a unique id
- Return :returns the categories array
import { groupProductsWithCategory } from 'js-utility-kingdom'
const categories = groupProductsWithCategory(products);