Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unlimited-curry

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unlimited-curry - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

2

package.json
{
"name": "unlimited-curry",
"version": "1.1.7",
"version": "1.1.8",
"description": "Unlimited curry",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -15,78 +15,105 @@ const getFrom = function (from, dataArgument) {

if(callback && 'function' === typeof callback){
timeoutSate = setTimeout(function ucCallback() {
callback(2, data)
}, 0)
timeoutSate = setTimeout(callback, 0, 2, data)
}
return timeoutSate
}
const unlimitedCurry = function (callback) {
return function () {
let timeoutSate = null
let level = 0
let returnArray = []
let returnArrayChunks = []
const UnlimitedCurry = function (callback) {
let timeoutSate = null
let level = 0
let returnArray = []
let returnArrayChunks = []
let caller = function(haveArguments) {
let firstCall = !level
if(firstCall){
caller.p = null
returnArrayChunks = []
level++
const state = {
timeoutSate, level, returnArray, returnArrayChunks, resetMe: false,
reset: function () {
if(this.resetMe){
this.level = 0
this.returnArray = []
this.returnArrayChunks = []
this.resetMe = false
}
},
return caller
clone: function () {
return {
timeoutSate: timeoutSate,
level: this.level,
returnArray: this.returnArray.slice(0),
returnArrayChunks: this.returnArrayChunks.slice(0),
resetMe: this.resetMe,
reset: this.reset,
clone: this.clone,
getData : this.getData
}
const callerArguments = Array.from(arguments)
if(!firstCall && callerArguments.length){
returnArrayChunks.push(callerArguments)
},
getData: function(){
const me = this
return getFrom(0, {returnArrayChunks: me.returnArrayChunks})
}
}
let caller = function(haveArguments) {
if(!caller.called){
caller.called = true
return caller
}
state.reset()
state.level++
const callerArguments = Array.from(arguments)
if(callerArguments.length){
state.returnArrayChunks.push(callerArguments)
}
let data = caller.data = getFrom(0, {returnArrayChunks: state.returnArrayChunks})
caller.p = () => new Promise((resolve, reject)=>{
clearTimeout(state.timeoutSate)
const conedState = state.clone()
let ret = false
const data = conedState.getData()
if(typeof callback === 'function'){
ret = callback(1, data)
}else{
ret = data
}
state.resetMe = true
let data = caller.data = getFrom(0, {returnArrayChunks})
caller.p = () => new Promise((resolve, reject)=>{
clearTimeout(timeoutSate)
let ret = false
if(typeof callback === 'function'){
ret = callback(1, caller.data)
}else{
ret = data
}
return resolve(ret)
})
return resolve(ret)
})
/* istanbul ignore else */
if(!haveArguments){
/* istanbul ignore else */
if(!haveArguments){
level = 0
returnArrayChunks = []
if(callback){
/* istanbul ignore else */
if(callback){
/* istanbul ignore else */
if(typeof callback === "function"){
clearTimeout(timeoutSate);
return callback(0, data)
}
return caller.p()
if(typeof callback === "function"){
clearTimeout(state.timeoutSate);
state.resetMe = true
return callback(0, data)
}
/* istanbul ignore else */
if(!callback){
return data
}
}
/* istanbul ignore else */
if(haveArguments){
/* istanbul ignore else */
if(timeoutSate){
clearTimeout(timeoutSate)
}
timeoutSate = safetyExecutor(data, callback)
if(!callback){
return data
}
level++
return caller
}
/* istanbul ignore else */
if(haveArguments){
/* istanbul ignore else */
if(state.timeoutSate){
clearTimeout(state.timeoutSate)
}
state.timeoutSate = safetyExecutor(data, callback)
}
state.level++
return caller(returnArray)
}()
return caller
}
return caller(state.returnArray)
}
module.exports = exports = unlimitedCurry
module.exports = exports = UnlimitedCurry
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc