Comparing version 1.0.0-dev.201704271746 to 1.0.0-dev.201705040952
39
dask.js
@@ -7,6 +7,27 @@ (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 { | ||
constructor() { | ||
let rs = null; | ||
let rj = null; | ||
super((resolve, reject) => { | ||
rs = resolve; | ||
rj = reject; | ||
}); | ||
this.resolve = rs; | ||
this.reject = rj; | ||
this.fullfiled = false; | ||
} | ||
} | ||
async function get(dsk, result /* | string[]*/, funcs) { | ||
const cache = {}; | ||
return await _get(dsk, result, cache, funcs); | ||
} | ||
exports.get = get; | ||
async function _get(dsk, result /* | string[]*/, cache, funcs) { | ||
const v = dsk[result]; | ||
// console.log(`*********${result}**********`); | ||
// console.info(dsk); | ||
if (result in cache) { | ||
return await cache[result]; | ||
} | ||
const deferred = new Deferred(); | ||
cache[result] = deferred; | ||
if (isObject_1.default(v)) { | ||
@@ -19,5 +40,7 @@ const keys = Object.keys(v); | ||
const args = (v[fun_name] || []); | ||
return await fun.apply(null, await Promise.all(args.map((arg) => { | ||
return get(dsk, arg, funcs); | ||
const val = await fun.apply(null, await Promise.all(args.map((arg) => { | ||
return _get(dsk, arg, cache, funcs); | ||
}))); | ||
deferred.resolve(val); | ||
return val; | ||
} | ||
@@ -30,9 +53,11 @@ } | ||
if (d) { | ||
return await get(dsk, v, funcs); | ||
const val = await _get(dsk, v, cache, funcs); | ||
deferred.resolve(val); | ||
return val; | ||
} | ||
} | ||
} | ||
return await v; | ||
deferred.resolve(v); | ||
return Promise.resolve(v); | ||
} | ||
exports.get = get; | ||
@@ -39,0 +64,0 @@ },{"lodash-ts/isFunction":3,"lodash-ts/isObject":4,"lodash-ts/isString":6}],2:[function(require,module,exports){ |
39
index.js
@@ -6,6 +6,27 @@ "use strict"; | ||
const isFunction_1 = require("lodash-ts/isFunction"); | ||
class Deferred extends Promise { | ||
constructor() { | ||
let rs = null; | ||
let rj = null; | ||
super((resolve, reject) => { | ||
rs = resolve; | ||
rj = reject; | ||
}); | ||
this.resolve = rs; | ||
this.reject = rj; | ||
this.fullfiled = false; | ||
} | ||
} | ||
async function get(dsk, result /* | string[]*/, funcs) { | ||
const cache = {}; | ||
return await _get(dsk, result, cache, funcs); | ||
} | ||
exports.get = get; | ||
async function _get(dsk, result /* | string[]*/, cache, funcs) { | ||
const v = dsk[result]; | ||
// console.log(`*********${result}**********`); | ||
// console.info(dsk); | ||
if (result in cache) { | ||
return await cache[result]; | ||
} | ||
const deferred = new Deferred(); | ||
cache[result] = deferred; | ||
if (isObject_1.default(v)) { | ||
@@ -18,5 +39,7 @@ const keys = Object.keys(v); | ||
const args = (v[fun_name] || []); | ||
return await fun.apply(null, await Promise.all(args.map((arg) => { | ||
return get(dsk, arg, funcs); | ||
const val = await fun.apply(null, await Promise.all(args.map((arg) => { | ||
return _get(dsk, arg, cache, funcs); | ||
}))); | ||
deferred.resolve(val); | ||
return val; | ||
} | ||
@@ -29,8 +52,10 @@ } | ||
if (d) { | ||
return await get(dsk, v, funcs); | ||
const val = await _get(dsk, v, cache, funcs); | ||
deferred.resolve(val); | ||
return val; | ||
} | ||
} | ||
} | ||
return await v; | ||
deferred.resolve(v); | ||
return Promise.resolve(v); | ||
} | ||
exports.get = get; |
{ | ||
"name": "dask", | ||
"version": "1.0.0-dev.201704271746", | ||
"version": "1.0.0-dev.201705040952", | ||
"description": "Task schadule in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
358
1
2
11432
4