1.0.0 • Published 2 years ago

@meganmcbride/lotide v1.0.0

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

Lotide

A mini clone of the Lodash library.

Purpose

BEWARE: This library was published for learning purposes. It is not intended for use in production-grade software.

This project was created and published by me as part of my learnings at Lighthouse Labs.

Usage

Install it:

npm install @meganmcbride/lotide

Require it:

const _ = require('@meganmcbride/lotide');

Call it:

const results = _.tail([1, 2, 3]) // => [2, 3]

Documentation

The following functions are currently implemented:

  • _.countLetters(string): Takes a string and returns an object of the letters occurance
  • _.countOnly(allItems, itemsToCount): Takes in a a collection of items and returns the count for a specific subset of the items
  • _.findKey(...): Takes in an object and a callback returning the first key where the callback returns true
  • _.findKeyByValue(object, value): Takes in an object and a value returning the first key which contains the given value
  • _.head(array): Returns the first item in an array returning the first key where the callback returns true
  • _.letterPositions(string): Returns all the indices in a string where each character is found
  • _.map(array, callback): Takes in an array to map and a callback function
  • _.middle(array): Returns the middle value in an array
  • _.tail(array): Returns an array without the first item
  • _.takeUntil(array, callback): Takes in an array and a callback
  • _.without(source, itemsToRemove): Returns a subset of a given array, removing specified remove items
1.0.0

2 years ago