MCPcopy
hub / github.com/vercel/next.js / cleanup

Function cleanup

packages/next/src/compiled/send/index.js:18–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 * Copyright(c) 2014 Jonathan Ong
17 * MIT Licensed
18 */e.exports=first;function first(e,t){if(!Array.isArray(e))throw new TypeError("arg must be an array of [ee, events...] arrays");var a=[];for(var i=0;i<e.length;i++){var n=e[i];if(!Array.isArray(n)||n.length<2)throw new TypeError("each array member must be [ee, events...]");var r=n[0];for(var o=1;o<n.length;o++){var p=n[o];var s=listener(p,callback);r.on(p,s);a.push({ee:r,event:p,fn:s})}}function callback(){cleanup();t.apply(null,arguments)}function cleanup(){var e;for(var t=0;t<a.length;t++){e=a[t];e.ee.removeListener(e.event,e.fn)}}function thunk(e){t=e}thunk.cancel=cleanup;return thunk}function listener(e,t){return function onevent(a){var i=new Array(arguments.length);var n=this;var r=e==="error"?a:null;for(var o=0;o<i.length;o++){i[o]=arguments[o]}t(r,n,e,i)}}},927:e=>{"use strict";
19/*!
20 * encodeurl
21 * Copyright(c) 2016 Douglas Christopher Wilson

Callers 3

callbackFunction · 0.70
index.jsFile · 0.70

Calls 2

oFunction · 0.50
removeListenerMethod · 0.45

Tested by

no test coverage detected