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

sx-webjs

v1.6.33

Published

顺心畅游Web端函数库

Downloads

515

Readme

陕西顺心信息技术有限公司

Web 端函数库

Fix Bug

  • sx-webJs/dist/enum

    • MealsEnum 餐食标识
    • OnboardNetworkServiceEnum 机上网络服务标识
    • EntertainmentEnum 娱乐标识
    • conversion 枚举转换Select Options 结构
  • sx-webJs/dist/function

    • calcStrLen 计算该字符串对应的字节数
    • dataType 返回给定输入的数据类型
    • deepCopy 数据深拷贝
    • getTextWidth 计算给定文本字符串的宽度
    • subSet 返回第一个数组中不存在于第二个数组中的元素子集
    • unique 返回一个仅包含唯一元素的新数组
    • downloadALink 创建一个具有指定 URL 和文件名的隐藏链接元素,并下载
    • copy 执行浏览器复制命令
    • mergeRepeatData 根据指定的名称和关键数据合并重复数据
    • getArrDifference 根据指定的键返回两个数组之间的差异
    • listToTree 根据上级和权限 ID 将平面数据列表转换为树结构
    • treeToList 将树状数据结构转换为具有 parentId 属性的平面列表
    • convertStyleToStr 对象转换为字符串格式
    • floatAdd 浮点数加法
    • floatSubtract 浮点数减法
    • floatMultiply 浮点数乘法
    • floatDivide 浮点数除法
    • getPrecision 获取浮点数的小数位数
  • sx-webJs/dist/reg

    • phone
    • email
    • alphanumericReg 匹配任何仅包含字母数字字符(字母和数字)的字符串
    • englishLetter 匹配任何仅包含英文字母(大写和小写)的字符串
    • regLetterNumber 至少包含一个大写字母和一个数字
    • checkRate 包含字母和数字的字符串
    • checkPswd 匹配任何包含中文字符的字符串
    • isNumerP 1 到 9 之间任何非数字字符
    • checkIdCard 检查给定的中国身份证号码的有效性
    • checkNumber 进行数字格式校验(min,max,precision,value,IsReturnStr)
  • sx-webJs/dist/vue-function

    • getApiByFunctionId 根据会话存储中给定的FunctionId 检索 API 名称和服务名称
    • isAuth 检查给定FunctionId是否存在于会话存储数组中并相应地返回一个布尔值
    • checkBtnOptionsAuth 根据用户是否有权访问每个选项的相应功能来过滤一组选项
    • getSearchForm 接受表单数据和表单值,并返回具有非空值的已过滤表单项数组
    • coverFormItem 接受一个表单项及其值,并返回一个数组
    • splicingCheckBox 根据复选框表单项中的选定选项创建一个对象数组
    • splicingDate 将一个日期范围拼接成两个单独的日期对象,并以特定格式返回它们
    • checkTableList 检查给定对象是否具有非空 ListValue 属性并返回它
    • setSearchParameter 设置分页和表单数据的搜索参数
    • getSurplusHeight 通过减去子元素的总高度和一些固定值来计算 body 元素上可用的剩余高度
  • 2024-04-07

    getSurplusHeight计算高度时,ref为空时,不纳入计算范围

  • 2023-4-24

    • 新增 md5
  • 2023-4-21

    • 新增正则
    • 新增 vue-function

Using yarn or pnpm:

yarn add sx-webjs

pnpm add sx-webjs

Quickstart

// 全量导入
import sxWebJs from "sx-webJs";
sxWebJs.setStorageKey('设置存储的虚拟目录名称');

// 部分导入
import cookie from "sx-webJs/dist/cookie";

import storage from "sx-webJs/dist/storage";
storage.setVirtualDirectory('设置存储的虚拟目录名称');

import vueFunction from "sx-webJs/dist/vue-function";

import function from "sx-webJs/dist/function";

import reg from "sx-webJs/dist/reg";