taskon
Version:
A simple JavaScript/TypeScript tasks queue that supports dynamic concurrency control
26 lines • 633 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isWaitedTask = exports.isTaskId = void 0;
/**
* Check if the given object is TaskId
* @param obj - Any object
*/
const isTaskId = (obj) => {
if (typeof obj === 'string' || typeof obj === 'number') {
return true;
}
return false;
};
exports.isTaskId = isTaskId;
/**
* Check if the given object is WaitedTask
* @param obj - Any object
*/
const isWaitedTask = (obj) => {
if (obj.resolve && obj.promise) {
return true;
}
return false;
};
exports.isWaitedTask = isWaitedTask;
//# sourceMappingURL=type.js.map