@ctx-core/function
Advanced tools
Comparing version 7.1.0 to 7.2.0
17
lib.js
@@ -50,2 +50,19 @@ import { isArray } from '@ctx-core/object' | ||
} | ||
/** | ||
* Returns a function that calls fn passing the arguments sliced by a1__arg__slice. | ||
* @param {function} fn | ||
* @param {...a1__arg__slice} Array#slice arguments to pass to fn | ||
* @returns {function(...[*]=): *} | ||
*/ | ||
export function slice__a1__arg(fn, ...a1__arg__slice) { | ||
return (...a1__arg) => fn(a1__arg.slice.apply(a1__arg, a1__arg__slice)) | ||
} | ||
/** | ||
* Returns a function that calls fn passing only the first argument. | ||
* @param {function} fn | ||
* @returns {function(...[*]=): *} | ||
*/ | ||
export function arg__0__(fn) { | ||
return slice__a1__arg(fn, 0, 1) | ||
} | ||
export function tick(fn, timeout = 0) { | ||
@@ -52,0 +69,0 @@ return new Promise((resolve, reject) => { |
{ | ||
"name": "@ctx-core/function", | ||
"version": "7.1.0", | ||
"version": "7.2.0", | ||
"description": "ctx-core function", | ||
@@ -23,3 +23,3 @@ "main": "lib.js", | ||
"homepage": "https://github.com/ctx-core/ctx-core#readme", | ||
"gitHead": "861a27faca25e6f001e7cbc9575e7e851ccae583" | ||
"gitHead": "a5ae765cd901bed2ae71125bf82671731709c5fd" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8664
301