Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scheduler

Package Overview
Dependencies
Maintainers
4
Versions
1996
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scheduler - npm Package Compare versions

Comparing version 0.24.0-canary-1d5667a12-20240102 to 0.24.0-canary-1dba980e1f-20241220

20

cjs/scheduler-unstable_mock.production.min.js

@@ -1,10 +0,10 @@

/*
React
scheduler-unstable_mock.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* scheduler-unstable_mock.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,z=e>>>1;d<z;){var u=2*(d+1)-1,A=a[u],v=u+1,F=a[v];if(0>g(A,c))v<e&&0>g(F,A)?(a[d]=F,a[v]=c,d=v):(a[d]=A,a[u]=c,d=u);else if(v<e&&0>g(F,c))a[d]=F,a[v]=c,d=v;else break a}}return b}

@@ -21,3 +21,1 @@ function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var l=[],m=[],n=1,p=null,q=3,r=!1,t=!1,w=!1,x=0,y=null,B=null,C=-1,D=null,E=-1,G=!1,H=!1,I=!1,J=!1,K=!1;function L(a){for(var b=h(m);null!==b;){if(null===b.callback)k(m);else if(b.startTime<=a)k(m),b.sortIndex=b.expirationTime,f(l,b);else break;b=h(m)}}function M(a){w=!1;L(a);if(!t)if(null!==h(l))t=!0,y=N;else{var b=h(m);null!==b&&(a=b.startTime-a,B=M,C=x+a)}}

exports.unstable_setDisableYieldValue=function(a){K=a};exports.unstable_shouldYield=O;exports.unstable_wrapCallback=function(a){var b=q;return function(){var c=q;q=b;try{return a.apply(this,arguments)}finally{q=c}}};
//# sourceMappingURL=scheduler-unstable_mock.production.min.js.map

@@ -92,5 +92,11 @@ /**

var continuation = result;
var continuationController = new TaskController({
priority: postTaskPriority
});
var continuationOptions = {
signal: node._controller.signal
};
signal: continuationController.signal
}; // Update the original callback node's controller, since even though we're
// posting a new task, conceptually it's the same one.
node._controller = continuationController;
var nextTask = runTask.bind(null, priorityLevel, postTaskPriority, node, continuation);

@@ -97,0 +103,0 @@

@@ -1,16 +0,14 @@

/*
React
scheduler-unstable_post_task.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
'use strict';var a=window.performance,g=window.setTimeout,h=global.scheduler,k=a.now.bind(a),l=0,m=3;function n(c,d,b,f){l=k()+5;try{m=c;var e=f(!1);if("function"===typeof e){var p={signal:b._controller.signal},q=n.bind(null,c,d,b,e);void 0!==h.yield?h.yield(p).then(q).catch(r):h.postTask(q,p).catch(r)}}catch(t){g(function(){throw t;})}finally{m=3}}function r(){}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;
exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(c){c._controller.abort()};exports.unstable_continueExecution=function(){};exports.unstable_forceFrameRate=function(){};exports.unstable_getCurrentPriorityLevel=function(){return m};exports.unstable_getFirstCallbackNode=function(){return null};exports.unstable_next=function(c){switch(m){case 1:case 2:case 3:var d=3;break;default:d=m}var b=m;m=d;try{return c()}finally{m=b}};
exports.unstable_now=k;exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(c,d){var b=m;m=c;try{return d()}finally{m=b}};
exports.unstable_scheduleCallback=function(c,d,b){switch(c){case 1:case 2:var f="user-blocking";break;case 4:case 3:f="user-visible";break;case 5:f="background";break;default:f="user-visible"}var e=new TaskController({priority:f});b={delay:"object"===typeof b&&null!==b?b.delay:0,signal:e.signal};e={_controller:e};h.postTask(n.bind(null,c,f,e,d),b).catch(r);return e};exports.unstable_shouldYield=function(){return k()>=l};
/**
* @license React
* scheduler-unstable_post_task.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var a=window.performance,g=window.setTimeout,h=global.scheduler,k=a.now.bind(a),l=0,m=3;function n(c,d,b,f){l=k()+5;try{m=c;var e=f(!1);if("function"===typeof e){var p=new TaskController({priority:d}),q={signal:p.signal};b._controller=p;var r=n.bind(null,c,d,b,e);void 0!==h.yield?h.yield(q).then(r).catch(t):h.postTask(r,q).catch(t)}}catch(u){g(function(){throw u;})}finally{m=3}}function t(){}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;
exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(c){c._controller.abort()};exports.unstable_continueExecution=function(){};exports.unstable_forceFrameRate=function(){};exports.unstable_getCurrentPriorityLevel=function(){return m};exports.unstable_getFirstCallbackNode=function(){return null};
exports.unstable_next=function(c){switch(m){case 1:case 2:case 3:var d=3;break;default:d=m}var b=m;m=d;try{return c()}finally{m=b}};exports.unstable_now=k;exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(c,d){var b=m;m=c;try{return d()}finally{m=b}};
exports.unstable_scheduleCallback=function(c,d,b){switch(c){case 1:case 2:var f="user-blocking";break;case 4:case 3:f="user-visible";break;case 5:f="background";break;default:f="user-visible"}var e=new TaskController({priority:f});b={delay:"object"===typeof b&&null!==b?b.delay:0,signal:e.signal};e={_controller:e};h.postTask(n.bind(null,c,f,e,d),b).catch(t);return e};exports.unstable_shouldYield=function(){return k()>=l};
exports.unstable_wrapCallback=function(c){var d=m;return function(){var b=m;m=d;try{return c()}finally{m=b}}};
//# sourceMappingURL=scheduler-unstable_post_task.production.min.js.map

@@ -29,5 +29,2 @@ /**

var frameYieldMs = 5;
var userBlockingPriorityTimeout = 250;
var normalPriorityTimeout = 5000;
var lowPriorityTimeout = 10000;

@@ -148,4 +145,12 @@ function push(heap, node) {

var maxSigned31BitInt = 1073741823; // Tasks are stored on a min heap
var maxSigned31BitInt = 1073741823; // Times out immediately
var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
var NORMAL_PRIORITY_TIMEOUT = 5000;
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
var taskQueue = [];

@@ -385,19 +390,15 @@ var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.

case ImmediatePriority:
// Times out immediately
timeout = -1;
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
break;
case UserBlockingPriority:
// Eventually times out
timeout = userBlockingPriorityTimeout;
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
break;
case IdlePriority:
// Never times out
timeout = maxSigned31BitInt;
timeout = IDLE_PRIORITY_TIMEOUT;
break;
case LowPriority:
// Eventually times out
timeout = lowPriorityTimeout;
timeout = LOW_PRIORITY_TIMEOUT;
break;

@@ -407,4 +408,3 @@

default:
// Eventually times out
timeout = normalPriorityTimeout;
timeout = NORMAL_PRIORITY_TIMEOUT;
break;

@@ -411,0 +411,0 @@ }

@@ -20,5 +20,2 @@ /**

var frameYieldMs = 5;
var userBlockingPriorityTimeout = 250;
var normalPriorityTimeout = 5000;
var lowPriorityTimeout = 10000;

@@ -139,4 +136,12 @@ function push(heap, node) {

var maxSigned31BitInt = 1073741823; // Tasks are stored on a min heap
var maxSigned31BitInt = 1073741823; // Times out immediately
var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
var NORMAL_PRIORITY_TIMEOUT = 5000;
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
var taskQueue = [];

@@ -309,19 +314,15 @@ var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.

case ImmediatePriority:
// Times out immediately
timeout = -1;
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
break;
case UserBlockingPriority:
// Eventually times out
timeout = userBlockingPriorityTimeout;
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
break;
case IdlePriority:
// Never times out
timeout = maxSigned31BitInt;
timeout = IDLE_PRIORITY_TIMEOUT;
break;
case LowPriority:
// Eventually times out
timeout = lowPriorityTimeout;
timeout = LOW_PRIORITY_TIMEOUT;
break;

@@ -331,4 +332,3 @@

default:
// Eventually times out
timeout = normalPriorityTimeout;
timeout = NORMAL_PRIORITY_TIMEOUT;
break;

@@ -335,0 +335,0 @@ }

@@ -1,10 +0,10 @@

/*
React
scheduler.native.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* scheduler.native.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';function f(a,c){var b=a.length;a.push(c);a:for(;0<b;){var d=b-1>>>1,e=a[d];if(0<g(e,c))a[d]=c,a[b]=e,b=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var c=a[0],b=a.pop();if(b!==c){a[0]=b;a:for(var d=0,e=a.length,x=e>>>1;d<x;){var y=2*(d+1)-1,D=a[y],m=y+1,z=a[m];if(0>g(D,b))m<e&&0>g(z,D)?(a[d]=z,a[m]=b,d=m):(a[d]=D,a[y]=b,d=y);else if(m<e&&0>g(z,b))a[d]=z,a[m]=b,d=m;else break a}}return c}

@@ -21,3 +21,1 @@ function g(a,c){var b=a.sortIndex-c.sortIndex;return 0!==b?b:a.id-c.id}var l;if("object"===typeof performance&&"function"===typeof performance.now){var n=performance;l=function(){return n.now()}}else{var p=Date,q=p.now();l=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,w=3,A=!1,B=!1,C=!1,E="function"===typeof setTimeout?setTimeout:null,F="function"===typeof clearTimeout?clearTimeout:null,G="undefined"!==typeof setImmediate?setImmediate:null;

exports.unstable_getFirstCallbackNode=Z;exports.unstable_next=Z;exports.unstable_now=ha;exports.unstable_pauseExecution=Z;exports.unstable_requestPaint=fa;exports.unstable_runWithPriority=Z;exports.unstable_scheduleCallback=ba;exports.unstable_shouldYield=ea;exports.unstable_wrapCallback=Z;
//# sourceMappingURL=scheduler.native.production.min.js.map

@@ -1,10 +0,10 @@

/*
React
scheduler.production.min.js
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';function f(a,c){var b=a.length;a.push(c);a:for(;0<b;){var d=b-1>>>1,e=a[d];if(0<g(e,c))a[d]=c,a[b]=e,b=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var c=a[0],b=a.pop();if(b!==c){a[0]=b;a:for(var d=0,e=a.length,v=e>>>1;d<v;){var w=2*(d+1)-1,C=a[w],m=w+1,x=a[m];if(0>g(C,b))m<e&&0>g(x,C)?(a[d]=x,a[m]=b,d=m):(a[d]=C,a[w]=b,d=w);else if(m<e&&0>g(x,b))a[d]=x,a[m]=b,d=m;else break a}}return c}

@@ -20,3 +20,1 @@ function g(a,c){var b=a.sortIndex-c.sortIndex;return 0!==b?b:a.id-c.id}exports.unstable_now=void 0;if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var n=Date,p=n.now();exports.unstable_now=function(){return n.now()-p}}

exports.unstable_shouldYield=O;exports.unstable_wrapCallback=function(a){var c=y;return function(){var b=y;y=c;try{return a.apply(this,arguments)}finally{y=b}}};
//# sourceMappingURL=scheduler.production.min.js.map
{
"name": "scheduler",
"version": "0.24.0-canary-1d5667a12-20240102",
"version": "0.24.0-canary-1dba980e1f-20241220",
"description": "Cooperative scheduler for the browser environment.",

@@ -5,0 +5,0 @@ "repository": {

@@ -10,3 +10,2 @@ /**

*/
(function (global, factory) {

@@ -13,0 +12,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

@@ -10,7 +10,6 @@ /**

*/
'use strict';(function(){(function(d,v){"object"===typeof exports&&"undefined"!==typeof module?v(exports):"function"===typeof define&&define.amd?define(["exports"],v):(d="undefined"!==typeof globalThis?globalThis:d||self,v(d.SchedulerMock={}))})(this,function(d){function v(a,b){var c=a.length;a.push(b);a:for(;0<c;){var e=c-1>>>1,f=a[e];if(0<F(f,b))a[e]=b,a[c]=f,c=e;else break a}}function p(a){return 0===a.length?null:a[0]}function G(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=
c;a:for(var e=0,f=a.length,B=f>>>1;e<B;){var w=2*(e+1)-1,C=a[w],x=w+1,H=a[x];if(0>F(C,c))x<f&&0>F(H,C)?(a[e]=H,a[x]=c,e=x):(a[e]=C,a[w]=c,e=w);else if(x<f&&0>F(H,c))a[e]=H,a[x]=c,e=x;else break a}}return b}function F(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function I(a){for(var b=p(t);null!==b;){if(null===b.callback)G(t);else if(b.startTime<=a)G(t),b.sortIndex=b.expirationTime,v(q,b);else break;b=p(t)}}function L(a){D=!1;I(a);if(!y)if(null!==p(q))y=!0,g=M;else{var b=p(t);null!==
b&&(a=b.startTime-a,r=L,u=k+a)}}function M(a,b){y=!1;D&&(D=!1,r=null,u=-1);J=!0;var c=h;try{a:{I(b);for(m=p(q);null!==m&&(!(m.expirationTime>b)||a&&!O());){var e=m.callback;if("function"===typeof e){m.callback=null;h=m.priorityLevel;var f=e(m.expirationTime<=b);b=k;if("function"===typeof f){if(m.callback=f,I(b),K){var B=E=!0;break a}}else m===p(q)&&G(q),I(b)}else G(q);m=p(q)}if(null!==m)B=!0;else{var w=p(t);if(null!==w){var C=w.startTime-b;r=L;u=k+C}B=!1}}return B}finally{m=null,h=c,J=!1}}function O(){return 0===
z&&null===n||-1!==z&&null!==n&&n.length>=z||K&&E?A=!0:!1}function P(){if(l)throw Error("Already flushing work.");if(null!==g){var a=g;l=!0;try{var b=!0;do b=a(!0,k);while(b);b||(g=null);return!0}finally{l=!1}}else return!1}var q=[],t=[],Q=1,m=null,h=3,J=!1,y=!1,D=!1,k=0,g=null,r=null,u=-1,n=null,z=-1,A=!1,l=!1,E=!1,K=!1,N=!1;d.log=function(a){"disabledLog"===console.log.name||N||(null===n?n=[a]:n.push(a))};d.reset=function(){if(l)throw Error("Cannot reset while already flushing work.");k=0;r=g=null;
(function(){'use strict';(function(d,v){"object"===typeof exports&&"undefined"!==typeof module?v(exports):"function"===typeof define&&define.amd?define(["exports"],v):(d="undefined"!==typeof globalThis?globalThis:d||self,v(d.SchedulerMock={}))})(this,function(d){function v(a,b){var c=a.length;a.push(b);a:for(;0<c;){var e=c-1>>>1,f=a[e];if(0<F(f,b))a[e]=b,a[c]=f,c=e;else break a}}function p(a){return 0===a.length?null:a[0]}function G(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var e=
0,f=a.length,B=f>>>1;e<B;){var w=2*(e+1)-1,C=a[w],x=w+1,H=a[x];if(0>F(C,c))x<f&&0>F(H,C)?(a[e]=H,a[x]=c,e=x):(a[e]=C,a[w]=c,e=w);else if(x<f&&0>F(H,c))a[e]=H,a[x]=c,e=x;else break a}}return b}function F(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function I(a){for(var b=p(t);null!==b;){if(null===b.callback)G(t);else if(b.startTime<=a)G(t),b.sortIndex=b.expirationTime,v(q,b);else break;b=p(t)}}function L(a){D=!1;I(a);if(!y)if(null!==p(q))y=!0,g=M;else{var b=p(t);null!==b&&(a=b.startTime-
a,r=L,u=k+a)}}function M(a,b){y=!1;D&&(D=!1,r=null,u=-1);J=!0;var c=h;try{a:{I(b);for(m=p(q);null!==m&&(!(m.expirationTime>b)||a&&!O());){var e=m.callback;if("function"===typeof e){m.callback=null;h=m.priorityLevel;var f=e(m.expirationTime<=b);b=k;if("function"===typeof f){if(m.callback=f,I(b),K){var B=E=!0;break a}}else m===p(q)&&G(q),I(b)}else G(q);m=p(q)}if(null!==m)B=!0;else{var w=p(t);if(null!==w){var C=w.startTime-b;r=L;u=k+C}B=!1}}return B}finally{m=null,h=c,J=!1}}function O(){return 0===z&&
null===n||-1!==z&&null!==n&&n.length>=z||K&&E?A=!0:!1}function P(){if(l)throw Error("Already flushing work.");if(null!==g){var a=g;l=!0;try{var b=!0;do b=a(!0,k);while(b);b||(g=null);return!0}finally{l=!1}}else return!1}var q=[],t=[],Q=1,m=null,h=3,J=!1,y=!1,D=!1,k=0,g=null,r=null,u=-1,n=null,z=-1,A=!1,l=!1,E=!1,K=!1,N=!1;d.log=function(a){"disabledLog"===console.log.name||N||(null===n?n=[a]:n.push(a))};d.reset=function(){if(l)throw Error("Cannot reset while already flushing work.");k=0;r=g=null;
u=-1;n=null;z=-1;E=l=A=!1};d.unstable_IdlePriority=5;d.unstable_ImmediatePriority=1;d.unstable_LowPriority=4;d.unstable_NormalPriority=3;d.unstable_Profiling=null;d.unstable_UserBlockingPriority=2;d.unstable_advanceTime=function(a){"disabledLog"===console.log.name||N||(k+=a,null!==r&&u<=k&&(r(k),u=-1,r=null))};d.unstable_cancelCallback=function(a){a.callback=null};d.unstable_clearLog=function(){if(null===n)return[];var a=n;n=null;return a};d.unstable_continueExecution=function(){y||J||(y=!0,g=M)};

@@ -21,2 +20,3 @@ d.unstable_flushAll=function(){if(null!==n)throw Error("Log is not empty. Assert on the log of yielded values before flushing additional work.");P();if(null!==n)throw Error("While flushing work, something yielded a value. Use an assertion helper to assert on the log of yielded values, e.g. expect(Scheduler).toFlushAndYield([...])");};d.unstable_flushAllWithoutAsserting=P;d.unstable_flushExpired=function(){if(l)throw Error("Already flushing work.");if(null!==g){l=!0;try{g(!1,k)||(g=null)}finally{l=

b,c){var e=k;"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?e+c:e):c=e;switch(a){case 1:var f=-1;break;case 2:f=250;break;case 5:f=1073741823;break;case 4:f=1E4;break;default:f=5E3}f=c+f;a={id:Q++,callback:b,priorityLevel:a,startTime:c,expirationTime:f,sortIndex:-1};c>e?(a.sortIndex=c,v(t,a),null===p(q)&&a===p(t)&&(D?(r=null,u=-1):D=!0,r=L,u=k+(c-e))):(a.sortIndex=f,v(q,a),y||J||(y=!0,g=M));return a};d.unstable_setDisableYieldValue=function(a){N=a};d.unstable_shouldYield=O;d.unstable_wrapCallback=
function(a){var b=h;return function(){var c=h;h=b;try{return a.apply(this,arguments)}finally{h=c}}}})})();
function(a){var b=h;return function(){var c=h;h=b;try{return a.apply(this,arguments)}finally{h=c}}}});
})();
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