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

@most/scheduler

Package Overview
Dependencies
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@most/scheduler - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

125

dist/index.es.js
/** @license MIT License (c) copyright 2010-2016 original author or authors */
// Non-mutating array operations
// Non-mutating array operations
// cons :: a -> [a] -> [a]
// a with x prepended
// cons :: a -> [a] -> [a]
// a with x prepended
// removeAll :: (a -> boolean) -> [a] -> [a]
// remove all elements matching a predicate
function removeAll (f, a) {
var l = a.length;
var b = new Array(l);
var j = 0;
for (var x, i = 0; i < l; ++i) {
x = a[i];
if (!f(x)) {
b[j] = x;
++j;
}
}
// append :: a -> [a] -> [a]
// a with x appended
// drop :: Int -> [a] -> [a]
// drop first n elements
// tail :: [a] -> [a]
// drop head element
// copy :: [a] -> [a]
// duplicate a (shallow duplication)
// map :: (a -> b) -> [a] -> [b]
// transform each element with f
// reduce :: (a -> b -> a) -> a -> [b] -> a
// accumulate via left-fold
// replace :: a -> Int -> [a]
// replace element at index
// remove :: Int -> [a] -> [a]
// remove element at index
// removeAll :: (a -> boolean) -> [a] -> [a]
// remove all elements matching a predicate
function removeAll (f, a) {
var l = a.length;
var b = new Array(l);
var j = 0;
for (var x = (void 0), i = 0; i < l; ++i) {
x = a[i];
if (!f(x)) {
b[j] = x;
++j;
}
b.length = j;
return b
}
b.length = j;
return b
}
// findIndex :: a -> [a] -> Int
// find index of x in a, from the left
function findIndex (x, a) {
for (var i = 0, l = a.length; i < l; ++i) {
if (x === a[i]) {
return i
// findIndex :: a -> [a] -> Int
// find index of x in a, from the left
function findIndex (x, a) {
for (var i = 0, l = a.length; i < l; ++i) {
if (x === a[i]) {
return i
}
}
return -1
}
return -1
}
// isArrayLike :: * -> boolean
// Return true iff x is array-like
/** @license MIT License (c) copyright 2010-2016 original author or authors */
// id :: a -> a
// compose :: (b -> c) -> (a -> b) -> (a -> c)
// apply :: (a -> b) -> a -> b
// curry2 :: ((a, b) -> c) -> (a -> b -> c)
function curry2 (f) {
function curried (a, b) {
switch (arguments.length) {
case 0: return curried
case 1: return function (b) { return f(a, b); }
default: return f(a, b)
// curry2 :: ((a, b) -> c) -> (a -> b -> c)
function curry2 (f) {
function curried (a, b) {
switch (arguments.length) {
case 0: return curried
case 1: return function (b) { return f(a, b); }
default: return f(a, b)
}
}
return curried
}
return curried
}
// curry3 :: ((a, b, c) -> d) -> (a -> b -> c -> d)
// curry4 :: ((a, b, c, d) -> e) -> (a -> b -> c -> d -> e)
/** @license MIT License (c) copyright 2016 original author or authors */
/** @license MIT License (c) copyright 2010-2017 original author or authors */

@@ -104,0 +49,0 @@

@@ -9,102 +9,47 @@ (function (global, factory) {

// Non-mutating array operations
// Non-mutating array operations
// cons :: a -> [a] -> [a]
// a with x prepended
// cons :: a -> [a] -> [a]
// a with x prepended
// removeAll :: (a -> boolean) -> [a] -> [a]
// remove all elements matching a predicate
function removeAll (f, a) {
var l = a.length;
var b = new Array(l);
var j = 0;
for (var x, i = 0; i < l; ++i) {
x = a[i];
if (!f(x)) {
b[j] = x;
++j;
}
}
// append :: a -> [a] -> [a]
// a with x appended
// drop :: Int -> [a] -> [a]
// drop first n elements
// tail :: [a] -> [a]
// drop head element
// copy :: [a] -> [a]
// duplicate a (shallow duplication)
// map :: (a -> b) -> [a] -> [b]
// transform each element with f
// reduce :: (a -> b -> a) -> a -> [b] -> a
// accumulate via left-fold
// replace :: a -> Int -> [a]
// replace element at index
// remove :: Int -> [a] -> [a]
// remove element at index
// removeAll :: (a -> boolean) -> [a] -> [a]
// remove all elements matching a predicate
function removeAll (f, a) {
var l = a.length;
var b = new Array(l);
var j = 0;
for (var x = (void 0), i = 0; i < l; ++i) {
x = a[i];
if (!f(x)) {
b[j] = x;
++j;
}
b.length = j;
return b
}
b.length = j;
return b
}
// findIndex :: a -> [a] -> Int
// find index of x in a, from the left
function findIndex (x, a) {
for (var i = 0, l = a.length; i < l; ++i) {
if (x === a[i]) {
return i
// findIndex :: a -> [a] -> Int
// find index of x in a, from the left
function findIndex (x, a) {
for (var i = 0, l = a.length; i < l; ++i) {
if (x === a[i]) {
return i
}
}
return -1
}
return -1
}
// isArrayLike :: * -> boolean
// Return true iff x is array-like
/** @license MIT License (c) copyright 2010-2016 original author or authors */
// id :: a -> a
// compose :: (b -> c) -> (a -> b) -> (a -> c)
// apply :: (a -> b) -> a -> b
// curry2 :: ((a, b) -> c) -> (a -> b -> c)
function curry2 (f) {
function curried (a, b) {
switch (arguments.length) {
case 0: return curried
case 1: return function (b) { return f(a, b); }
default: return f(a, b)
// curry2 :: ((a, b) -> c) -> (a -> b -> c)
function curry2 (f) {
function curried (a, b) {
switch (arguments.length) {
case 0: return curried
case 1: return function (b) { return f(a, b); }
default: return f(a, b)
}
}
return curried
}
return curried
}
// curry3 :: ((a, b, c) -> d) -> (a -> b -> c -> d)
// curry4 :: ((a, b, c, d) -> e) -> (a -> b -> c -> d -> e)
/** @license MIT License (c) copyright 2016 original author or authors */
/** @license MIT License (c) copyright 2010-2017 original author or authors */

@@ -111,0 +56,0 @@

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

(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define(["exports"],e):e(t.mostCore=t.mostCore||{})})(this,function(t){"use strict";function e(t,e){var i=e.length;var r=new Array(i);var n=0;for(var s=void 0,o=0;o<i;++o){s=e[o];if(!t(s)){r[n]=s;++n}}r.length=n;return r}function i(t,e){for(var i=0,r=e.length;i<r;++i){if(t===e[i]){return i}}return-1}function r(t){function e(i,r){switch(arguments.length){case 0:return e;case 1:return function(e){return t(i,e)};default:return t(i,r)}}return e}function n(t,e,i,r){this.time=t;this.period=e;this.task=i;this.scheduler=r;this.active=true}n.prototype.run=function(){return this.task.run(this.time)};n.prototype.error=function(t){return this.task.error(this.time,t)};n.prototype.dispose=function(){this.scheduler.cancel(this);return this.task.dispose()};var s=function(t){return Promise.resolve(t).then(o)};function o(t){try{return t.run()}catch(e){return t.error(e)}}var u=function t(e,i){var r=this;this.timer=e;this.timeline=i;this._timer=null;this._nextArrival=Infinity;this._runReadyTasksBound=function(){return r._runReadyTasks(r.now())}};u.prototype.now=function t(){return this.timer.now()};u.prototype.asap=function t(e){return this.schedule(0,-1,e)};u.prototype.delay=function t(e,i){return this.schedule(e,-1,i)};u.prototype.periodic=function t(e,i){return this.schedule(0,e,i)};u.prototype.schedule=function t(e,i,r){var s=this.now();var o=new n(s+Math.max(0,e),i,r,this);this.timeline.add(o);this._scheduleNextRun(s);return o};u.prototype.cancel=function t(e){e.active=false;if(this.timeline.remove(e)){this._reschedule()}};u.prototype.cancelAll=function t(e){this.timeline.removeAll(e);this._reschedule()};u.prototype._reschedule=function t(){if(this.timeline.isEmpty()){this._unschedule()}else{this._scheduleNextRun(this.now())}};u.prototype._unschedule=function t(){this.timer.clearTimer(this._timer);this._timer=null};u.prototype._scheduleNextRun=function t(e){if(this.timeline.isEmpty()){return}var i=this.timeline.nextArrival();if(this._timer===null){this._scheduleNextArrival(i,e)}else if(i<this._nextArrival){this._unschedule();this._scheduleNextArrival(i,e)}};u.prototype._scheduleNextArrival=function t(e,i){this._nextArrival=e;var r=Math.max(0,e-i);this._timer=this.timer.setTimer(this._runReadyTasksBound,r)};u.prototype._runReadyTasks=function t(e){this._timer=null;this.timeline.runTasks(e,o);this._scheduleNextRun(this.now())};var h=function t(){this.tasks=[]};h.prototype.nextArrival=function t(){return this.isEmpty()?Infinity:this.tasks[0].time};h.prototype.isEmpty=function t(){return this.tasks.length===0};h.prototype.add=function t(e){c(e,this.tasks)};h.prototype.remove=function t(e){var r=f(e.time,this.tasks);if(r>=0&&r<this.tasks.length){var n=i(e,this.tasks[r].events);if(n>=0){this.tasks[r].events.splice(n,1);return true}}return false};h.prototype.removeAll=function t(e){var i=this;for(var r=0;r<this.tasks.length;++r){l(e,i.tasks[r])}};h.prototype.runTasks=function t(e,i){var r=this;var n=this.tasks;var s=n.length;var o=0;while(o<s&&n[o].time<=e){++o}this.tasks=n.slice(o);for(var u=0;u<o;++u){r.tasks=a(i,n[u].events,r.tasks)}};function a(t,e,i){for(var r=0;r<e.length;++r){var n=e[r];if(n.active){t(n);if(n.period>=0&&n.active){n.time=n.time+n.period;c(n,i)}}}return i}function c(t,e){var i=e.length;if(i===0){e.push(p(t.time,[t]));return}var r=f(t.time,e);if(r>=i){e.push(p(t.time,[t]))}else if(t.time===e[r].time){e[r].events.push(t)}else{e.splice(r,0,p(t.time,[t]))}}function l(t,i){i.events=e(t,i.events)}function f(t,e){var i=0;var r=e.length;var n,s;while(i<r){n=Math.floor((i+r)/2);s=e[n];if(t===s.time){return n}else if(t<s.time){r=n}else{i=n+1}}return r}var p=function(t,e){return{time:t,events:e}};var v=function t(){this.now=Date.now};v.prototype.setTimer=function t(e,i){return i<=0?d(e):setTimeout(e,i)};v.prototype.clearTimer=function t(e){return e instanceof m?e.cancel():clearTimeout(e)};var m=function t(e){this.f=e;this.active=true};m.prototype.run=function t(){return this.active&&this.f()};m.prototype.error=function t(e){throw e};m.prototype.cancel=function t(){this.active=false};function d(t){var e=new m(t);s(e);return e}var y=function(t,e){return new u(t,e)};var _=function(){return new h};var k=function(){return new v};var w=r(y);var x=function(){return y(k(),_())};t.newTimeline=_;t.newClockTimer=k;t.newScheduler=w;t.newDefaultScheduler=x;Object.defineProperty(t,"__esModule",{value:true})});
(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define(["exports"],e):e(t.mostCore=t.mostCore||{})})(this,function(t){"use strict";function e(t,e){var i=e.length;var r=new Array(i);var n=0;for(var s,o=0;o<i;++o){s=e[o];if(!t(s)){r[n]=s;++n}}r.length=n;return r}function i(t,e){for(var i=0,r=e.length;i<r;++i){if(t===e[i]){return i}}return-1}function r(t){function e(i,r){switch(arguments.length){case 0:return e;case 1:return function(e){return t(i,e)};default:return t(i,r)}}return e}function n(t,e,i,r){this.time=t;this.period=e;this.task=i;this.scheduler=r;this.active=true}n.prototype.run=function(){return this.task.run(this.time)};n.prototype.error=function(t){return this.task.error(this.time,t)};n.prototype.dispose=function(){this.scheduler.cancel(this);return this.task.dispose()};var s=function(t){return Promise.resolve(t).then(o)};function o(t){try{return t.run()}catch(e){return t.error(e)}}var u=function t(e,i){var r=this;this.timer=e;this.timeline=i;this._timer=null;this._nextArrival=Infinity;this._runReadyTasksBound=function(){return r._runReadyTasks(r.now())}};u.prototype.now=function t(){return this.timer.now()};u.prototype.asap=function t(e){return this.schedule(0,-1,e)};u.prototype.delay=function t(e,i){return this.schedule(e,-1,i)};u.prototype.periodic=function t(e,i){return this.schedule(0,e,i)};u.prototype.schedule=function t(e,i,r){var s=this.now();var o=new n(s+Math.max(0,e),i,r,this);this.timeline.add(o);this._scheduleNextRun(s);return o};u.prototype.cancel=function t(e){e.active=false;if(this.timeline.remove(e)){this._reschedule()}};u.prototype.cancelAll=function t(e){this.timeline.removeAll(e);this._reschedule()};u.prototype._reschedule=function t(){if(this.timeline.isEmpty()){this._unschedule()}else{this._scheduleNextRun(this.now())}};u.prototype._unschedule=function t(){this.timer.clearTimer(this._timer);this._timer=null};u.prototype._scheduleNextRun=function t(e){if(this.timeline.isEmpty()){return}var i=this.timeline.nextArrival();if(this._timer===null){this._scheduleNextArrival(i,e)}else if(i<this._nextArrival){this._unschedule();this._scheduleNextArrival(i,e)}};u.prototype._scheduleNextArrival=function t(e,i){this._nextArrival=e;var r=Math.max(0,e-i);this._timer=this.timer.setTimer(this._runReadyTasksBound,r)};u.prototype._runReadyTasks=function t(e){this._timer=null;this.timeline.runTasks(e,o);this._scheduleNextRun(this.now())};var h=function t(){this.tasks=[]};h.prototype.nextArrival=function t(){return this.isEmpty()?Infinity:this.tasks[0].time};h.prototype.isEmpty=function t(){return this.tasks.length===0};h.prototype.add=function t(e){c(e,this.tasks)};h.prototype.remove=function t(e){var r=f(e.time,this.tasks);if(r>=0&&r<this.tasks.length){var n=i(e,this.tasks[r].events);if(n>=0){this.tasks[r].events.splice(n,1);return true}}return false};h.prototype.removeAll=function t(e){var i=this;for(var r=0;r<this.tasks.length;++r){l(e,i.tasks[r])}};h.prototype.runTasks=function t(e,i){var r=this;var n=this.tasks;var s=n.length;var o=0;while(o<s&&n[o].time<=e){++o}this.tasks=n.slice(o);for(var u=0;u<o;++u){r.tasks=a(i,n[u].events,r.tasks)}};function a(t,e,i){for(var r=0;r<e.length;++r){var n=e[r];if(n.active){t(n);if(n.period>=0&&n.active){n.time=n.time+n.period;c(n,i)}}}return i}function c(t,e){var i=e.length;if(i===0){e.push(p(t.time,[t]));return}var r=f(t.time,e);if(r>=i){e.push(p(t.time,[t]))}else if(t.time===e[r].time){e[r].events.push(t)}else{e.splice(r,0,p(t.time,[t]))}}function l(t,i){i.events=e(t,i.events)}function f(t,e){var i=0;var r=e.length;var n,s;while(i<r){n=Math.floor((i+r)/2);s=e[n];if(t===s.time){return n}else if(t<s.time){r=n}else{i=n+1}}return r}var p=function(t,e){return{time:t,events:e}};var v=function t(){this.now=Date.now};v.prototype.setTimer=function t(e,i){return i<=0?d(e):setTimeout(e,i)};v.prototype.clearTimer=function t(e){return e instanceof m?e.cancel():clearTimeout(e)};var m=function t(e){this.f=e;this.active=true};m.prototype.run=function t(){return this.active&&this.f()};m.prototype.error=function t(e){throw e};m.prototype.cancel=function t(){this.active=false};function d(t){var e=new m(t);s(e);return e}var y=function(t,e){return new u(t,e)};var _=function(){return new h};var k=function(){return new v};var w=r(y);var x=function(){return y(k(),_())};t.newTimeline=_;t.newClockTimer=k;t.newScheduler=w;t.newDefaultScheduler=x;Object.defineProperty(t,"__esModule",{value:true})});
{
"name": "@most/scheduler",
"version": "0.4.0",
"version": "0.4.1",
"description": "Reactive programming with lean, functions-only, curried, tree-shakeable API",

@@ -49,3 +49,3 @@ "typings": "type-definitions/index.d.ts",

"eslint": "^3.15.0",
"flow-bin": "^0.37.4",
"flow-bin": "^0.43.1",
"mocha": "^3.2.0",

@@ -59,5 +59,5 @@ "rollup": "^0.41.4",

"dependencies": {
"@most/prelude": "^1.4.0",
"@most/types": "^0.4.0"
"@most/prelude": "^1.5.2",
"@most/types": "^0.4.1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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