source:
node_modules/es-toolkit/dist/compat/function/negate.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 221 bytes | |
| Line | |
|---|---|
| 1 | function negate(func) { |
| 2 | if (typeof func !== 'function') { |
| 3 | throw new TypeError('Expected a function'); |
| 4 | } |
| 5 | return function (...args) { |
| 6 | return !func.apply(this, args); |
| 7 | }; |
| 8 | } |
| 9 | |
| 10 | export { negate }; |
Note:
See TracBrowser
for help on using the repository browser.
