npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

i-utils-js

v1.0.21

Published

i-utils-js

Downloads

9

Readme

关于i-utils-js

github地址

产生背景

这是关于个人日常比较通用代码的收集,方便日后使用,编写文档为了以后方便查阅

package.json命令

发布到yarn(npm也可以下载)

npm run yarnp

功能描述

该方法一共包含以下属性,每个属性收集了对应的方法内容(详细API去源码中查看)

  • GenericUtils 该属性主要操作对一些通用的方法集合,例如 深拷贝、去重、类型判断

  • DomUtils 该属性主要操作DOM常用的方法集合,例如 增加class 判断class 移除class

  • DesignMode 该属性主要是一些简单的设计模式,例如 发布订阅模式

快速使用

安装 (3.0及以上的版本)

使用npm安装 i-utils-js 依赖

npm i i-utils-js

yarn

yarn add i-utils-js

使用

获取所有方法

import IutilsJs from 'i-utils-js'
IutilsJs.GenericUtils.checkType('i-utils-js')

按需引入

import { GenericUtils } from 'i-utils-js'
GenericUtils.checkType('i-utils-js')
//或者
const { checkType } = GenericUtils
checkType('i-utils-js')

Version

版本号|内容 --|:--: v1.0.22|开发中... v1.0.21|修改README,增加API v1.0.20|DesignMode下增加Events发布订阅者模式 ...|...

API

类型说明:
参数:类型 => 返回类型

GenericUtils

属性|说明|类型 --|:--:|:--: checkType|判断数据类型;data:要判断的类型;type:返回的类型字符串首字母是否为小写,默认false|(data:any, type:boolean) => string isFunc |是否是函数 |any => boolean isObj |是否是对象 |any => boolean isMap |是否是字典 |any => boolean isArray |是否是数组 |any => boolean uniqueArray |数组去重 |Array => Array deepClone |深拷贝;参数一:需要拷贝的对象;参数二:布尔值,是否需要深拷贝函数,默认false | (any,boolean) => Object Array extend |继承 |Object => Object containsObj |判断一个对象的key是否全部存在于另一个对象 |void 0


DomUtils

属性|说明|类型 --|:--:|:--: hasClass|判断DOM节点上是否有class;el:DOM;className:要判断的class|(el:Dom,className:string) => boolean addClass |在el上添加class |(el:Dom,className:string) => void 0 removeClass |在el上删除class |(el:Dom,className:string) => void 0


DesignMode

属性|说明|类型 --|:--:|:--: Events|发布订阅模式|类