# @matichmike/lotide

> Lotide (set of useful programs to work with strings, arrays and objects)

Latest version **1.0.0** (published 2020-04-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @matichmike/lotide
pnpm add @matichmike/lotide
yarn add @matichmike/lotide
bun add @matichmike/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.0 |
| Published | 2020-04-07 |
| First published | 2020-04-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 29.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Matich |
| Maintainers | matichmike |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2020-04-07

## 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 @matichmike/lotide`

**Require it:**

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

**Call it:**

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

## Documentation

The following functions are currently implemented:

* `assertArraysEqual(actual, expected)`: asserts that the expected array matches the program's actual array output.
* `assertEqual(actual, expected)`: asserts that the expected string input matches the program's actual string output.
* `assertObjectsEqual(actual, expected)`: asserts that the expected object input matches the program's actual object output.
* `countLetters(itemsToCount)`: counts the number of times each characters occured in a string and outputs the object with characters broken down.
* `countOnly(allItems, itemsToCount)`: counts the number of times a given item occured in an object.
* `eqArrays(firstArray, secondArray)`: checks whether the two given arrays are equal.
* `eqObjects = function(object1, object2)`: checks whether the two given objects are equal.
* `findKey(object, callback)`: returns the object's first key for which the callback returns truthy value.
* `findKeyByValue(showsList, theMovie)`: finds the object's key by the key's value.
* `head(actual)`: returns the array's first value.
* `middle(array)`: returns an array's middle value if the array's length is odd and the array's two middle values if the array's length is even. Returns the original array if the input is an empty array or has the length of 1 and 2.
* `tail(actual)`: returns an array's last element.
* `letterPositions(sentence)`: takes a string and outputs an object which shows the position index of each string's character.
* `map(array, callback)`: takes an array and outputs the array which consists of first character of each original array's elements.
* `takeUntil(array, callback)`: outputs a slice of the array with elements from the beginning until the callback character(s) are met.
* `without(originalArray, itemsToRemove)`: outputs the given array without the given item.

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