azi-utils
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@azi/utils

Common tool function encapsulation

通用函数、样式封装

install

  npm i -D azi-utils
  yarn add - D azi-utils
  pnpm add -D azi-utils

usage

  • esmodule
    import { debounce } from "azi-utils";
    const onInput = debounce((e) => {
      const target = e.target as HTMLElement;
      const value = target.value;
      // code hear
    }, 800);
  • commonjs
    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"
    

functions

  • Reporter

    前端埋点 sdk

  • Storage

    本地存储模块封装

  • 通用函数封装

    • debounce 防抖
    • throttle 节流
    • dateFormat 基本的时间格式化
    • padString 字符串填充
    • getExactType 获取所有数据的数据类型
    • resetObject 重置对象,一般用于表单和搜索区域等
    • deepClone 数组或对象的深拷贝
    • forEach 数组、对象、Map、Set 遍历
  • Request

    http 请求模块封装

Dependents (0)

Package Sidebar

Install

npm i azi-utils

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

36.5 kB

Total Files

7

Last publish

Collaborators

  • azi0427