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

react-native-wenkingtools

v1.0.1

Published

ReactNative 工具方法

Downloads

3

Readme

react-native-wenkingtools

描述

该库主要收集通用项目中常用的方法

安装

npm install react-native-wenkingtools --save

or

yarn add react-native-wenkingtools

需要安装第三方库

npm install moment --save

or

yarn add moment

引入

import {WenKingTools} from 'react-native-wenkingtools';

// TODO: What to do with the module?
WenKingTools;

方法

| 方法 |默认值| 描述 | | -----| ---- | ---- | | log | |控制是否打印-用于设置是否打印输出 | | deepClone | | 深度拷贝 | | multiClick | callback:回调函数 count:点击次数 默认4次 duration:有效时间,默认2s 单位秒 | 多次点击事件 | | repetitionCall | callBack:回调函数 duration:运行重复调用时间间隔,默认2s,单位秒| 防止重复调用 | | priceToString | price:价格normal:null/undefined/无法转换价格返回的缺省值| 价格转换为x.xx | | dateToString |date:时间format:默认为YYYY-MM-DD HH:mm:ss | 时间格式转换 | | phoneSeparated |phoneno:手机号 | 手机号码格式转化为 344 格式 (188 3886 9199) | | encryptPhoneno |phoneno:手机号 | 手机号码加密(188****9199) | | encryptIdNo | idNo:身份证号| 身份证号加密 | | validatorIdNo | idNo:身份证号| 验证身份证号是否正确 | | changeToString |value:价格normal:缺省值默认为'' | 转换为string-避免null|undefined字段显示报错 | | removeAllSpace |text:字符串 | string去除空格 | | randomAround |min:最小值max:最大值 | 生成随机数 | | stringPadding |labelNumber:总长度 type:不缺位置left/right scale:scale根据不同的值设置” “,4倍为一个中文字体大小,“-” 2倍为一个中文字体大小,“a” 2倍为一个中文字体大小,默认为1| string补充长度 | | numberPadding |value:值minLength:最小程度 | 数字转string前缀补0 | | sortAscii | | object按ascii字母排序,返回string | | sleep |time:等待时间(单位秒) | 睡眠-等待 | | compareDate |d1:第一个时间d2:第二个时间 | 比较两个日期大小 |