JSPM

@tackpablo/lotide

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q17775F
  • License ISC

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.

Package Exports

  • @tackpablo/lotide
  • @tackpablo/lotide/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tackpablo/lotide) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(head): gets the first element of array
  • function2(tail): gets the last element of array
  • function3(middle): gets the middle element of array
  • function3(assertArraysEq): asserts if 2 arrays are equal
  • function3(assertEqual): asserts if two values are equal
  • function3(assertObjectsEqual): asserts if 2 objects are equal
  • function3(countLetters): counts each letter of string
  • function3(countOnly): takes elements of arrays and counts their amount
  • function3(eqArrays): compares 2 arrays
  • function3(eqObjects): compares 2 objects
  • function3(findKey): returns first element key that meets the condition of callback function
  • function3(findKeyByValue): returns element key that meets specified value
  • function3(flatten): flattens nested arrays into a single level array
  • function3(letterPositions): returns all indices where specific is element found
  • function3(map): returns new array with results of callback function
  • function3(takeUntil): returns slice of an array with elements taken from the beginning
  • function3(without): removes element from an array