New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ys-tools

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ys-tools

宇石工具库

latest
npmnpm
Version
0.0.2
Version published
Weekly downloads
7
250%
Maintainers
1
Weekly downloads
 
Created
Source

ys-tools

不断新增工具的工具函数库

功能简述

包含以下方法
## 生成随机字符串
randomWord

## md5加密
md5

## sha1加密
sha1

## cookie操作
jsCookie

## 获取路由参数
getQueryString

## 汉字转拼音
vPinyin

## 上传阿里云
uploadAliyun

## 文件流下载
downloadFileStream

## 手机系统环境信息
ua

## 深拷贝
deepClone

## 数组函数
arrFun

安装使用

## 安装依赖
npm i || yarn || cnpm ys-tools
## 引入使用
import { randomWord, md5, sha1, jsCookie, vPinyin, getQueryString } from 'ys-tools'

randomWord(min, max) 生成随机长度min至max之间的随机字符串
randomWord(min) 生成长度min的随机字符串

md5(string) 使用同md5
sha1.sha1(string) 使用同sha1

jsCookie 使用同‘js-cookie’

vPinyin.chineseToPinYin('中文') 汉字转拼音

getQueryString(name) 取名为name的路由链接参数

uploadAliyun(params: object, file: object, fileName: string) params阿里云所需参数(此参数由自定义后端接口返回),file文件,fileName下载文件名
downloadFileStream(downloadUrl: string, params: object, fileName?: string, timeout?: number) downloadUrl下载请求接口地址,params下载请求所需参数,fileName下载文件名,timeout超时时长

ua 系统信息
ua.browser 浏览器类型和版本
ua.os 操作系统类型

deepClone 深拷贝

arrFun 数组
arrFun.arrayEqual 判断两个数组是否相等,参数(arr1,arr2)两个数组,返回布尔值
arrFun.deDuplicateArray 根据数组中某个对象值去重,参数(数组,健:string),返回去重后的数组
arrFun.removeEmptyArrays 传入两层数组[[],[开始时间, 结束时间],[]],去除数组中空数组,返回去空后的数组

#更新记录

ys-tools@0.0.1 初始化

#issuse

有问题欢迎@无心

Keywords

utils

FAQs

Package last updated on 11 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts