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

pm-js-utils

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pm-js-utils

Javascript utilities for People's Medic web projects

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

仁仁医疗常用 Javascript 代码块

电梯

  • getHashParams
  • getUrlParams
  • randomString
  • readableDate
  • setStorage
  • isWechat

getHashParams(hash)

获取 hash 参数

  • 参数

    ParamTypeDescriptionSample
    hashstringurl上#/{path}后内容"#/?id=a&user=abc"
  • 返回

    TypeDescriptionSample
    Object--{id: 'a', user: 'abc'}

getUrlParams(search)

获取 url 参数

  • 参数

    ParamTypeDescriptionSample
    searchstringurl上/{path}后内容"?id=a&user=abc"
  • 返回

    TypeDescriptionSample
    Object--{id: 'a', user: 'abc'}

randomString(length)

生成随机字符串

  • 参数

    ParamTypeDescriptionSample
    lengthnumber生成字符串的长度10
  • 返回

    TypeDescriptionSample
    string--"k2pnnc01f8hun"

readableDate(dateString)

将日期转为中文年月日日期

  • 参数

    ParamTypeDescriptionSample
    dateStringstring标准日期字符串"2010-10-01"
  • 返回

    TypeDescriptionSample
    string中文格式化日期"2010年10月1日"

setStorage(params)

批量 localstorage.setItem()

  • 参数

    ParamTypeDescriptionSample
    {key/value}objectkey/value{openId: "wewe", userId: "3"}
  • 返回


isWechat()

判断是否在微信浏览器

  • 参数

  • 返回

    TypeDescriptionSample
    boolean是或否true

FAQs

Package last updated on 11 Oct 2018

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