Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@theabo/lotide

Theag99986ISC1.0.0

a clone of the lodash library for educational purposes

readme

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 @theabo/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(...): asserts if two arrays are equal
  • assertEqual(...): asserts if two primitive data types are equal
  • assertObjectsEqual(...): asserts if two objects are equal
  • countLetters(...): counts the number of letters in a string
  • countOnly(...): counts the number of occurences of an item in an array
  • eqArrays(...): tests if two arrays are equal
  • eqObjects(...): tests if two objects are equal
  • findKey(...): evaluates an object and callback function, scans object to find the first key that the callback returns truthy value
  • findKeyByValue(...): evaluates an object and a value, scans object and returns the first key that equals the value
  • head(...): gives the first item in an array
  • index(...): contains all the exported functions
  • letterPositions(...): returns an object that contains all the indices of where each item appears in a string
  • map(...): returns new array with the results of a callback function changing the items in the array
  • middle(...): returns the middle items of an array
  • tail(...): gives the values of an array except the first item
  • takeUntil(...): return an portion of an array that occurs before a callback function has a truthy value
  • without(...): returns an array without unwanted items