# @psran/lotide

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

Latest version **1.0.1** (published 2019-09-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @psran/lotide
pnpm add @psran/lotide
yarn add @psran/lotide
bun add @psran/lotide
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-09-24 |
| First published | 2019-09-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Puneet Sran |
| Maintainers | psran |

## Links

- npm: https://www.npmjs.com/package/@psran/lotide
- Repository: https://github.com/user956/lotide
- Homepage: https://github.com/user956/lotide#readme
- Issues: https://github.com/user956/lotide/issues
- npm.io page: https://npm.io/package/@psran/lotide

## Dependencies (1)

- [chai](https://npm.io/package/chai.md) ^4.2.0

## Recent versions

- 1.0.1 (latest) — 2019-09-24
- 1.0.0 — 2019-09-24

## README

# Lotide

A mini clone of the [Lodash](https://lodash.com) 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 @psran/lotide`

**Require it:**

`const _ = require('@psran/lotide');`

**Call it:**

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

## Documentation

The following functions are currently implemented:

* `assertArraysEqual(actualArray, expectedArray)`: compares if two arrays are equal and prints a statement to the console

* `assertEqual(actual, expected)`: compares if two primitive values are equal and prints a statement to the console

* `assertObjectsEqual(actualObject, expectedObject)`: compares if two objects are equal and prints a statement to the console

* `countLetters(str)`: returns an object with each letter within str as a key and the parameter as its count

* `countOnly(allItems, itemsToCount)`: returns counts for a specific subset of items, given all items and items to count as inputs

* `eqArrays(arr1, arr2)`: compares two arrays and determines if both are equal in size and if all elements match

* `eqObjects(object1, object2)`: compares two objects and determins if both are a perfect match

* `findKey(object, callback)`: scans a given object and returns the first key for which the callback returns a truthy value. If no key is found, returns undefined

* `findKeyByValue()`: scans a given object and returns the first key which contains the given value and if no key is is found (based on given value), then it returns undefined

* `flatten(array)`: returns a single-level array, given an array with multiple arrays inside

* `head(arr1)`: returns the first element from an array

* `letterPositions(sentence)`: returns indices in the form of an array, indicating where each character is found, all enclosed within an object

* `map(array, callback)`: returns a new array based on restults of the callback function

* `middle(array)`: returns the middle-most element(s) of a given array (input)

* `tail(arr1)`: returns every other element within an array, except the first (or head)

* `takeUntil(array, callback)`: returns a "slice of the array with elements taken fromt the beginning" and continues until callback returns a truthy value. Inputs to the function are an array from which the function collects items and the callback from which the function keep collecting until a truty value

* `without(source, itemsToRemove)`: returns a subset of a given array, removing unwanted elements

---
_Source: https://npm.io/package/@psran/lotide · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
