|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
436 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const toInteger = require('../util/toInteger.js');
|
|---|
| 6 |
|
|---|
| 7 | function 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 |
|
|---|
| 19 | exports.after = after;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.