Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/node-red/node_modules/nise/lib/fake-server/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
var FakeTimers = require("@sinonjs/fake-timers");
var fakeServer = require("./index");
// eslint-disable-next-line no-empty-function
function Server() {}
Server.prototype = fakeServer;
var fakeServerWithClock = new Server();
fakeServerWithClock.addRequest = function addRequest(xhr) {
if (xhr.async) {
if (typeof setTimeout.clock === "object") {
this.clock = setTimeout.clock;
} else {
this.clock = FakeTimers.install();
this.resetClock = true;
}
if (!this.longestTimeout) {
var clockSetTimeout = this.clock.setTimeout;
var clockSetInterval = this.clock.setInterval;
var server = this;
this.clock.setTimeout = function(fn, timeout) {
server.longestTimeout = Math.max(
timeout,
server.longestTimeout || 0
);
return clockSetTimeout.apply(this, arguments);
};
this.clock.setInterval = function(fn, timeout) {
server.longestTimeout = Math.max(
timeout,
server.longestTimeout || 0
);
return clockSetInterval.apply(this, arguments);
};
}
}
return fakeServer.addRequest.call(this, xhr);
};
fakeServerWithClock.respond = function respond() {
var returnVal = fakeServer.respond.apply(this, arguments);
if (this.clock) {
this.clock.tick(this.longestTimeout || 0);
this.longestTimeout = 0;
if (this.resetClock) {
this.clock.uninstall();
this.resetClock = false;
}
}
return returnVal;
};
fakeServerWithClock.restore = function restore() {
if (this.clock) {
this.clock.uninstall();
}
return fakeServer.restore.apply(this, arguments);
};
module.exports = fakeServerWithClock;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.1027 ]-- |