open-index/open-npm huggingface dataset:
npm package: @huaerkaikai/testinputa
Description: ## Project setup ``` yarn install ```
Latest version: 0.1.0

# my-vue-app

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
npm package: @huaerkaikai/testtablea
Description: ## Project setup ``` yarn install ```
Latest version: 0.1.0

# myvueapp

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
npm package: @huafl/js-tools
Description: The starter is built on top of Vite 4.x and prepared for writing libraries in TypeScript. It generates a hybrid package - both support for CommonJS and ESM modules.
Latest version: 0.0.1

# vite-vanilla-ts-lib-starter

The starter is built on top of Vite 4.x and prepared for writing libraries in TypeScript. It generates a hybrid package - both support for CommonJS and ESM modules.

## Features

- Hybrid support - CommonJS and ESM modules
- IIFE bundle for direct browser support without bundler
- Typings bundle
- ESLint - scripts linter
- Stylelint - styles linter
- Prettier - formatter
- Jest - test framework
- Husky + lint-staged - pre-commit git hook set up for formatting

## GitHub Template

This is a template repo. Click the green [Use this template](https://github.com/kbysiec/vite-vanilla-ts-lib-starter/generate) button to get started.

## Clone to local

If you prefer to do it manually with the cleaner git history

```bash
git clone https://github.com/kbysiec/vite-vanilla-ts-lib-starter.git
cd vite-vanilla-ts-lib-starter
npm i
```

## Checklist

When you use this template, update the following:

- Remove `.git` directory and run `git init` to clean up the history
- Change the name in `package.json` - it will be the name of the IIFE bundle global variable and bundle files name (`.cjs`, `.mjs`, `.iife.js`, `d.ts`)
- Change the author name in `LICENSE`
- Clean up the `README` and `CHANGELOG` files

And, enjoy :)

## Usage

The starter contains the following scripts:

- `dev` - starts dev server
- `build` - generates the following bundles: CommonJS (`.cjs`) ESM (`.mjs`) and IIFE (`.iife.js`). The name of bundle is automatically taked from `package.json` name property
- `test` - starts jest and runs all tests
- `test:coverage` - starts jest and run all tests with code coverage report
- `lint:scripts` - lint `.ts` files with eslint
- `lint:styles` - lint `.css` and `.scss` files with stylelint
- `format:scripts` - format `.ts`, `.html` and `.json` files with prettier
- `format:styles` - format `.cs` and `.scss` files with stylelint
- `format` - format all with prettier and stylelint
- `prepare` - script for setting up husky pre-commit hook
- `uninstall-husky` - script for removing husky from repository

## Acknowledgment

If you found it useful somehow, I would be grateful if you could leave a star in the project's GitHub repository.

Thank you.
npm package: @huafl/tools
Description: 这是一个基于 TypeScript 的 JavaScript 工具库，名为 `@huafl/tools`。该项目基于 Vite 4.x 构建，旨在创建支持 CommonJS 和 ESM 模块的混合包。项目提供了多种实用的工具函数，包括字符串处理、日期格式化、数组操作、对象操作、正则验证等功能。
Latest version: 1.3.0

# @huafl/tools 

## 概述

这是一个基于 TypeScript 的 JavaScript 工具库，名为 `@huafl/tools`。该项目基于 Vite 4.x 构建，旨在创建支持 CommonJS 和 ESM 模块的混合包。项目提供了多种实用的工具函数，包括字符串处理、日期格式化、数组操作、对象操作、正则验证等功能。

项目最初是从 `vite-vanilla-ts-lib-starter` 模板创建的，包含完整的构建和测试工具链。

## 主要功能

### 核心工具函数

该工具库提供了以下分类的工具函数：

#### 字符串处理

- `maskPhoneNumber()` - 手机号掩码
- `checkFileType()` - 检查文件类型
- `removeDuplicateStr()` - 去除字符串中的重复项
- `generateRandomString()` - 生成指定长度的随机字符串
- `toCamelCase()` - 驼峰转换
- `toSnakeCase()` - 下划线转换
- `toKebabCase()` - 连字符转换
- `capitalize()` - 首字母大写
- `truncateString()` - 截断字符串

#### 数字处理

- `formatNumber()` - 千分位格式化数字
- `numberToChinese()` - 将数字转换为中文大写

#### 日期处理

- `formatDate()` - 格式化日期
- `dateDiffInDays()` - 计算两个日期之间的天数差
- `calculateAge()` - 计算年龄
- `isLeapYear()` - 判断是否为闰年
- `getDaysInMonth()` - 获取指定月份的天数

#### 数组处理

- `uniqueArray()` - 数组去重
- `chunkArray()` - 数组分割
- `flattenArray()` - 数组扁平化

#### 对象处理

- `deepClone()` - 深拷贝对象
- `deepMerge()` - 深度合并对象

#### URL 处理

- `getUrlParam()` - 获取 URL 参数
- `getUrlParams()` - 获取 URL 参数对象

#### 正则表达式验证

- `_regs` - 包含多种正则表达式（手机号、邮箱、身份证、URL 等）
- `validateIdCard()` - 验证身份证号码

#### 函数式工具

- `debounce()` - 防抖函数
- `throttle()` - 节流函数

#### 其他实用工具

- `generateUUID()` - 生成 UUID
- `randomColor()` - 随机生成颜色值
- `isMobile()` - 检查是否为移动端
- `copyToClipboard()` - 复制文本到剪贴板

## 构建和运行

### 安装依赖

```bash
npm install
```


### 构建输出

构建过程会生成以下文件：

- `dist/index.cjs` - CommonJS 模块
- `dist/index.mjs` - ESM 模块
- `dist/index.iife.js` - IIFE 模块（可在浏览器中直接使用）
- `dist/index.d.ts` - TypeScript 类型定义文件


## 使用示例

```typescript
import { maskPhoneNumber, formatDate, getUrlParam } from "@huafl/tools";

// 手机号掩码
console.log(maskPhoneNumber("13812345678")); // 输出: 138****5678

// 日期格式化
console.log(formatDate(new Date(), "YYYY-MM-DD HH:mm:ss")); // 输出: 2023-01-01 12:00:00

// 获取URL参数
console.log(getUrlParam("http://example.com/?id=123", "id")); // 输出: 123
```