# @pluginjs/utils

> A workflow for modern frontend development.

Latest version **0.8.10** (published 2022-08-29) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @pluginjs/utils
pnpm add @pluginjs/utils
yarn add @pluginjs/utils
bun add @pluginjs/utils
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.10 |
| Published | 2022-08-29 |
| First published | 2017-12-26 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 8 |
| Dependencies | 1 |
| Unpacked size | 78.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Creation Studio Limited |
| Maintainers | thecreation, kaptinlin |

## Links

- npm: https://www.npmjs.com/package/@pluginjs/utils
- Repository: https://github.com/pluginjs/pluginjs
- Homepage: https://pluginjs.com
- Issues: https://github.com/pluginjs/pluginjs/issues
- npm.io page: https://npm.io/package/@pluginjs/utils

## Dependencies (1)

- [@pluginjs/is](https://npm.io/package/@pluginjs/is.md) ^0.8.9

## Recent versions

- 0.8.10 (latest) — 2022-08-29
- 0.8.9 — 2022-01-08
- 0.8.8 — 2021-09-26
- 0.8.7 — 2021-07-01
- 0.8.6 — 2021-03-25
- 0.8.5 — 2021-03-01
- 0.8.4 — 2020-07-11
- 0.8.3 — 2020-02-11
- 0.8.2 — 2020-02-11
- 0.7.19 — 2020-01-15
- 0.7.18 — 2019-12-17
- 0.7.17 — 2019-12-16
- 0.7.16 — 2019-09-20
- 0.7.15 — 2019-08-06
- 0.7.14 — 2019-07-22
- … 39 more at https://npm.io/package/@pluginjs/utils/versions

## README

# Utils

[![npm package](https://img.shields.io/npm/v/@pluginjs/utils.svg)](https://www.npmjs.com/package/@pluginjs/utils)

`utils` is a utility JavaScript library.

## Introduction
### Installation

#### Yarn

```javascript
yarn add @pluginjs/utils
```

#### NPM

```javascript
npm i @pluginjs/utils
```

## Getting Started

**CDN:**

Development:

```html
<script src="https://unpkg.com/@pluginjs/utils/dist/utils.js"></script>
```

Production:

```html
<script src="https://unpkg.com/@pluginjs/utils/dist/utils.min.js"></script>
```

## API

### deepClone

Parameters

| Name | Type | Description |
|||-|
| obj | `Object` | |

Returns

| Name | Type | Description |
|||-|
| obj | `Object` | |

### nub

Parameters

| Name | Type | Description |
|||-|
| arr | `Array` | |

Returns

| Name | Type | Description |
|||-|
| arr | `Array` | |

### isPlainObject

Parameters

| Name | Type | Description |
|||-|
| data | `Object` | |

Returns

| Name | Type | Description |
|||-|
| isPlainObject | `Boolean` | |

### deepMerge

Parameters

| Name | Type | Description |
|||-|
| x | `Object` | |
| y | `Object` | |

Returns

| Name | Type | Description |
|||-|
| result | `Object` | |

### curry

Parameters

| Name | Type | Description |
|||-|
| fn | `Function` | |

Returns

| Name | Type | Description |
|||-|
| fn | `Function` | |

### compose

Parameters

| Name | Type | Description |
|||-|
| fn | `Function[]` | |

Returns

| Name | Type | Description |
|||-|
| callback | `Function` | |

### getUID

Parameters

| Name | Type | Description |
|||-|
| prefix | `String` | |

Returns

| Name | Type | Description |
|||-|
| uid | `String` | |

### range

Parameters

| Name | Type | Description |
|||-|
| v | `Number` | length |

Returns

| Name | Type | Description |
|||-|
| result | `Array` | |

### reflow

Parameters

| Name | Type | Description |
|||-|
| element | `HTMLElement` | |

Returns

| Name | Type | Description |
|||-|
| offsetHeight | `Number` | |

### arrayEqual

Parameters

| Name | Type | Description |
|||-|
| a | `Array` | |
| b | `Array` | |

Returns

| Name | Type | Description |
|||-|
| isEqual | `Boolean` | |

### arrayDiff

Parameters

| Name | Type | Description |
|||-|
| a | `Array` | |
| b | `Array` | |

Returns

| Name | Type | Description |
|||-|
| diff | `Array` | |

### arrayIntersect

Parameters

| Name | Type | Description |
|||-|
| a | `Array` | |
| b | `Array` | |

Returns

| Name | Type | Description |
|||-|
| intersect | `Array` | |

### convertPercentageToFloat

Parameters

| Name | Type | Description |
|||-|
| percentage | `String` | |

Returns

| Name | Type | Description |
|||-|
| float | `Float` | |

### convertFloatToPercentage

Parameters

| Name | Type | Description |
|||-|
| float | `Float` | |

Returns

| Name | Type | Description |
|||-|
| percentage | `String` | |

### convertMatrixToArray

Parameters

| Name | Type | Description |
|||-|
| matrix | `String` | |

Returns

| Name | Type | Description |
|||-|
| array | `Array` | |

### getTime

Returns

| Name | Type | Description |
|||-|
| dateNow | `Number` | |

### camelize

Parameters

| Name | Type | Description |
|||-|
| word | `String` | |
| first | `Boolean` | |

Returns

| Name | Type | Description |
|||-|
| word | `String` | |

### getValueByPath

Parameters

| Name | Type | Description |
|||-|
| obj | `Object` | |
| path | `String` | |

Returns

| Name | Type | Description |
|||-|
| obj | `Object` | |

### throttle

Parameters

| Name | Type | Description |
|||-|
| func | `Function` | |
| delay | `Number` | |

Returns

| Name | Type | Description |
|||-|
| handler | `Function` | |

### debounce

Parameters

| Name | Type | Description |
|||-|
| func | `Function` | |
| delay | `Number` | |

Returns

| Name | Type | Description |
|||-|
| handler | `Function` | |

### fromPairs

Parameters

| Name | Type | Description |
|||-|
| arr | `Array` | |

Returns

| Name | Type | Description |
|||-|
| obj | `Object` | |

## Browser support

Tested on all major browsers.

| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
| --------- | --------- | --------- | --------- | --------- |
| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions|

## License

@pluginjs/utils is Licensed under [the GPL-v3 license](LICENSE).

If you want to use @pluginjs/utils project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

## Copyright

Copyright (C) 2022 [Creation Studio Limited](creationstudio.com).

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