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

dask

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dask - npm Package Compare versions

Comparing version 1.0.0 to 1.0.201803221328

umd/index.d.ts

296

dask.js

@@ -1,12 +0,34 @@

(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){
(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(){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}return e})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const isObject_1 = require("lodash-ts/isObject");
const isString_1 = require("lodash-ts/isString");
const isFunction_1 = require("lodash-ts/isFunction");
class Deferred {
constructor() {
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
});
}
}
async function get(dsk, result /* | string[]*/, funcs) {
const cache = {};
return await _get(dsk, result, cache, funcs);
}
exports.get = get;
exports.default = get;
async function _get(dsk, result /* | string[]*/, cache, funcs) {
if (!(result in dsk)) {
return result;
}
const v = dsk[result];
// console.log(`*********${result}**********`);
// console.info(dsk);
if (isObject_1.default(v)) {
// console.log('dask-pending:', result);
if (v == result) {
// console.log('dask-resolved', result, '=', v);
return v;
}
if (result in cache) {
return cache[result].promise;
}
const deferred = new Deferred();
cache[result] = deferred;
if (typeof v === 'object') {
const keys = Object.keys(v);

@@ -16,7 +38,11 @@ if (keys.length == 1) {

const fun = funcs[fun_name];
if (isFunction_1.default(fun)) {
if (typeof fun === 'function') {
const args = (v[fun_name] || []);
return await fun.apply(null, await Promise.all(args.map((arg) => {
return get(dsk, arg, funcs);
// console.log('dask-calling fun=', fun_name);
const val = await fun.apply(null, await Promise.all(args.map((arg) => {
return _get(dsk, arg, cache, funcs);
})));
// console.log('dask-resolved fun=', fun_name, result, '=', val);
deferred.resolve(val);
return val;
}

@@ -26,248 +52,18 @@ }

else {
if (isString_1.default(v)) {
if (typeof v === 'string') {
const d = dsk[v];
if (d) {
return await get(dsk, v, funcs);
const val = await _get(dsk, v, cache, funcs);
// console.log('dask-resolved', result, '=', val);
deferred.resolve(val);
return val;
}
}
}
return await v;
// console.log('dask-resolved', result, '=', v);
deferred.resolve(v);
return v;
}
exports.get = get;
},{"lodash-ts/isFunction":3,"lodash-ts/isObject":4,"lodash-ts/isString":6}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @Author: taoqf
* @Date: 2016-06-17 15:47:25
* @Last Modified by: taoqf
* @Last Modified time: 2016-06-17 15:54:34
* @CopyRight 飞道科技
*/
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @type {Function}
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
exports.default = Array.isArray;
},{}],3:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @Author: taoqf
* @Date: 2016-06-15 11:59:02
* @Last Modified by: taoqf
* @Last Modified time: 2016-06-17 15:54:38
* @CopyRight 飞道科技
*/
const isObject_1 = require("./isObject");
/** `Object#toString` result references. */
const funcTag = '[object Function]', genTag = '[object GeneratorFunction]';
/** Used for built-in method references. */
const objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
const objectToString = objectProto.toString;
/**
* @module lodash-ts/isFunction
* @example
* import isFunction from 'lodash-ts/isFunction';
*
* isFunction(_);
* // => true
*
* isFunction(/abc/);
* @see _.isFunction
*/
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject_1.default(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
exports.default = isFunction;
},{"./isObject":4}],4:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @Author: taoqf
* @Date: 2016-06-17 15:47:25
* @Last Modified by: taoqf
* @Last Modified time: 2016-06-17 15:54:43
* @CopyRight 飞道科技
*/
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
let type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
exports.default = isObject;
},{}],5:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @Author: taoqf
* @Date: 2016-06-15 11:59:02
* @Last Modified by: taoqf
* @Last Modified time: 2016-06-17 15:54:27
* @CopyRight 飞道科技
*/
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
exports.default = isObjectLike;
},{}],6:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @Author: taoqf
* @Date: 2016-06-15 11:59:02
* @Last Modified by: taoqf
* @Last Modified time: 2016-06-17 15:54:31
* @CopyRight 飞道科技
*/
const isArray_1 = require("./isArray");
const isObjectLike_1 = require("./isObjectLike");
/** `Object#toString` result references. */
const stringTag = '[object String]';
/** Used for built-in method references. */
const objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
const objectToString = objectProto.toString;
/**
* @module lodash-ts/isString
* @example
* import isString from 'lodash-ts/isString';
*
* isString('abc');
* // => true
*
* isString(1);
* // => false
* @see _.isString
*/
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray_1.default(value) && isObjectLike_1.default(value) && objectToString.call(value) == stringTag);
}
exports.default = isString;
},{"./isArray":2,"./isObjectLike":5}]},{},[1])(1)
});
},{}]},{},[1])(1)
});

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

