@ctx-core/function
Advanced tools
Comparing version 10.4.1 to 10.5.2
@@ -139,2 +139,17 @@ export declare type falsy = false | 0 | '' | null | undefined; | ||
/** | ||
* Returns a function where the arguments to the wrapped function are sliced with idx__begin & idx__end. | ||
* @param {function}fn - Wrapped function | ||
* @param {number}[idx__begin] - Index of beginning of slice. | ||
* @param {number}[idx__end] - Index of end of slice | ||
*/ | ||
export declare function _arg_a1__slice(fn: (...arg_a1: any[]) => any, idx__begin?: number, idx__end?: number): (...arg_a1: any[]) => any; | ||
export declare const _a1__arg__slice: typeof _arg_a1__slice; | ||
/** | ||
* Returns a function where the first `count` arguments are sent to the wrapped function. | ||
* @param {function}fn - Wrapped function | ||
* @param {number}count - Number of first arguments to send to the wrapped function. | ||
*/ | ||
export declare function _arg_a1__head(fn: any, count?: number): (...arg_a1: any[]) => any; | ||
export declare const _a1__arg__head: typeof _arg_a1__head; | ||
/** | ||
* @typedef {string|number} arg__andand | ||
@@ -141,0 +156,0 @@ */ |
@@ -210,2 +210,21 @@ 'use strict'; | ||
/** | ||
* Returns a function where the arguments to the wrapped function are sliced with idx__begin & idx__end. | ||
* @param {function}fn - Wrapped function | ||
* @param {number}[idx__begin] - Index of beginning of slice. | ||
* @param {number}[idx__end] - Index of end of slice | ||
*/ | ||
function _arg_a1__slice(fn, idx__begin, idx__end) { | ||
return (...arg_a1) => fn(...arg_a1.slice(idx__begin, idx__end)); | ||
} | ||
const _a1__arg__slice = _arg_a1__slice; | ||
/** | ||
* Returns a function where the first `count` arguments are sent to the wrapped function. | ||
* @param {function}fn - Wrapped function | ||
* @param {number}count - Number of first arguments to send to the wrapped function. | ||
*/ | ||
function _arg_a1__head(fn, count = 1) { | ||
return _arg_a1__slice(fn, 0, count); | ||
} | ||
const _a1__arg__head = _arg_a1__head; | ||
/** | ||
* @typedef {string|number} arg__andand | ||
@@ -609,2 +628,4 @@ */ | ||
exports._a1__arg__head = _a1__arg__head; | ||
exports._a1__arg__slice = _a1__arg__slice; | ||
exports._a1__wrap = _a1__wrap; | ||
@@ -619,2 +640,4 @@ exports._and = _and; | ||
exports._apply__bind = _apply__bind; | ||
exports._arg_a1__head = _arg_a1__head; | ||
exports._arg_a1__slice = _arg_a1__slice; | ||
exports._call = _call; | ||
@@ -621,0 +644,0 @@ exports._call__bind = _call__bind; |
{ | ||
"name": "@ctx-core/function", | ||
"version": "10.4.1", | ||
"version": "10.5.2", | ||
"description": "ctx-core function", | ||
@@ -37,3 +37,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "f259d149680a8a776bbc0e7b1aae573e412596b0" | ||
"gitHead": "faa5f56f9f1e4db5c618bf403731d9c6cef31deb" | ||
} |
@@ -212,2 +212,21 @@ export type falsy = false|0|''|null|undefined | ||
/** | ||
* Returns a function where the arguments to the wrapped function are sliced with idx__begin & idx__end. | ||
* @param {function}fn - Wrapped function | ||
* @param {number}[idx__begin] - Index of beginning of slice. | ||
* @param {number}[idx__end] - Index of end of slice | ||
*/ | ||
export function _arg_a1__slice(fn:(...arg_a1)=>any, idx__begin?:number, idx__end?:number) { | ||
return (...arg_a1) => fn(...arg_a1.slice(idx__begin, idx__end)) | ||
} | ||
export const _a1__arg__slice = _arg_a1__slice | ||
/** | ||
* Returns a function where the first `count` arguments are sent to the wrapped function. | ||
* @param {function}fn - Wrapped function | ||
* @param {number}count - Number of first arguments to send to the wrapped function. | ||
*/ | ||
export function _arg_a1__head(fn, count=1) { | ||
return _arg_a1__slice(fn, 0, count) | ||
} | ||
export const _a1__arg__head = _arg_a1__head | ||
/** | ||
* @typedef {string|number} arg__andand | ||
@@ -214,0 +233,0 @@ */ |
Sorry, the diff of this file is not supported yet
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
67261
2330