mirror of
https://github.com/Azure/setup-helm.git
synced 2026-07-06 16:31:38 +00:00
a517f2ff65
Co-authored-by: taakleton <taakleton@users.noreply.github.com>
19 lines
354 B
JavaScript
19 lines
354 B
JavaScript
define(function () {
|
|
|
|
// Returns a function that will only be executed up to (but not including) the
|
|
// Nth call.
|
|
function before(times, func) {
|
|
var memo;
|
|
return function() {
|
|
if (--times > 0) {
|
|
memo = func.apply(this, arguments);
|
|
}
|
|
if (times <= 1) func = null;
|
|
return memo;
|
|
};
|
|
}
|
|
|
|
return before;
|
|
|
|
});
|