"use strict";function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(o,u){try{var i=t[o](u),f=i.value}catch(e){return void n(e)}return i.done?void e(f):Promise.resolve(f).then(function(e){r("next",e)},function(e){r("throw",e)})}return r("next")})}}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(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,n,r){function o(i,f){if(!n[i]){if(!t[i]){var a="function"==typeof require&&require;if(!f&&a)return a(i,!0);if(u)return u(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var s=n[i]={exports:{}};t[i][0].call(s.exports,function(e){var n=t[i][1][e];return o(n?n:e)},s,s.exports,e,t,n,r)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(e,t,n){var r=function(){var e=_asyncToGenerator(regeneratorRuntime.mark(function e(t,n,f){var a,c,s,l,d,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t[n],!o.default(a)){e.next=17;break}if(c=Object.keys(a),1!=c.length){e.next=15;break}if(s=c[0],l=f[s],!i.default(l)){e.next=15;break}return d=a[s]||[],e.t0=l,e.next=11,Promise.all(d.map(function(e){return r(t,e,f)}));case 11:return e.t1=e.sent,e.next=14,e.t0.apply.call(e.t0,null,e.t1);case 14:return e.abrupt("return",e.sent);case 15:e.next=23;break;case 17:if(!u.default(a)){e.next=23;break}if(p=t[a],!p){e.next=23;break}return e.next=22,r(t,a,f);case 22:return e.abrupt("return",e.sent);case 23:return e.next=25,a;case 25:return e.abrupt("return",e.sent);case 26:case"end":return e.stop()}},e,this)}));return function(t,n,r){return e.apply(this,arguments)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=e("lodash-ts/isObject"),u=e("lodash-ts/isString"),i=e("lodash-ts/isFunction");n.get=r},{"lodash-ts/isFunction":3,"lodash-ts/isObject":4,"lodash-ts/isString":6}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=Array.isArray},{}],3:[function(e,t,n){function r(e){var t=o.default(e)?a.call(e):"";return t==u||t==i}Object.defineProperty(n,"__esModule",{value:!0});var o=e("./isObject"),u="[object Function]",i="[object GeneratorFunction]",f=Object.prototype,a=f.toString;n.default=r},{"./isObject":4}],4:[function(e,t,n){function r(e){var t="undefined"==typeof e?"undefined":_typeof(e);return!!e&&("object"==t||"function"==t)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=r},{}],5:[function(e,t,n){function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":_typeof(e))}Object.defineProperty(n,"__esModule",{value:!0}),n.default=r},{}],6:[function(e,t,n){function r(e){return"string"==typeof e||!o.default(e)&&u.default(e)&&a.call(e)==i}Object.defineProperty(n,"__esModule",{value:!0});var o=e("./isArray"),u=e("./isObjectLike"),i="[object String]",f=Object.prototype,a=f.toString;n.default=r},{"./isArray":2,"./isObjectLike":5}]},{},[1])(1)});
"use strict";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 _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}!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{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).dask=e()}}(function(){return function a(o,i,f){function s(t,e){if(!i[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var u=i[t]={exports:{}};o[t][0].call(u.exports,function(e){var r=o[t][1][e];return s(r||e)},u,u.exports,a,o,i,f)}return i[t].exports}for(var l="function"==typeof require&&require,e=0;e<f.length;e++)s(f[e]);return s}({1:[function(e,r,t){var n,u,a=(n=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function e(r,t,n){var u;return _regenerator2.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},e.next=3,d(r,t,u,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)})),function(e,r,t){return n.apply(this,arguments)}),d=(u=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function e(r,t,n,u){var a,o,i,f,s,l,c,p;return _regenerator2.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t in r){e.next=2;break}return e.abrupt("return",t);case 2:if((a=r[t])!=t){e.next=5;break}return e.abrupt("return",a);case 5:if(!(t in n)){e.next=7;break}return e.abrupt("return",n[t].promise);case 7:if(o=new _,n[t]=o,"object"!==(void 0===a?"undefined":(0,_typeof3.default)(a))){e.next=27;break}if(1!=(i=(0,_keys2.default)(a)).length){e.next=25;break}if(f=i[0],"function"!=typeof(s=u[f])){e.next=25;break}return l=a[f]||[],e.t0=s,e.next=19,_promise2.default.all(l.map(function(e){return d(r,e,n,u)}));case 19:return e.t1=e.sent,e.next=22,e.t0.apply.call(e.t0,null,e.t1);case 22:return c=e.sent,o.resolve(c),e.abrupt("return",c);case 25:e.next=35;break;case 27:if("string"!=typeof a){e.next=35;break}if(!r[a]){e.next=35;break}return e.next=32,d(r,a,n,u);case 32:return p=e.sent,o.resolve(p),e.abrupt("return",p);case 35:return o.resolve(a),e.abrupt("return",a);case 37:case"end":return e.stop()}},e,this)})),function(e,r,t,n){return u.apply(this,arguments)});Object.defineProperty(t,"__esModule",{value:!0});var _=function e(){var t=this;(0,_classCallCheck3.default)(this,e),this.promise=new _promise2.default(function(e,r){t.resolve=e,t.reject=r})};t.get=a,t.default=a},{}]},{},[1])(1)});

