# common-operations

> this has all common operations

Latest version **1.0.4** (published 2022-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install common-operations
pnpm add common-operations
yarn add common-operations
bun add common-operations
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-04-27 |
| First published | 2022-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ravi gupta |
| Maintainers | ravigupta2 |
| Keywords | operations, util, library, order |

## Links

- npm: https://www.npmjs.com/package/common-operations
- Repository: https://github.com/ravigupta2/common-operations
- Homepage: https://github.com/ravigupta2/common-operations#readme
- Issues: https://github.com/ravigupta2/common-operations/issues
- npm.io page: https://npm.io/package/common-operations

## Dependencies (1)

- [typescript](https://npm.io/package/typescript.md) ^4.2.3

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2022-04-27
- 1.0.3 — 2022-04-12
- 1.0.2 — 2022-04-12
- 1.0.1 — 2022-04-11
- 1.0.0 — 2022-04-11

## README

# Common Operations

It can be used for your Common Operations which are there and some project specfic Operations are there and this is not based on any framework , you can use this package with any frontend javascript based framework.


## Installation

Install  package with npm

```bash
  npm install common-operations
```

## Usage/Examples

```javascript
import { generateValidationSteps} from 'common-operations'

function Steps() {
  const validationSteps = generateValidationSteps();
}
```


## Operations present

| Function                           | Operation                                                                             | Prams                                    |
|------------------------------------|---------------------------------------------------------------------------------------|------------------------------------------|
| `cmpVersions`                      | compare two versions and return greater one                                           | `a and b`                                |
| `hardCopy`                         | Does hardCopy and Does not keep old reference                                         | `data`                                   |
| `convertToNumberType`              | convert data to number if in proper format else 0                                     | `data`                                   |
| `arraysEqual`                      | check similarity of two array and return in boolean                                   | `a and b`                                |
| `generateCardId`                   | generate 6 digit unique number for cart id                                            | none                                     |
| `getDefaultCartProduct`            | generate cart modal and version field as optional                                     | `product , version? = null`              |
| `isExistElementLocalStorage`       | check existance of element in local storage and return boolean                        | `key`                                    |
| `getItemLocalStorage`              | get item based on key from localstorage                                               | `key`                                    |
| `setItemLocalStorage`              | set item in local storage                                                             | `key and value`                          |
| `removeItemLocalStorage`           | remove item from local storage based on key                                           | `key`                                    |
| `addCurrenDataToAllDataIfNotExist` | add current data to all data based on filed for comparison and removed duplicate item | `current  , all , filed for comparision` |
| `convertMinToHour`                 | comvert mminutes to HH:MM                                                             | `minutes`                                |
| `generateValidationSteps`          | generate validatons steps for cart product                                            | `product`                                |
| `checkProductSimilar`              | compare two prduct and check if they are similar or not (POS style)                   | `a and b`                                |
| `getTimeAsNumberOfMinutes`         | convert time from HH:MM to number of minutes                                          | `time`                                   |
| `parseSupplementsKDS`              | parse supplement item in kds format                                                   | `data`                                   |
| `getUniqueArrayBasedOnKey`             | get unique objects of an array according to key                                                  | `data and key`                           |
| `allowOnlyNumberFromInputKey`              | get only number from the input key                                                   | `key`                                    |
| `trimString`              | trim string till desired length                                                   | `string and length`                      |
| `isMobileSafari`              | check whether the mobile browser is safari or not                                                   | none                                     |
| `updateArrayBasedOnKey`              | update the array based on desired key                                                   | `key , allProduct , currentProduct`                                   |

## Tech Stack

javascript , typescript


## Badges


[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/tterb/atomic-design-ui/blob/master/LICENSEs)

## Authors

- [@ravigupta2](https://www.github.com/ravigupta2)
- [@Aastha112](https://github.com/Aastha112)


## 🚀 About Me
# Hi, I'm Ravi! 👋
I'm a frontend developer...
More to come soon


## 🛠 Skills
Javascript, HTML, CSS , angular , node , electron  , scss ...

## Feedback

If you have any feedback  , suggestion , please reach out to us at rrsv.gupta@gmail.com

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