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

@huangzj/funcjs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huangzj/funcjs

Disable the specified function within a period of time

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

funcjs

npm i --save @huangzj/funcjs

  • unpack:函数解包,分解为 [argument string, function body]
  • pack: 多函数合并,function a + function b = function c
  • throttle: 函数执行后,一段时间内无执行能力-防抖,节流
  • delay: 函数延迟执行
  • once: 函数只能执行一次
  • limit:设置函数可执行次数

e.g.

function demo(x){
  console.log('demo')
}
unpack(demo)
// output: 
["x","console.log('demo')"]

function s(g){
  console.log('g')
}

pack(demo, s)
//output: 
function (x, g) {
  console.log('demo')
  console.log('g')
}


var demoFun = disable(demo, 5000) 
// After the demoFun function is executed, it can be executed again after 5 seconds.

var onceFun = once(demo)
// The onceFun function is executed only once.
 
var limitFun = limit(demo, 6)
// The limitFun function is executed 6 times.


Keywords

unpack

FAQs

Package last updated on 10 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