@@ -9,1 +9,2 @@ export interface Dask {

}): Promise<any>;
export default get;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const isObject_1 = require("lodash-ts/isObject");
const isString_1 = require("lodash-ts/isString");
const isFunction_1 = require("lodash-ts/isFunction");
class Deferred {
constructor() {
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
});
}
}
async function get(dsk, result /* | string[]*/, funcs) {
const cache = {};
return await _get(dsk, result, cache, funcs);
}
exports.get = get;
exports.default = get;
async function _get(dsk, result /* | string[]*/, cache, funcs) {
if (!(result in dsk)) {
return result;
}
const v = dsk[result];
// console.log(`*********${result}**********`);
// console.info(dsk);
if (isObject_1.default(v)) {
// console.log('dask-pending:', result);
if (v == result) {
// console.log('dask-resolved', result, '=', v);
return v;
}
if (result in cache) {
return cache[result].promise;
}
const deferred = new Deferred();
cache[result] = deferred;
if (typeof v === 'object') {
const keys = Object.keys(v);

@@ -15,7 +37,11 @@ if (keys.length == 1) {

const fun = funcs[fun_name];
if (isFunction_1.default(fun)) {
if (typeof fun === 'function') {
const args = (v[fun_name] || []);
return await fun.apply(null, await Promise.all(args.map((arg) => {
return get(dsk, arg, funcs);
// console.log('dask-calling fun=', fun_name);
const val = await fun.apply(null, await Promise.all(args.map((arg) => {
return _get(dsk, arg, cache, funcs);
})));
// console.log('dask-resolved fun=', fun_name, result, '=', val);
deferred.resolve(val);
return val;
}

@@ -25,11 +51,15 @@ }

else {
if (isString_1.default(v)) {
if (typeof v === 'string') {
const d = dsk[v];
if (d) {
return await get(dsk, v, funcs);
const val = await _get(dsk, v, cache, funcs);
// console.log('dask-resolved', result, '=', val);
deferred.resolve(val);
return val;
}
}
}
return await v;
// console.log('dask-resolved', result, '=', v);
deferred.resolve(v);
return v;
}
exports.get = get;
{
"name": "dask",
"version": "1.0.0",
"version": "1.0.201803221328",
"description": "Task schadule in JavaScript",
"main": "index.js",
"scripts": {
"test": "node ./tests/"
"test": "mocha --require should ./tests/**.test.js --max-old-space-size=4096 --harmony --check-leaks",
"converage": "istanbul cover -hook-run-in-content node_modules/mocha/bin/_mocha --require should ./tests/**.test.js --max-old-space-size=4096 --harmony --check-leaks",
"karma": "karma start ./tests/karma.unit.js",
"build": "gulp"
},

@@ -15,6 +18,3 @@ "keywords": [

],
"repository": {
"type": "git",
"url": "git+https://github.com/taoqf/dask.git"
},
"repository": "git+https://github.com/taoqf/dask.git",
"author": "taoqf",

@@ -26,7 +26,9 @@ "license": "MIT",

"homepage": "https://github.com/taoqf/dask#readme",
"dependencies": {
"lodash-ts": "latest"
},
"dependencies": {},
"devDependencies": {
"babel-preset-latest": "latest",
"@types/mocha": "latest",
"@types/ndarray": "latest",
"babel-core": "latest",
"babel-plugin-transform-runtime": "latest",
"babel-preset-env": "latest",
"browserify": "latest",

@@ -38,9 +40,18 @@ "del": "latest",

"gulp-sequence": "latest",
"gulp-typescript": "latest",
"gulp-shell": "latest",
"gulp-uglify": "latest",
"istanbul": "latest",
"karma": "latest",
"karma-chrome-launcher": "latest",
"karma-mocha": "latest",
"karma-mocha-reporter": "latest",
"karma-should": "latest",
"karma-webpack": "latest",
"mocha": "latest",
"ndarray": "latest",
"pump": "latest",
"should": "latest",
"typescript": "next",
"webpack": "latest",
"webpack-stream": "latest"
"webpack": "latest"
}
}
}
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