source: node_modules/es-toolkit/dist/compat/function/after.mjs@ ba17441

Last change on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 332 bytes
Line 
1import { toInteger } from '../util/toInteger.mjs';
2
3function after(n, func) {
4 if (typeof func !== 'function') {
5 throw new TypeError('Expected a function');
6 }
7 n = toInteger(n);
8 return function (...args) {
9 if (--n < 1) {
10 return func.apply(this, args);
11 }
12 };
13}
14
15export { after };
Note: See TracBrowser for help on using the repository browser.