0.0.9 • Published 8 months ago
@mage_1/f-utils v0.0.9
f-utils
介绍
前端常用工具包
软件架构
软件架构说明
安装教程
- npm install @mage_1/f-utils
- npm i @mage_1/f-utils
- yarn add @mage_1/f-utils
源码下载
https://gitee.com/mage_1/frontend-utils.git
使用说明
- 引入
import * as utils from '@mage_1/f-utils'
- 其中包含
名称 | 描述说明 | md | 类 |
---|---|---|---|
名称 | 描述说明 | md | 类 |
array | 数组工具 | Array.ts.md | Array.ts |
browser | 浏览器相关工具 | Browser.ts.md | Browser.ts |
common | 部分公共工具StringUtil 字符串相关 NumberUtil 数字相关 DocumentUtil html document 相关FunctionUtil 函数相关FileUtil 文件处理相关OtherUtil 其他常用 | Common.ts.md | Common.ts |
datetime | 日期时间处理 | DateTime.ts.md | DateTime.ts |
enums | 常用枚举 | enums.ts.md | enums.ts |
geometric | 常用几何 | Geometric.ts.md | Geometric.ts |
regexp | 常用正则 | regexp.ts.md | regexp.ts |
storage | 本地缓存 | Storage.ts.md | Storage.ts |
verify | 校验是否 | Verify.ts.md | Verify.ts |
- common
函数名 | 描述说明 |
---|---|
arr2Tree | 数组转树形结构 |
getFullPathFromTree | 获取数组中某个节点在树形结构中的全路径 |
compare | 比较两个数据是否完全相同一致,数据可为数组或对象 |
distinctArr | 将对象数组根据某些key去重 |
getUid | 获取固定前缀(没有则uid为前缀)的开头的随机id |
getMid | 根据某些键对应的值,将其拼接成字符串来生成MD5类型的id |
... | ... |
不在此一一列举,可参见各个对应md文档 ...
参与贡献
- 小马哥
特技
- 后续继续完善