New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cycle/time

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cycle/time - npm Package Compare versions

Comparing version 0.6.1 to 0.7.0

dist/tween.d.ts

12

dist/mock-time-source.js

@@ -20,5 +20,3 @@ "use strict";

var pendingAsserts = asserts.filter(function (assert) { return assert.state === 'pending'; });
if (pendingAsserts.length > 0) {
pendingAsserts.forEach(function (assert) { return assert.finish(); });
}
pendingAsserts.forEach(function (assert) { return assert.finish(); });
var failedAsserts = asserts.filter(function (assert) { return assert.state === 'failed'; });

@@ -32,3 +30,9 @@ var success = failedAsserts.length === 0;

var error = combineErrors(errors);
done(error);
var usingJasmine = 'fail' in done;
if (usingJasmine) {
done.fail(error);
}
else {
done(error);
}
}

@@ -35,0 +39,0 @@ }

"use strict";
require('setimmediate');
function processEvent(args) {
var scheduler = args.scheduler, done = args.done, currentTime = args.currentTime, setTime = args.setTime, timeToRunTo = args.timeToRunTo;
var nextEvent = scheduler.peek();
var outOfTime = nextEvent && timeToRunTo && nextEvent.time >= timeToRunTo;
if (!nextEvent || outOfTime) {
done();
return;
}
var eventToProcess = scheduler.shiftNextEntry();
if (eventToProcess.cancelled) {
setImmediate(processEvent, args);
return;
}
var time = eventToProcess.time;
setTime(time);
if (eventToProcess.f) {
eventToProcess.f(eventToProcess, time, scheduler.add, currentTime);
}
if (eventToProcess.type === 'next') {
eventToProcess.stream.shamefullySendNext(eventToProcess.value);
}
if (eventToProcess.type === 'error') {
eventToProcess.stream.shamefullySendError(eventToProcess.error);
}
if (eventToProcess.type === 'complete') {
eventToProcess.stream.shamefullySendComplete();
}
setImmediate(processEvent, args);
}
function runVirtually(scheduler, done, currentTime, setTime, timeToRunTo) {
if (timeToRunTo === void 0) { timeToRunTo = null; }
function processEvent() {
var nextEvent = scheduler.peek();
if (!nextEvent) {
done();
return;
}
var outOfTime = timeToRunTo && nextEvent.time >= timeToRunTo;
if (outOfTime) {
done();
return;
}
var eventToProcess = scheduler.shiftNextEntry();
if (eventToProcess.cancelled) {
setImmediate(processEvent);
return;
}
var time = eventToProcess.time;
setTime(time);
if (eventToProcess.f) {
eventToProcess.f(eventToProcess, time, scheduler.add, currentTime);
}
if (eventToProcess.type === 'next') {
eventToProcess.stream.shamefullySendNext(eventToProcess.value);
}
if (eventToProcess.type === 'error') {
eventToProcess.stream.shamefullySendError(eventToProcess.error);
}
if (eventToProcess.type === 'complete') {
eventToProcess.stream.shamefullySendComplete();
}
setImmediate(processEvent);
}
setImmediate(processEvent);
var args = { scheduler: scheduler, done: done, currentTime: currentTime, setTime: setTime, timeToRunTo: timeToRunTo };
setImmediate(processEvent, args);
}
exports.runVirtually = runVirtually;
{
"name": "@cycle/time",
"version": "0.6.1",
"version": "0.7.0",
"description": "A time driver designed to enable awesome testing and dev tooling",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc