MCPcopy Index your code
hub / github.com/socketstream/socketstream / t

Function t

test/fixtures/project/client/abc/expected.min.js:1–1  ·  view source on GitHub ↗
(e,r)

Source from the content-addressed store, hash-verified

1window.require=function(e,r){var n=require.resolve(e,r||"/"),i=require.modules[n]||require.initModule(n);if(!i)throw Error("Failed to resolve module "+e+", tried "+n);return i._cached?i._cached:i()},require.paths=[],require.modules={},require._core={events:!0,path:!0,vm:!0},require.resolve=function(e,r){function n(){for(var e,r=0;e=arguments[r];++r)if(require.modules[e])return e}if(r||(r="/"),require._core[e])return e;var i=require.modules.path(),t=i.extname(e);t&&(e=e.substring(0,e.length-t.length)),e="/"===e.charAt(0)?i.resolve(r,e.substring(1)):e,e=e.match(/^(?:\.\.?\/)/)?i.resolve(r,e):e;var o=n(e,i.join(e,"index"));if(o)return o;throw Error("Cannot find module '"+e+"' within '"+r+"'")},require.alias=function(e,r){var n=require.modules.path(),i=null;try{i=require.resolve(e+"/package.json","/")}catch(t){i=require.resolve(e,"/")}for(var o=n.dirname(i),u=(Object.keys||function(e){var r=[];for(var n in e)r.push(n);return r})(require.modules),s=0;u.length>s;s++){var c=u[s];if(c.slice(0,o.length+1)===o+"/"){var a=c.slice(o.length);require.modules[r+a]=require.modules[o+a]}else c===o&&(require.modules[r]=require.modules[o])}},require.define=function(e,r){var n=require._core[e]?"":require.modules.path().dirname(e),i=function(e){return require(e,n)};i.resolve=function(e){return require.resolve(e,n)},i.modules=require.modules,i.define=require.define;var t={exports:{}};require.modules[e]=function(){return require.modules[e]._cached=t.exports,r.call(t.exports,i,t,t.exports,n,e),require.modules[e]._cached=t.exports,t.exports}},"undefined"==typeof process&&(process={}),process.nextTick||(process.nextTick=function(){var e=[],r="undefined"!=typeof window&&window.postMessage&&window.addEventListener;return r&&window.addEventListener("message",function(r){if(r.source===window&&"browserify-tick"===r.data&&(r.stopPropagation(),e.length>0)){var n=e.shift();n()}},!0),function(n){r?(e.push(n),window.postMessage("browserify-tick","*")):setTimeout(n,0)}}()),process.title||(process.title="browser"),process.binding||(process.binding=function(e){if("evals"===e)return require("vm");throw Error("No such module")}),process.cwd||(process.cwd=function(){return"."}),require.define("path",function(e,r,n){function i(e,r){for(var n=[],i=0;e.length>i;i++)r(e[i],i,e)&&n.push(e[i]);return n}function t(e,r){for(var n=0,i=e.length;i>=0;i--){var t=e[i];"."==t?e.splice(i,1):".."===t?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(r)for(;n--;n)e.unshift("..");return e}var o=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;n.resolve=function(){for(var e="",r=!1,n=arguments.length;n>=-1&&!r;n--){var o=n>=0?arguments[n]:process.cwd();"string"==typeof o&&o&&(e=o+"/"+e,r="/"===o.charAt(0))}return e=e.replace(/\/\.\//,"/"),e=t(i(e.split("/"),function(e){return!!e}),!r).join("/"),(r?"/":"")+e||"."},n.normalize=function(e){var r="/"===e.charAt(0),n="/"===e.slice(-1);return e=t(i(e.split("/"),function(e){return!!e}),!r).join("/"),e||r||(e="."),e&&n&&(e+="/"),(r?"/":"")+e},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(i(e,function(e){return e&&"string"==typeof e}).join("/"))},n.dirname=function(e){var r=o.exec(e)[1]||"";return r?"/"===r?r:r.substring(0,r.length-1):"."},n.basename=function(e,r){var n=o.exec(e)[2]||"";return r&&n.substr(-1*r.length)===r&&(n=n.substr(0,n.length-r.length)),n},n.extname=function(e){return o.exec(e)[3]||""}});
2require.define("eventemitter2",function(e,t,r){!function(e,t){function r(){this._events=Object()}function i(e){e&&(this.wildcard=e.wildcard,this.delimiter=e.delimiter||".",this.wildcard&&(this.listenerTree=Object()))}function n(e){this._events=Object(),i.call(this,e)}function s(e,t,r,i){if(r){var n;if(i===t.length&&r._listeners){if("function"==typeof r._listeners)return e&&e.push(r._listeners),r;for(var o=0,l=r._listeners.length;l>o;o++)e&&e.push(r._listeners[o]);return r}if("*"===t[i]||r[t[i]]){if("*"===t[i]){for(var u in r)"_listeners"!==u&&r.hasOwnProperty(u)&&(n=s(e,t,r[u],i+1));return n}n=s(e,t,r[t[i]],i+1)}return r["*"]&&s(e,t,r["*"],i+1),n}}function o(e,t){e="string"==typeof e?e.split(this.delimiter):e.slice();for(var r=this.listenerTree,i=e.shift();i;){if(r[i]||(r[i]=Object()),r=r[i],0===e.length){if(r._listeners){if("function"==typeof r._listeners)r._listeners=[r._listeners,t];else if(l(r._listeners)&&(r._listeners.push(t),!r._listeners.warned)){var n=u;n>0&&r._listeners.length>n&&(r._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",r._listeners.length),console.trace())}}else r._listeners=t;return!0}i=e.shift()}return!0}var l=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},u=10;n.prototype.setMaxListeners=function(e){this._events||r.call(this),this._events.maxListeners=e},n.prototype.event="",n.prototype.once=function(e,t){return this.many(e,1,t),this},n.prototype.many=function(e,t,r){function i(){0===--t&&n.off(e,i),r.apply(null,arguments)}var n=this;if("function"!=typeof r)throw Error("many only accepts instances of Function");return i._origin=r,this.on(e,i),n},n.prototype.emit=function(){this._events||r.call(this);var e=arguments[0];if("newListener"===e&&!this._events.newListener)return!1;if(this._all){for(var t=arguments.length,i=Array(t-1),n=1;t>n;n++)i[n-1]=arguments[n];for(n=0,t=this._all.length;t>n;n++)this.event=e,this._all[n].apply(this,i)}if("error"===e&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");var o;if(this.wildcard){o=[];var l="string"==typeof e?e.split(this.delimiter):e.slice();s.call(this,o,l,this.listenerTree,0)}else o=this._events[e];if("function"==typeof o){if(this.event=e,1===arguments.length)o.call(this);else if(arguments.length>1)switch(arguments.length){case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:for(var t=arguments.length,i=Array(t-1),n=1;t>n;n++)i[n-1]=arguments[n];o.apply(this,i)}return!0}if(o){for(var t=arguments.length,i=Array(t-1),n=1;t>n;n++)i[n-1]=arguments[n];for(var u=o.slice(),n=0,t=u.length;t>n;n++)this.event=e,u[n].apply(this,i);return!0}},n.prototype.on=function(e,i){if(this._events||r.call(this),this.emit("newListener",e,i),this.wildcard)return o.call(this,e,i),this;if(this._events[e]){if("function"==typeof this._events[e])this._events[e]=[this._events[e],i];else if(l(this._events[e])&&(this._events[e].push(i),!this._events[e].warned)){var n;n=this._events.maxListeners!==t?this._events.maxListeners:u,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}}else this._events[e]=i;return this},n.prototype.onAny=function(e){if(this._all||(this._all=[]),"function"!=typeof e)throw Error("onAny only accepts instances of Function");return this._all.push(e),this},n.prototype.addListener=n.prototype.on,n.prototype.off=function(e,r){if("function"!=typeof r)throw Error("removeListener only takes instances of Function");var i;if(this.wildcard){var n="string"==typeof e?e.split(this.delimiter):e.slice(),o=s.call(this,null,n,this.listenerTree,0);if(o===t)return this;i=o._listeners}else{if(!this._events[e])return this;i=this._events[e]}if(l(i)){for(var u=-1,a=0,h=i.length;h>a;a++)if(i[a]===r||i[a].listener&&i[a].listener===r||i[a]._origin&&i[a]._origin===r){u=a;break}if(0>u)return this;this.wildcard?o._listeners.splice(u,1):this._events[e].splice(u,1),0===i.length&&(this.wildcard?delete o._listeners:delete this._events[e])}else(i===r||i.listener&&i.listener===r||i._origin&&i._origin===r)&&(this.wildcard?delete o._listeners:delete this._events[e]);return this},n.prototype.offAny=function(e){var t,r=0,i=0;if(e&&this._all&&this._all.length>0){for(t=this._all,r=0,i=t.length;i>r;r++)if(e===t[r])return t.splice(r,1),this}else this._all=[];return this},n.prototype.removeListener=n.prototype.off,n.prototype.removeAllListeners=function(e){if(0===arguments.length)return!this._events||r.call(this),this;if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice(),n=s.call(this,null,i,this.listenerTree,0);if(n===t)return this;n._listeners=null}else{if(!this._events[e])return this;this._events[e]=null}return this},n.prototype.listeners=function(e){if(this.wildcard){var t=[],i="string"==typeof e?e.split(this.delimiter):e.slice();return s.call(this,t,i,this.listenerTree,0),t}return this._events||r.call(this),this._events[e]||(this._events[e]=[]),l(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},n.prototype.listenersAny=function(){return this._all?this._all:[]},e.EventEmitter2=n}(r===void 0?window:r)});
3require.define("socketstream",function(e,t,r){"use strict";var n,i,s,o,l;n=e("eventemitter2").EventEmitter2,o=r.server=new n,s=r.message=new n,r.tmpl={},l=null,r.assignTransport=function(t){return l=e("socketstream-transport")(o,s,t),l.send=l.connect(),l.send},r.registerApi=function(e,t){var n;return n=r[e],n?console.error("SocketStream Error: Unable to register the 'ss."+e+"' responder as this name has already been taken"):(r[e]=t,r[e])},r.send=function(e){return function(t){return l.send(e+"|"+t)}},i={loaded:{},loading:new n},r.load={code:function(e,t){var r,n,s;return e&&"/"===e.substr(0,1)&&(e=e.substr(1)),r="SocketStream Error: The ss.load.code() command ",jQuery?e?t?i.loaded[e]?t():(i.loading.once(e,t),1===i.loading.listeners(e).length?(n=function(){return console.error("SocketStream Error: Could not asynchronously load "+e),console.log(arguments)},s=function(){return i.loaded[e]=!0,i.loading.emit(e)},$.ajax({url:"/_serve/code?"+e,type:"GET",cache:!1,dataType:"script",success:s,error:n})):void 0):console.error(r+"requires a callback. Specify it as the last argument"):console.error(r+"requires a directory to load. Specify it as the first argument. "+"E.g. The ss.load.code('/mail',cb) will load code in /client/code/mail"):console.error(r+"requires jQuery to be present")},worker:function(e){return new Worker("/_serve/worker?"+e)}},o.on("__ss:reload",function(){return window.location.reload()}),o.on("__ss:updateCSS",function(){var e,t,r,n,i;for(i=document.getElementsByTagName("link"),r=0,n=i.length;n>r;r++)t=i[r],t.rel.toLowerCase().indexOf("stylesheet")>=0&&t.href&&(e=t.href.replace(/(&|%5C?)\d+/,""),t.href=e+(e.indexOf("?")>=0?"&":"?")+(new Date).valueOf());return console.log("CSS updated")})});
4require.define("/abc/index",function(){});

Callers 3

expected.min.jsFile · 0.70
rFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected