update structure and deps

This commit is contained in:
LosslessBot 2016-05-04 04:28:50 +02:00
parent c4e2021a01
commit 130e071a06
21 changed files with 154 additions and 100 deletions

View File

@ -0,0 +1,4 @@
.idea/
docs/
coverage/
ts/

1
dist/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export * from "./taskbuffer.classes";

13
dist/index.js vendored
View File

@ -1,7 +1,8 @@
var task = require("./taskbuffer.task");
var taskbuffer = {
task: task
};
module.exports = taskbuffer;
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
/// <reference path="./typings/main.d.ts" />
__export(require("./taskbuffer.classes"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLElBQU8sSUFBSSxXQUFXLG1CQUFtQixDQUFDLENBQUM7QUFHM0MsSUFBSSxVQUFVLEdBQUc7SUFDYixJQUFJLEVBQUUsSUFBSTtDQUNiLENBQUM7QUFFRixpQkFBUyxVQUFVLENBQUMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgcGx1Z2lucyA9IHJlcXVpcmUoXCIuL3Rhc2tidWZmZXIucGx1Z2luc1wiKTtcbmltcG9ydCB0YXNrID0gcmVxdWlyZShcIi4vdGFza2J1ZmZlci50YXNrXCIpO1xuaW1wb3J0IHRhc2tjaGFpbiA9IHJlcXVpcmUoXCIuL3Rhc2tidWZmZXIudGFza2NoYWluXCIpO1xuXG52YXIgdGFza2J1ZmZlciA9IHtcbiAgICB0YXNrOiB0YXNrXG59O1xuXG5leHBvcnQgPSB0YXNrYnVmZmVyOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSw0Q0FBNEM7QUFDNUMsaUJBQWMsc0JBQXNCLENBQUMsRUFBRCIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmV4cG9ydCAqIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlc1wiIl19

2
dist/taskbuffer.classes.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
export * from "./taskbuffer.classes.task";
export * from "./taskbuffer.classes.taskchain";

3
dist/taskbuffer.classes.helpers.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
export declare var emptyTaskFunction: () => any;
export declare var isTask: (taskArg: any) => boolean;
export declare var runTask: (taskArg: any) => any;

View File

@ -1,3 +1,4 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./taskbuffer.plugins");
var classes = require("./taskbuffer.classes");
@ -6,11 +7,22 @@ exports.emptyTaskFunction = function () {
done.resolve();
return done.promise;
};
exports.isTask = function (taskArg) {
if (taskArg instanceof classes.Task
&& typeof taskArg.task === "function") {
return true;
}
else {
return false;
}
};
exports.runTask = function (taskArg) {
var done = plugins.Q.defer();
if (taskArg instanceof classes.Task) {
var taskReturn;
if (exports.isTask(taskArg)) {
taskReturn = taskArg.task();
}
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ2pELElBQU8sT0FBTyxXQUFXLHNCQUFzQixDQUFDLENBQUM7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Rhc2sodGFza0FyZykpe1xuICAgICAgICB0YXNrUmV0dXJuID0gdGFza0FyZy50YXNrKCk7XG4gICAgfVxuICAgIHJldHVybiBkb25lLnByb21pc2U7XG59OyJdfQ==

View File

@ -1,65 +1,8 @@
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="./typings/main.d.ts" />
var plugins = require("./taskbuffer.plugins");
var helpers = require("./taskbuffer.classes.helpers");
var Task = (function () {
function Task(taskArg, optionsArg) {
if (optionsArg === void 0) { optionsArg = {}; }
var options = optionsArg;
this.task = taskArg;
this.preTask = options.preTask;
this.afterTask = options.afterTask;
this.idle = true;
this.running = false;
if (typeof options.buffered === "boolean") {
this.buffered = options.buffered;
}
else {
this.buffered = false;
}
}
Task.prototype.trigger = function () {
helpers.runTask(this.preTask)
.then(function () {
})
.then(function () {
});
};
;
Task.prototype.triggerBuffered = function () {
var done = plugins.Q.defer();
};
Object.defineProperty(Task.prototype, "state", {
get: function () {
return this._state;
},
set: function (stateArg) {
if (stateArg == "locked") {
this._state = "locked";
}
else {
plugins.beautylog.error("state type");
}
},
enumerable: true,
configurable: true
});
return Task;
})();
exports.Task = Task;
var TaskChain = (function (_super) {
__extends(TaskChain, _super);
function TaskChain(taskArrayArg) {
_super.call(this, {
task: function () { }
});
}
return TaskChain;
})(Task);
exports.TaskChain = TaskChain;
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./taskbuffer.classes.task"));
__export(require("./taskbuffer.classes.taskchain"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50cyJdLCJuYW1lcyI6WyJUYXNrIiwiVGFzay5jb25zdHJ1Y3RvciIsIlRhc2sudHJpZ2dlciIsIlRhc2sudH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k7XG4gICAgfVxufSJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsaUJBQWMsMkJBQ2QsQ0FBQyxFQUR3QztBQUN6QyxpQkFBYyxnQ0FDZCxDQUFDLEVBRDZDIiwiZmlsZSI6InRhc2tidWZmZXIuY2xhc3Nlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrXCJcbmV4cG9ydCAqIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrY2hhaW5cIlxuIl19

19
dist/taskbuffer.classes.task.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
export declare class Task {
task: any;
idle: boolean;
running: boolean;
buffered: boolean;
private _counterBufferRelative;
private _counterTriggerAbsolute;
private _state;
preTask: Task;
afterTask: Task;
constructor(taskArg: any, optionsArg?: {
preTask?: Task;
afterTask?: Task;
buffered?: boolean;
});
trigger(): any;
triggerBuffered(): void;
state: string;
}

56
dist/taskbuffer.classes.task.js vendored Normal file
View File

@ -0,0 +1,56 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./taskbuffer.plugins");
var helpers = require("./taskbuffer.classes.helpers");
var Task = (function () {
function Task(taskArg, optionsArg) {
if (optionsArg === void 0) { optionsArg = {}; }
var options = optionsArg;
this.task = taskArg;
this.preTask = options.preTask;
this.afterTask = options.afterTask;
this.idle = true;
this.running = false;
if (typeof options.buffered === "boolean") {
this.buffered = options.buffered;
}
else {
this.buffered = false;
}
}
Task.prototype.trigger = function () {
var done = plugins.Q.defer();
helpers.runTask(this.preTask)
.then(function () {
})
.then(function () {
})
.then(function () {
done.resolve();
});
return done.promise;
};
;
Task.prototype.triggerBuffered = function () {
var done = plugins.Q.defer();
};
Object.defineProperty(Task.prototype, "state", {
get: function () {
return this._state;
},
set: function (stateArg) {
if (stateArg == "locked") {
this._state = "locked";
}
else {
plugins.beautylog.error("state type");
}
},
enumerable: true,
configurable: true
});
return Task;
}());
exports.Task = Task;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50YXNrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBWSxPQUFPLFdBQU0sc0JBQ3pCLENBQUMsQ0FEOEM7QUFDL0MsSUFBWSxPQUFPLFdBQU0sOEJBRXpCLENBQUMsQ0FGc0Q7QUFFdkQ7SUFXSSxjQUFZLE9BQU8sRUFBQyxVQUFrRTtRQUFsRSwwQkFBa0UsR0FBbEUsZUFBa0U7UUFDbEYsSUFBSSxPQUFPLEdBQUcsVUFBVSxDQUFDO1FBQ3pCLElBQUksQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDO1FBQ3BCLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQztRQUMvQixJQUFJLENBQUMsU0FBUyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUM7UUFDbkMsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7UUFDakIsSUFBSSxDQUFDLE9BQU8sR0FBRyxLQUFLLENBQUM7UUFDckIsRUFBRSxDQUFDLENBQUMsT0FBTyxPQUFPLENBQUMsUUFBUSxLQUFLLFNBQVMsQ0FBQyxDQUFBLENBQUM7WUFDdkMsSUFBSSxDQUFDLFFBQVEsR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDO1FBQ3JDLENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNKLElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDO1FBQ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SBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuYnVmZmVyZWQgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cbiAgICB0cmlnZ2VyKCl7XG4gICAgICAgIGxldCBkb25lID0gcGx1Z2lucy5RLmRlZmVyKCk7XG4gICAgICAgIGhlbHBlcnMucnVuVGFzayh0aGlzLnByZVRhc2spXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbigpe1xuXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oKXtcblxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICAgICAgZG9uZS5yZXNvbHZlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICByZXR1cm4gZG9uZS5wcm9taXNlO1xuICAgIH07XG4gICAgdHJpZ2dlckJ1ZmZlcmVkKCl7XG4gICAgICAgIHZhciBkb25lID0gcGx1Z2lucy5RLmRlZmVyKCk7XG4gICAgfVxuXG4gICAgZ2V0IHN0YXRlKCk6c3RyaW5nIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX3N0YXRlO1xuICAgIH1cbiAgICBzZXQgc3RhdGUoc3RhdGVBcmc6c3RyaW5nKXtcbiAgICAgICAgaWYgKHN0YXRlQXJnID09IFwibG9ja2VkXCIpe1xuICAgICAgICAgICAgdGhpcy5fc3RhdGUgPSBcImxvY2tlZFwiO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cuZXJyb3IoXCJzdGF0ZSB0eXBlXCIgKTtcbiAgICAgICAgfVxuICAgIH1cbn0iXX0=

View File

@ -0,0 +1,4 @@
import * as classes from "./taskbuffer.classes";
export declare class Taskchain extends classes.Task {
constructor(taskArrayArg: classes.Task[]);
}

19
dist/taskbuffer.classes.taskchain.js vendored Normal file
View File

@ -0,0 +1,19 @@
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var classes = require("./taskbuffer.classes");
var Taskchain = (function (_super) {
__extends(Taskchain, _super);
function Taskchain(taskArrayArg) {
_super.call(this, {
task: function () { }
});
}
return Taskchain;
}(classes.Task));
exports.Taskchain = Taskchain;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50YXNrY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBRUEsSUFBWSxPQUFPLFdBQU0sc0JBRXpCLENBQUMsQ0FGOEM7QUFFL0M7SUFBK0IsNkJBQVk7SUFDdkMsbUJBQVksWUFBMkI7UUFDbkMsa0JBQU07WUFDRixJQUFJLEVBQUUsY0FBVyxDQUFDO1NBQ3JCLENBQUMsQ0FBQztJQUNQLENBQUM7SUFDTCxnQkFBQztBQUFELENBTkEsQUFNQyxDQU44QixPQUFPLENBQUMsSUFBSSxHQU0xQztBQU5ZLGlCQUFTLFlBTXJCLENBQUEiLCJmaWxlIjoidGFza2J1ZmZlci5jbGFzc2VzLnRhc2tjaGFpbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmltcG9ydCBoZWxwZXJzID0gcmVxdWlyZShcIi4vdGFza2J1ZmZlci5jbGFzc2VzLmhlbHBlcnNcIik7XG5pbXBvcnQgKiBhcyBjbGFzc2VzIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlc1wiXG5cbmV4cG9ydCBjbGFzcyBUYXNrY2hhaW4gZXh0ZW5kcyBjbGFzc2VzLlRhc2sge1xuICAgIGNvbnN0cnVjdG9yKHRhc2tBcnJheUFyZzpjbGFzc2VzLlRhc2tbXSl7XG4gICAgICAgIHN1cGVyKHtcbiAgICAgICAgICAgIHRhc2s6IGZ1bmN0aW9uKCl7fVxuICAgICAgICB9KTtcbiAgICB9XG59Il19

5
dist/taskbuffer.plugins.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
declare var plugins: {
beautylog: any;
Q: any;
};
export = plugins;

View File

@ -1,3 +1,4 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),
@ -5,4 +6,4 @@ var plugins = {
};
module.exports = plugins;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBSSxPQUFPLEdBQUc7SUFDVixTQUFTLEVBQUUsT0FBTyxDQUFDLFdBQVcsQ0FBQztJQUMvQixDQUFDLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQztDQUNsQixDQUFDO0FBQ0YsaUJBQVMsT0FBTyxDQUFDIiwiZmlsZSI6InRhc2tidWZmZXIucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbnZhciBwbHVnaW5zID0ge1xuICAgIGJlYXV0eWxvZzogcmVxdWlyZShcImJlYXV0eWxvZ1wiKSxcbiAgICBROiByZXF1aXJlKFwicVwiKVxufTtcbmV4cG9ydCA9IHBsdWdpbnM7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQUksT0FBTyxHQUFHO0lBQ1YsU0FBUyxFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUM7SUFDL0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUM7Q0FDbEIsQ0FBQztBQUNGLGlCQUFTLE9BQU8sQ0FBQyIsImZpbGUiOiJ0YXNrYnVmZmVyLnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG52YXIgcGx1Z2lucyA9IHtcbiAgICBiZWF1dHlsb2c6IHJlcXVpcmUoXCJiZWF1dHlsb2dcIiksXG4gICAgUTogcmVxdWlyZShcInFcIilcbn07XG5leHBvcnQgPSBwbHVnaW5zO1xuIl19

View File

@ -1,3 +0,0 @@
/// <reference path="./typings/main.d.ts" />
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucHJvbWlzZWNoYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QyIsImZpbGUiOiJ0YXNrYnVmZmVyLnByb21pc2VjaGFpbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

View File

@ -1,9 +0,0 @@
/// <reference path="./typings/main.d.ts" />
var classes = require("./taskbuffer.classes");
var task = function (taskArg, options) {
var task = taskArg;
return new classes.Task(task, options);
};
module.exports = task;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIudGFzay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsc0JBQXNCLENBQUMsQ0FBQztBQUNqRCxJQUFJLElBQUksR0FBRyxVQUFTLE9BQU8sRUFBQyxPQUFRO0lBQ2hDLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQTtJQUNsQixNQUFNLENBQUMsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksRUFBQyxPQUFPLENBQUMsQ0FBQztBQUMxQyxDQUFDLENBQUM7QUFDRixpQkFBUyxJQUFJLENBQUMiLCJmaWxlIjoidGFza2J1ZmZlci50YXNrLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IGNsYXNzZXMgPSByZXF1aXJlKFwiLi90YXNrYnVmZmVyLmNsYXNzZXNcIik7XG52YXIgdGFzayA9IGZ1bmN0aW9uKHRhc2tBcmcsb3B0aW9ucz8pe1xuICAgIHZhciB0YXNrID0gdGFza0FyZ1xuICAgIHJldHVybiBuZXcgY2xhc3Nlcy5UYXNrKHRhc2ssb3B0aW9ucyk7XG59O1xuZXhwb3J0ID0gdGFzazsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

View File

@ -1,8 +0,0 @@
/// <reference path="./typings/main.d.ts" />
var classes = require("./taskbuffer.classes");
var taskChain = function (taskArrayArg) {
return new classes.TaskChain(taskArrayArg);
};
module.exports = taskChain;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIudGFza2NoYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ2pELElBQUksU0FBUyxHQUFHLFVBQVMsWUFBMkI7SUFFaEQsTUFBTSxDQUFDLElBQUksT0FBTyxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUMsQ0FBQztBQUMvQyxDQUFDLENBQUM7QUFDRixpQkFBUyxTQUFTLENBQUMiLCJmaWxlIjoidGFza2J1ZmZlci50YXNrY2hhaW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgY2xhc3NlcyA9IHJlcXVpcmUoXCIuL3Rhc2tidWZmZXIuY2xhc3Nlc1wiKTtcbnZhciB0YXNrQ2hhaW4gPSBmdW5jdGlvbih0YXNrQXJyYXlBcmc6Y2xhc3Nlcy5UYXNrW10pe1xuXG4gICAgcmV0dXJuIG5ldyBjbGFzc2VzLlRhc2tDaGFpbih0YXNrQXJyYXlBcmcpO1xufTtcbmV4cG9ydCA9IHRhc2tDaGFpbjtcbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

View File

@ -23,13 +23,13 @@
},
"homepage": "https://github.com/pushrocks/taskbuffer#readme",
"dependencies": {
"beautylog": "^2.1.1",
"npmts": "^3.1.2",
"projectinfo": "0.0.2",
"beautylog": "^4.1.6",
"projectinfo": "1.0.1",
"q": "^1.4.1",
"rx": "^4.1.0"
},
"devDependencies": {
"should": "^8.2.2"
"should": "^8.3.1",
"npmts": "^5.1.5",
}
}

3
test/test.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
declare var taskbuffer: any;
declare var classes: any;
declare var should: any;

View File

@ -22,4 +22,5 @@ describe("taskbuffer", function () {
});
});
});
//# sourceMappingURL=test.js.map
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksVUFBVSxHQUFHLE9BQU8sQ0FBQyxlQUFlLENBQUMsQ0FBQztBQUMxQyxJQUFJLE9BQU8sR0FBRyxPQUFPLENBQUMsNEJBQTRCLENBQUMsQ0FBQztBQUNwRCxJQUFJLE1BQU0sR0FBRyxPQUFPLENBQUMsUU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hbHNlKCk7XG4gICAgICAgIH0pO1xuICAgIH0pO1xufSk7Il19

View File

@ -23,7 +23,7 @@ export var runTask = function(taskArg){
var done = plugins.Q.defer();
var taskReturn;
if(isTask(taskArg)){
taskReturn taskArg.task();
taskReturn = taskArg.task();
}
return done.promise;
};

View File

@ -3,7 +3,7 @@ import * as plugins from "./taskbuffer.plugins"
import * as helpers from "./taskbuffer.classes.helpers"
export class Task {
task:function;
task:any;
idle:boolean;
running:boolean;
buffered:boolean;