Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@japhet-dev/lotide

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@japhet-dev/lotide

A mini clone of the Lodash (https://lodash.com) library.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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 @japhet-dev/lotide

Require it:

const _ = require('@japhet-dev/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(actual, expected): takes in two arrays and prints if they are equal or not.
  • assertEqual(actual, expected): takes in two values and prints if they are strictly equal or not.
  • assertObjectsEqual(actual, expected): takes in two objects and prints if they are equal or not.
  • countLetters(sentence): takes in a sentence (as a string) and then returns a count of each of the letters in that sentence.
  • countOnly(allItems, itemsToCount): takes in a collection of items and returns counts for a specific subset of those items.
  • eqArrays(array1, array2): compares two arrays for a perfect match.
  • eqObjects(object1, object2): takes in two objects and returns true or false, based on a perfect match.
  • findKey(obj, callback): scans the object and return the first key for which the callback returns a truthy value.
  • findKeyByValue(object, value): scans the object and returns the first key which contains the given value.
  • head(arr): retrieves the first element from the array.
  • letterPositions(sentence): returns all the indices (zero-based positions) in the string where each character is found.
  • map(array, callback): returns a new array based on the results of the callback function.
  • middle(arr): takes in an array and return the middle-most element(s) of the given array.
  • tail(arr): retrieves every element except the head (first element) of the array.
  • takeUntil(array, callback): keeps collecting items from a provided array until the callback provided returns a truthy value.
  • without(source, itemsToRemove): returns a new array with only those elements from source that are not present in the itemsToRemove array.

FAQs

Package last updated on 21 Sep 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc