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

@xiaozhu119/js-utils-libs

v0.0.8

Published

js常见的函数工具库

Downloads

520

Readme

js-util-libs(函数库)

概述

在开发中,我们经常会将一些常用的代码块、功能块进行封装,为的是更好的复用。那么,被抽离出来独立完成功能,通过 API 或配置项和其他部分交互,便形成了插件(工具函数)。 下面这些是我在工作中积累的一些常用的前端开源工具函数

Install(安装)

npm install @xiaozhu119/js-utils-libs

Usage(使用)

1、手机号中间四位变成* (182****698)

2、字符串首字母大写 (Hello)

3、转换字符串,undefined,null等转化为"" (undefined--->"")

4、去除参数空数据(用于向后台传递参数的时候)({name:"李四",age:""}--->{name:"李四"})

5、去除空格 (" hello "--->"hello")

6、常用校验 1.邮箱校验

2.手机号校验

3.微信号校验

4.QQ号校验

5.车牌号校验

6.密码强度校验

7.是否包含中文校验

8.邮编号校验

9.16进制颜色校验

10.身份证号校验

11.Ipv4校验

12.手机是Andoird还是IOS

13.是否数字

14.是否对象

15.是否空对象

16.是否数组

17.数据类型判断

18、银行卡号码校验(luhn算法)

19.验证版本号格式必须为X.Y.Z

20.验证护照(包含香港、澳门)

如何使用

示例

import { filterEmptyData } from '@xiaozhu119/js-utils-libs'

const myObject = {
name: 'John',
age: '',
email: '[email protected]'
}

this.myObject = filterEmptyData(this.myObject);