source: node_modules/es-toolkit/dist/compat/function/after.js@ a762898

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

Added visualizations

  • Property mode set to 100644
File size: 436 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const toInteger = require('../util/toInteger.js');
6
7function after(n, func) {
8 if (typeof func !== 'function') {
9 throw new TypeError('Expected a function');
10 }
11 n = toInteger.toInteger(n);
12 return function (...args) {
13 if (--n < 1) {
14 return func.apply(this, args);
15 }
16 };
17}
18
19exports.after = after;
Note: See TracBrowser for help on using the repository browser.