# tea-helpers

> Tea protocol helper functions

Latest version **1.2.5** (published 2024-04-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install tea-helpers
pnpm add tea-helpers
yarn add tea-helpers
bun add tea-helpers
```

## 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.2.5 |
| Published | 2024-04-30 |
| First published | 2024-02-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 19 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | shevchenko-max |
| Maintainers | shevchenko-max |
| Keywords | tea, protocol, helpers, functions, node, js, array |

## Links

- npm: https://www.npmjs.com/package/tea-helpers
- Repository: https://github.com/shevchenko-max/tea-helpers
- Homepage: https://github.com/shevchenko-max/tea-helpers#readme
- Issues: https://github.com/shevchenko-max/tea-helpers/issues
- npm.io page: https://npm.io/package/tea-helpers

## Dependencies (19)

- [ejs](https://npm.io/package/ejs.md) ^3.1.9
- [koa](https://npm.io/package/koa.md) ^2.15.0
- [node](https://npm.io/package/node.md) ^21.7.1
- [pino](https://npm.io/package/pino.md) ^8.18.0
- [axios](https://npm.io/package/axios.md) ^1.6.7
- [dotenv](https://npm.io/package/dotenv.md) ^16.4.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [date-fns](https://npm.io/package/date-fns.md) ^3.3.1
- [koa-json](https://npm.io/package/koa-json.md) ^2.0.2
- [rc-ruler](https://npm.io/package/rc-ruler.md) ^0.1.1
- [star-tea](https://npm.io/package/star-tea.md) ^1.0.6
- [cross-env](https://npm.io/package/cross-env.md) ^7.0.3
- [koa-views](https://npm.io/package/koa-views.md) ^8.0.0
- [koa-helmet](https://npm.io/package/koa-helmet.md) ^7.0.2
- [koa-static](https://npm.io/package/koa-static.md) ^5.0.0
- [typescript](https://npm.io/package/typescript.md) ^5.4.3
- [@koa/router](https://npm.io/package/@koa/router.md) ^12.0.1
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.4.1
- [koa-pino-logger](https://npm.io/package/koa-pino-logger.md) ^4.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.5 (latest) — 2024-04-30
- 1.2.4 — 2024-04-24
- 1.2.3 — 2024-04-22
- 1.2.2 — 2024-03-26
- 1.2.1 — 2024-03-23
- 1.2.0 — 2024-03-23
- 1.1.2 — 2024-03-06
- 1.1.1 — 2024-03-03
- 1.1.0 — 2024-03-02
- 1.0.7 — 2024-02-28
- 1.0.6 — 2024-02-28
- 1.0.5 — 2024-02-28
- 1.0.4 — 2024-02-28
- 1.0.3 — 2024-02-22
- 1.0.2 — 2024-02-22
- … 3 more at https://npm.io/package/tea-helpers/versions

## README

# helper functions

You are free to choose any of the following methods to implement functionality with the helper functions.

isObject (obj) -> bool

msToHours (ms) -> float

msToMinutes (ms) -> float

msToDays (ms) -> float

daysToMs (hours) -> int

hoursToMs (minutes) -> int

calculateTimeDiffInMinutes (seconds) -> int

calculateTimeDiffInDays (ms) -> str

transformStringToBase64 (str) -> str

removeDateSeconds (date) -> date

arrayToTree (arr) -> dict

isArraysContentSame (arr1, arr2) -> bool

transformArrayOfNumbers (arr) -> number[]

isAllowedLanguage (str) -> bool

transformArrayOfStrings (arr) -> str[]

transformEmptyStringToNull (str) -> str

wait (ms) -> void

isValidUrl (url) -> bool

transformExcelDateToTimestamp (date) -> int

transformFromCents (cents) -> float

transformToCents (dollars) -> int

transformToInt (str) -> int

transformToFloat (str) -> float

quoteQuery (str) -> str

capitalizeLetters (str) -> str

swapObject (obj) -> obj

Each (collection, iteratee) -> void
Iterates over elements of collection and invokes iteratee for each element. The iteratee is invoked with three arguments: (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false.

EachRight (collection, iteratee) -> void
This method is like Each except that it iterates over elements of collection from right to left.

Map (collection, iteratee) -> array
Creates an array of values by running each element in collection through iteratee. The iteratee is invoked with three arguments: (value, index|key, collection).

Filter (collection, iteratee) -> array
Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The predicate is invoked with three arguments: (value, index|key, collection).

Every (collection, iteratee) -> bool
Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate returns falsey. The predicate is invoked with three arguments: (value, index|key, collection).

Some (collection, iteratee) -> bool
Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate returns truthy. The predicate is invoked with three arguments: (value, index|key, collection).

Push (collection, value) -> void
Adds value to the end of collection.

Reduce (collection, iteratee, accumulator) -> any
Reduces collection to a value which is the accumulated result of running each element in collection thru iteratee, where each successive invocation is supplied the return value of the previous. If accumulator is not given, the first element of collection is used as the initial value.

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