open-index/open-npm huggingface dataset:
npm package: @miop/utils
Description: Merge functional methods in the project
Author: miop
Latest version: 1.0.0

# @miop/utils

Merge functional methods in the project

## Using

```shell
npm i @miop/utils
```

## 加、减、乘、除法运算

```javascript
import { accAdd, accSub, accMul, accDiv } from '@miop/utils';

console.log(accAdd(1, 2));
console.log(accSub(1, 2));
console.log(accMul(1, 2));
console.log(accDiv(1, 2));
```

## Calc 加、减、乘、除法运算

```javascript
import { Calc } from '@miop/utils';

const calc = new Calc();
console.log(calc.add(1, 2));
console.log(calc.sub(1, 2));
console.log(calc.div(1, 2));
console.log(calc.mul(1, 2));
```

## Base64Util

```javascript
import { Base64Util } from '@miop/utils';

const base64 = new Base64Util();
const eVal = Base64Util.encode('123456');
const dVal = Base64Util.decode(eVal);
console.log(eVal, dVal);
```

## Common Methods

```javascript
import { getUniqueId, getRandomString, isValidUrl } from '@miop/utils';

// getUniqueId() => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
// getUniqueId(true) => xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx
// getRandomString(32) => xxxxxxxxxxxxyxxxyxxxxxxxxxxxxxxx
// isValidUrl('https://www.apiyux.com')
```

## Date Format

```javascript
import { getFormatDate, getFormatDateByReg, getFormatTimestamp } from '@miop/utils';

// getFormatDate(null, 'yyyy-MM-dd hh:mm:ss');
// getFormatDateByReg('20240101') => 2024-01-01
// 两个时间戳之间的天时分秒
// getFormatTimestamp()
```

## Tags Format

```javascript
import { delAllHTMLTags, delTagsAttributes, delTagsAndStyles, delAssignTagsData } from '@miop/utils';
```

# Strings Format

```javascript
import { trimAll, trimLeft, trimRight, trimLR } from '@miop/utils';
```