Comparing version 1.0.0-dev.201705051055 to 1.0.0-dev.201705110957
18
dask.js
@@ -7,13 +7,8 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.dask = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
const isFunction_1 = require("lodash-ts/isFunction"); | ||
class Deferred extends Promise { | ||
class Deferred { | ||
constructor() { | ||
let rs = null; | ||
let rj = null; | ||
super((resolve, reject) => { | ||
rs = resolve; | ||
rj = reject; | ||
this.promise = new Promise((resolve, reject) => { | ||
this.resolve = resolve; | ||
this.reject = reject; | ||
}); | ||
this.resolve = rs; | ||
this.reject = rj; | ||
this.fullfiled = false; | ||
} | ||
@@ -28,5 +23,8 @@ } | ||
async function _get(dsk, result /* | string[]*/, cache, funcs) { | ||
if (!(result in dsk)) { | ||
return result; | ||
} | ||
const v = dsk[result]; | ||
if (result in cache) { | ||
return await cache[result]; | ||
return cache[result].promise; | ||
} | ||
@@ -33,0 +31,0 @@ const deferred = new Deferred(); |
@@ -1,1 +0,1 @@ | ||
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _keys=require("babel-runtime/core-js/object/keys"),_keys2=_interopRequireDefault(_keys),_regenerator=require("babel-runtime/regenerator"),_regenerator2=_interopRequireDefault(_regenerator),_asyncToGenerator2=require("babel-runtime/helpers/asyncToGenerator"),_asyncToGenerator3=_interopRequireDefault(_asyncToGenerator2),_promise=require("babel-runtime/core-js/promise"),_promise2=_interopRequireDefault(_promise),_getPrototypeOf=require("babel-runtime/core-js/object/get-prototype-of"),_getPrototypeOf2=_interopRequireDefault(_getPrototypeOf),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_possibleConstructorReturn2=require("babel-runtime/helpers/possibleConstructorReturn"),_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=require("babel-runtime/helpers/inherits"),_inherits3=_interopRequireDefault(_inherits2),_typeof2=require("babel-runtime/helpers/typeof"),_typeof3=_interopRequireDefault(_typeof2);!function(e){if("object"===("undefined"==typeof exports?"undefined":(0,_typeof3.default)(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.dask=e()}}(function(){return function e(t,r,n){function u(i,a){if(!r[i]){if(!t[i]){var s="function"==typeof require&&require;if(!a&&s)return s(i,!0);if(o)return o(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[i]={exports:{}};t[i][0].call(f.exports,function(e){var r=t[i][1][e];return u(r?r:e)},f,f.exports,e,t,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)u(n[i]);return u}({1:[function(e,t,r){var n=function(){var e=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function e(t,r,n){var o;return _regenerator2.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o={},e.next=3,u(t,r,o,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}(),u=function(){var e=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function e(t,r,n,l){var f,c,p,d,_,b,y,h,v;return _regenerator2.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(f=t[r],!(r in n)){e.next=5;break}return e.next=4,n[r];case 4:return e.abrupt("return",e.sent);case 5:if(c=new s,n[r]=c,!o.default(f)){e.next=25;break}if(p=(0,_keys2.default)(f),1!=p.length){e.next=23;break}if(d=p[0],_=l[d],!a.default(_)){e.next=23;break}return b=f[d]||[],e.t0=_,e.next=17,_promise2.default.all(b.map(function(e){return u(t,e,n,l)}));case 17:return e.t1=e.sent,e.next=20,e.t0.apply.call(e.t0,null,e.t1);case 20:return y=e.sent,c.resolve(y),e.abrupt("return",y);case 23:e.next=33;break;case 25:if(!i.default(f)){e.next=33;break}if(h=t[f],!h){e.next=33;break}return e.next=30,u(t,f,n,l);case 30:return v=e.sent,c.resolve(v),e.abrupt("return",v);case 33:return c.resolve(f),e.abrupt("return",_promise2.default.resolve(f));case 35:case"end":return e.stop()}},e,this)}));return function(t,r,n,u){return e.apply(this,arguments)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=e("lodash-ts/isObject"),i=e("lodash-ts/isString"),a=e("lodash-ts/isFunction"),s=function(e){function t(){(0,_classCallCheck3.default)(this,t);var e=null,r=null,n=(0,_possibleConstructorReturn3.default)(this,(t.__proto__||(0,_getPrototypeOf2.default)(t)).call(this,function(t,n){e=t,r=n}));return n.resolve=e,n.reject=r,n.fullfiled=!1,n}return(0,_inherits3.default)(t,e),t}(_promise2.default);r.get=n,r.default=n},{"lodash-ts/isFunction":3,"lodash-ts/isObject":4,"lodash-ts/isString":6}],2:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=Array.isArray},{}],3:[function(e,t,r){function n(e){var t=u.default(e)?s.call(e):"";return t==o||t==i}Object.defineProperty(r,"__esModule",{value:!0});var u=e("./isObject"),o="[object Function]",i="[object GeneratorFunction]",a=Object.prototype,s=a.toString;r.default=n},{"./isObject":4}],4:[function(e,t,r){function n(e){var t="undefined"==typeof e?"undefined":(0,_typeof3.default)(e);return!!e&&("object"==t||"function"==t)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},{}],5:[function(e,t,r){function n(e){return!!e&&"object"==("undefined"==typeof e?"undefined":(0,_typeof3.default)(e))}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},{}],6:[function(e,t,r){function n(e){return"string"==typeof e||!u.default(e)&&o.default(e)&&s.call(e)==i}Object.defineProperty(r,"__esModule",{value:!0});var u=e("./isArray"),o=e("./isObjectLike"),i="[object String]",a=Object.prototype,s=a.toString;r.default=n},{"./isArray":2,"./isObjectLike":5}]},{},[1])(1)}); | ||
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _keys=require("babel-runtime/core-js/object/keys"),_keys2=_interopRequireDefault(_keys),_regenerator=require("babel-runtime/regenerator"),_regenerator2=_interopRequireDefault(_regenerator),_asyncToGenerator2=require("babel-runtime/helpers/asyncToGenerator"),_asyncToGenerator3=_interopRequireDefault(_asyncToGenerator2),_promise=require("babel-runtime/core-js/promise"),_promise2=_interopRequireDefault(_promise),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_typeof2=require("babel-runtime/helpers/typeof"),_typeof3=_interopRequireDefault(_typeof2);!function(e){if("object"===("undefined"==typeof exports?"undefined":(0,_typeof3.default)(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.dask=e()}}(function(){return function e(t,r,n){function u(o,i){if(!r[o]){if(!t[o]){var f="function"==typeof require&&require;if(!i&&f)return f(o,!0);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[o]={exports:{}};t[o][0].call(l.exports,function(e){var r=t[o][1][e];return u(r?r:e)},l,l.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)u(n[o]);return u}({1:[function(e,t,r){var n=function(){var e=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function e(t,r,n){var a;return _regenerator2.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a={},e.next=3,u(t,r,a,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}(),u=function(){var e=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function e(t,r,n,s){var l,c,d,p,_,b,y,v,h;return _regenerator2.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r in t){e.next=2;break}return e.abrupt("return",r);case 2:if(l=t[r],!(r in n)){e.next=5;break}return e.abrupt("return",n[r].promise);case 5:if(c=new f,n[r]=c,!a.default(l)){e.next=25;break}if(d=(0,_keys2.default)(l),1!=d.length){e.next=23;break}if(p=d[0],_=s[p],!i.default(_)){e.next=23;break}return b=l[p]||[],e.t0=_,e.next=17,_promise2.default.all(b.map(function(e){return u(t,e,n,s)}));case 17:return e.t1=e.sent,e.next=20,e.t0.apply.call(e.t0,null,e.t1);case 20:return y=e.sent,c.resolve(y),e.abrupt("return",y);case 23:e.next=33;break;case 25:if(!o.default(l)){e.next=33;break}if(v=t[l],!v){e.next=33;break}return e.next=30,u(t,l,n,s);case 30:return h=e.sent,c.resolve(h),e.abrupt("return",h);case 33:return c.resolve(l),e.abrupt("return",_promise2.default.resolve(l));case 35:case"end":return e.stop()}},e,this)}));return function(t,r,n,u){return e.apply(this,arguments)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=e("lodash-ts/isObject"),o=e("lodash-ts/isString"),i=e("lodash-ts/isFunction"),f=function e(){var t=this;(0,_classCallCheck3.default)(this,e),this.promise=new _promise2.default(function(e,r){t.resolve=e,t.reject=r})};r.get=n,r.default=n},{"lodash-ts/isFunction":3,"lodash-ts/isObject":4,"lodash-ts/isString":6}],2:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=Array.isArray},{}],3:[function(e,t,r){function n(e){var t=u.default(e)?f.call(e):"";return t==a||t==o}Object.defineProperty(r,"__esModule",{value:!0});var u=e("./isObject"),a="[object Function]",o="[object GeneratorFunction]",i=Object.prototype,f=i.toString;r.default=n},{"./isObject":4}],4:[function(e,t,r){function n(e){var t="undefined"==typeof e?"undefined":(0,_typeof3.default)(e);return!!e&&("object"==t||"function"==t)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},{}],5:[function(e,t,r){function n(e){return!!e&&"object"==("undefined"==typeof e?"undefined":(0,_typeof3.default)(e))}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},{}],6:[function(e,t,r){function n(e){return"string"==typeof e||!u.default(e)&&a.default(e)&&f.call(e)==o}Object.defineProperty(r,"__esModule",{value:!0});var u=e("./isArray"),a=e("./isObjectLike"),o="[object String]",i=Object.prototype,f=i.toString;r.default=n},{"./isArray":2,"./isObjectLike":5}]},{},[1])(1)}); |
18
index.js
@@ -6,13 +6,8 @@ "use strict"; | ||
const isFunction_1 = require("lodash-ts/isFunction"); | ||
class Deferred extends Promise { | ||
class Deferred { | ||
constructor() { | ||
let rs = null; | ||
let rj = null; | ||
super((resolve, reject) => { | ||
rs = resolve; | ||
rj = reject; | ||
this.promise = new Promise((resolve, reject) => { | ||
this.resolve = resolve; | ||
this.reject = reject; | ||
}); | ||
this.resolve = rs; | ||
this.reject = rj; | ||
this.fullfiled = false; | ||
} | ||
@@ -27,5 +22,8 @@ } | ||
async function _get(dsk, result /* | string[]*/, cache, funcs) { | ||
if (!(result in dsk)) { | ||
return result; | ||
} | ||
const v = dsk[result]; | ||
if (result in cache) { | ||
return await cache[result]; | ||
return cache[result].promise; | ||
} | ||
@@ -32,0 +30,0 @@ const deferred = new Deferred(); |
{ | ||
"name": "dask", | ||
"version": "1.0.0-dev.201705051055", | ||
"version": "1.0.0-dev.201705110957", | ||
"description": "Task schadule in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
18438
7
433