Common tool function and styles encapsulation
npm install azi-utils> Common tool function encapsulation
> 通用函数、样式封装
``shell`
npm i -D azi-utils
yarn add - D azi-utils
pnpm add -D azi-utils
- esmodule
`ts`
import { debounce } from "azi-utils";
const onInput = debounce((e) => {
const target = e.target as HTMLElement;
const value = target.value;
// code hear
}, 800);
`
- commonjs
js`
const { dateFormat } = require("azi-utils");
const date = 1661878650879;
console.log(dateFormat(date, "YYYY-MM-DD hh:mm:ss"));
`
- style
``
import "azi-utils/style/index.css"
- Reporter
> 前端埋点 sdk
- Storage
> 本地存储模块封装
- 通用函数封装
- debounce 防抖
- throttle 节流
- dateFormat 基本的时间格式化
- padString 字符串填充
- getExactType 获取所有数据的数据类型
- resetObject 重置对象,一般用于表单和搜索区域等
- deepClone 数组或对象的深拷贝
- forEach 数组、对象、Map、Set 遍历
- Request
> http 请求模块封装