UNPKG

69.6 kBSource Map (JSON)View Raw
1{"version":3,"sources":["webpack://operationkit/webpack/universalModuleDefinition","webpack://operationkit/webpack/bootstrap","webpack://operationkit/./src/Operation.ts","webpack://operationkit/./src/QueuePriority.ts","webpack://operationkit/./src/OperationEvent.ts","webpack://operationkit/./node_modules/events/events.js","webpack://operationkit/./node_modules/uuid/lib/rng-browser.js","webpack://operationkit/./node_modules/uuid/lib/bytesToUuid.js","webpack://operationkit/./src/utils.ts","webpack://operationkit/./src/OperationQueue.ts","webpack://operationkit/./src/QueueEvent.ts","webpack://operationkit/./src/index.ts","webpack://operationkit/./node_modules/uuid/index.js","webpack://operationkit/./node_modules/uuid/v1.js","webpack://operationkit/./node_modules/uuid/v4.js","webpack://operationkit/./src/CircularOperationValidator.ts","webpack://operationkit/./src/BlockOperation.ts","webpack://operationkit/./src/GroupOperation.ts"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","QueuePriority_1","events_1","uuid_1","OperationEvent_1","utils_1","Operation","EventEmitter","[object Object]","id","super","this","_queuePriority","QueuePriority","normal","v4","completionCallback","map","isExecuting","error","promise","runPromise","_dependencies","_done","_isInQueue","_canStart","_cancelled","_resolve","_reject","isFinished","isCancelled","isInQueue","queuePriority","dependencies","operations","copyArray","Promise","resolve","emit","OperationEvent","CANCEL","DONE","result","dependency","push","filter","operation","_preProcessStart","READY","main","reject","START","run","then","done","catch","e","ERROR","err","_createMap","length","forEach","on","_onDependantOperationDone","start","_tryStart","isObjectEmpty","ReflectOwnKeys","R","Reflect","ReflectApply","apply","target","receiver","args","Function","ownKeys","getOwnPropertySymbols","getOwnPropertyNames","concat","NumberIsNaN","Number","isNaN","init","_events","undefined","_eventsCount","_maxListeners","defaultMaxListeners","$getMaxListeners","that","_addListener","type","listener","prepend","events","existing","warning","TypeError","newListener","unshift","warned","w","Error","String","emitter","count","console","warn","_onceWrap","state","fired","wrapFn","wrapped","arguments","removeListener","_listeners","unwrap","evlistener","arr","ret","Array","unwrapListeners","arrayClone","listenerCount","copy","set","arg","RangeError","getPrototypeOf","setMaxListeners","getMaxListeners","doError","er","message","context","handler","len","listeners","addListener","prependListener","once","prependOnceListener","list","position","originalListener","shift","index","pop","spliceOne","off","removeAllListeners","keys","rawListeners","eventNames","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","rnds","Math","random","byteToHex","toString","substr","buf","offset","bth","join","array","assign","copyObject","CircularOperationValidator_1","QueueEvent_1","OperationQueue","_processedOperations","maximumConcurrentOperations","readyQueueMap","readyQueue","runningQueueMap","runningQueue","queues","high","low","veryLow","veryHigh","addOperations","_preProcessOperations","_begin","_paused","QueueEvent","PAUSED","RESUMED","_checkNextOperation","isPaused","CircularOperationValidator","op","_bindOperation","_onOperationStart","_onOperationReady","_onOperationCancel","_onOperationDone","_startOperations","_startOperation","_unbindOperation","hasOperations","getNextOperation","Operation_1","OperationQueue_1","BlockOperation_1","GroupOperation_1","BlockOperation","GroupOperation","v1","uuid","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","options","b","node","clockseq","seedBytes","msecs","Date","getTime","nsecs","dt","tl","tmh","ii","CircularOperationValidatorError","_checkCircular","_verifyOpMap","_checkDependencies","mapHash","JSON","parse","stringify","_throwError","mapValues","values","block","first","second","blocks","promises","results","all","queue","reduce","accum","_super"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,kBAAAH,GACA,iBAAAC,QACAA,QAAA,aAAAD,IAEAD,EAAA,aAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAA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F,OADAG,KAAKsB,aAAe,GACb+N,EAAMhM,MAAK5F,KAAAuC,QAMtBH,aAAasC,GACTnC,KAAKuB,WAAWU,KAAKE,GACrBnC,KAAKsB,aAAe,GAMxBzB,cAAc0B,GACVvB,KAAKuB,WAAavB,KAAKuB,WAAW6C,OAAO7C,GACzCvB,KAAKsB,aAAe","file":"operationkit.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"operationkit\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"operationkit\"] = factory();\n\telse\n\t\troot[\"operationkit\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n","import {QueuePriority} from './QueuePriority';\n\nimport {EventEmitter} from 'events';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport {OperationEvent} from './OperationEvent';\nimport {copyArray, isObjectEmpty} from './utils';\n\n/**\n * @class Operation\n * @constructor Operation\n * @description Abstract class which runs a single task\n */\nexport abstract class Operation<T> extends EventEmitter {\n\n public id: string;\n public result: T;\n public name: string;\n public completionCallback?: Function;\n public map: Object;\n public isExecuting: boolean;\n public error: boolean;\n public promise?: Promise<any>;\n public runPromise?: Promise<any>;\n\n private _dependencies: Operation<any>[];\n private _done: boolean;\n private _isInQueue: boolean;\n private _canStart: boolean;\n private _cancelled: boolean;\n private _resolve: Function;\n private _reject: Function;\n private _queuePriority: QueuePriority = QueuePriority.normal;\n\n /**\n * @param {number} [id]\n */\n constructor(id = null) {\n super();\n \n if (!id) {\n id = uuidv4()\n }\n\n this.id = id;\n this.name = null;\n this.completionCallback = null;\n this.map = {};\n this.isExecuting = false;\n this.error = true;\n this.promise = null;\n this.runPromise = null;\n\n this._dependencies = [];\n this._done = false;\n this._isInQueue = false;\n this._canStart = false;\n this._cancelled = false;\n\n this._resolve = null;\n this._reject = null;\n }\n\n /**\n * @description Getter returning if Operation finished its task\n * @returns {boolean}\n */\n get isFinished(): boolean {\n return this._done;\n }\n\n /**\n * @description Knowing if operation was cancelled\n * @returns {boolean}\n */\n get isCancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * Setter for isInQueue value\n * @param {boolean} value\n */\n set isInQueue(value) {\n this._isInQueue = value;\n }\n\n /**\n * Getter for isInQueue value\n */\n get isInQueue(): boolean {\n return this._isInQueue;\n }\n\n /**\n * Setter for queuePriority value.\n * It is only settable when operation has not yet executed, cancelled or finished\n * @param {QueuePriority} value\n */\n set queuePriority(value: QueuePriority) {\n if (this.isExecuting || this.isCancelled || this.isFinished) {\n return;\n }\n if (value in QueuePriority) {\n this._queuePriority = value;\n }\n }\n\n /**\n * Getter for queuePriority value\n * @returns {QueuePriority|number}\n */\n get queuePriority(): QueuePriority {\n return this._queuePriority;\n }\n\n /**\n * Setter for dependencies value.\n * It is only settable when operation has not yet executed, cancelled or finished\n * @param {Array.<Operation>} operations\n */\n set dependencies(operations: Operation<any>[]) {\n if (this.isExecuting || this.isCancelled || this.isFinished) {\n return;\n }\n\n this._dependencies = operations;\n }\n\n /**\n * Getter for dependencies value.\n * When operation is executing, cancelled, or finished, this returns a copy\n * @returns {Array.<Operation>}\n */\n get dependencies(): Operation<any>[] {\n if (this.isExecuting || this.isCancelled || this.isFinished) {\n return copyArray(this._dependencies);\n }\n return this._dependencies;\n }\n\n /**\n * @abstract\n * @description Needs to be implemented by sub-class\n * This is the task to be executed\n */\n abstract async run(): Promise<T>;\n\n /**\n * @description Cancels the operation if the operation has not started.\n * @returns {undefined}\n */\n public cancel(): void {\n this._cancelled = true;\n Promise.resolve(this.promise);\n this.emit(OperationEvent.CANCEL, this);\n this._resolve && this._resolve();\n }\n\n /**\n * @description Sets the operation as done. This is usually called internally or by the operationQueue\n * @returns {undefined}\n */\n public done(): void {\n this._done = true;\n this.completionCallback && this.completionCallback(this);\n this.emit(OperationEvent.DONE, this);\n this._resolve && this._resolve(this.result);\n }\n\n /**\n * @description Knowing if operation finished its task\n * @returns {boolean} \n */\n public isDone(): boolean {\n return this._done;\n }\n\n /**\n * Adds an operation as a dependency\n * @param {Operation} dependency \n */\n public addDependency(dependency: Operation<any>): void {\n this._dependencies.push(dependency);\n }\n\n /**\n * Removes an operation as a dependency\n * @param {Operation} dependency \n */\n public removeDependency(dependency: Operation<any>): void {\n this._dependencies = this._dependencies.filter(operation => operation.id !== dependency.id)\n }\n\n /**\n * Method to call to execute the operation's task.\n * The operation will not run immediatly. It is evaluated at the next tick and evaluates it's depedencies\n * in order to run. Calling this method multiples times will simply re-evaluate it's readiness\n * @returns {Promise} \n */\n public start(): Promise<T> {\n if (this.isExecuting || this.isCancelled || this.isFinished) {\n return this.promise;\n } else if (this.promise && !this._canStart) {\n this._preProcessStart();\n } else if (this.promise && this._canStart) {\n if (this._isInQueue) {\n this.emit(OperationEvent.READY, this);\n } else {\n this.main();\n }\n } else {\n this.promise = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n this._preProcessStart();\n });\n }\n return this.promise;\n }\n\n /**\n */\n public main(): void {\n this.isExecuting = true;\n this.emit(OperationEvent.START, this);\n this.runPromise = this.run()\n .then(result => {\n this.result = result;\n this.done();\n })\n .catch(e => {\n this.isExecuting = false;\n this.error = true;\n this.emit(OperationEvent.ERROR, {err: e, operation: this});\n this.emit(OperationEvent.DONE, this);\n this._reject && this._reject();\n });\n }\n\n private _preProcessStart(): void {\n this._createMap();\n\n if (this._canStart) {\n if (this._isInQueue) {\n this.emit(OperationEvent.READY, this);\n } else {\n this.main();\n }\n }\n }\n\n private _createMap(): void {\n if (!this._dependencies.length) {\n this._canStart = true;\n return;\n }\n\n this._dependencies.forEach(operation => {\n this.map[operation.id] = true;\n operation.on(OperationEvent.DONE, this._onDependantOperationDone.bind(this));\n operation.start();\n });\n\n }\n\n private _onDependantOperationDone(operation): void {\n delete this.map[operation.id];\n this._tryStart();\n }\n\n private _tryStart(): void {\n if (this.isExecuting || this.isCancelled || this.isFinished) {\n return;\n }\n if (isObjectEmpty(this.map)) {\n // should emit event to let operation queue that this operation can start\n // then it could check if maximum concurrent is not passed\n this._canStart = true;\n if (this.isInQueue) {\n this.emit(OperationEvent.READY, this);\n } else {\n this.start();\n }\n }\n }\n}","\n/**\n * Priority given to an operation when it is executed inside an OperationQueue.\n */\nexport enum QueuePriority {\n veryLow,\n low,\n normal,\n high,\n veryHigh\n}","\n/**\n * Events fired from Operation\n */\nexport enum OperationEvent {\n /**\n * Event when operation starts\n */\n START = 'start',\n /**\n * Event when operation is ready to be executed\n */\n READY = 'ready',\n /**\n * Event when operation is done\n */\n DONE = 'done',\n /**\n * Event when operation is cancelled\n */\n CANCEL = 'cancel',\n /**\n * Event when something went wrong\n */\n ERROR = 'error'\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction $getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return $getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = $getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) args.push(arguments[i]);\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n ReflectApply(this.listener, this.target, args);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([bth[buf[i++]], bth[buf[i++]], \n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]]]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","\nexport const copyArray: (array: any[]) => any[] = (array: any[]) => {\n return array.map(object => Object.assign(Object.create(object), object))\n};\n\nexport const copyObject: (objet: Object) => Object = (object: Object) => {\n return Object.assign(Object.create(object), object);\n};\n\nexport const isObjectEmpty: (object: Object) => boolean = (object: Object) => {\n for (const key in object) {\n return false;\n }\n return true;\n};","import { EventEmitter } from 'events';\nimport { CircularOperationValidator } from './CircularOperationValidator';\nimport { OperationEvent} from './OperationEvent';\nimport { QueuePriority } from './QueuePriority';\nimport { QueueEvent } from './QueueEvent';\nimport { isObjectEmpty } from './utils';\nimport { Operation } from './Operation';\n\n/**\n * @class OperationQueue\n */\nexport class OperationQueue extends EventEmitter {\n\n public map: Object;\n public operations: Operation<any>[];\n public resolve: Function;\n public reject: Function;\n public completionCallback: Function;\n public maximumConcurrentOperations: number;\n public readyQueueMap: Object;\n public readyQueue: Object;\n public runningQueueMap: Object;\n public runningQueue: Operation<any>[];\n public queues: Object;\n public promise: Promise<any>;\n private _paused:boolean;\n private _processedOperations: Operation<any>[];\n\n constructor() {\n super();\n this.map = {};\n this.operations = [];\n this._processedOperations = [];\n this.resolve = null;\n this.completionCallback = null;\n this.maximumConcurrentOperations = 10;\n\n this.readyQueueMap = {};\n this.readyQueue = [];\n\n this.runningQueueMap = {};\n this.runningQueue = [];\n\n this.queues = {};\n this.queues[QueuePriority.high] = [];\n this.queues[QueuePriority.normal] = [];\n this.queues[QueuePriority.low] = [];\n this.queues[QueuePriority.veryLow] = [];\n this.queues[QueuePriority.veryHigh] = [];\n }\n\n /**\n * Getter\n * @returns {boolean}\n */\n get isExecuting() {\n return !isObjectEmpty(this.map);\n }\n\n /**\n * Complete the queue, this will resolve and notify its callback\n */\n done() {\n this.completionCallback && this.completionCallback();\n this.resolve();\n }\n\n /**\n * @param {Operation} operation\n */\n addOperation(operation: Operation<any>): Promise<any> {\n return this.addOperations([operation]);\n }\n\n /**\n * @param {Array.<Operation>} operations\n */\n addOperations(operations: Operation<any>[]): Promise<any> {\n this.operations = this.operations.concat(operations);\n this._preProcessOperations(operations);\n this._processedOperations = this._processedOperations.concat(this.operations);\n this._begin();\n\n return this.promise;\n }\n\n /**\n * Pauses the queue, no new operations will be added to the queue\n */\n pause(): void {\n if (!this._paused) {\n this._paused = true;\n this.emit(QueueEvent.PAUSED, this);\n }\n }\n\n /**\n * Resumes the queue from an paused state\n */\n resume(): void {\n if (this._paused) {\n this._paused = false;\n this.emit(QueueEvent.RESUMED, this);\n this._checkNextOperation();\n }\n }\n\n /**\n * Getter\n * @returns {boolean}\n */\n get isPaused(): boolean {\n return this._paused;\n }\n\n private _preProcessOperations(operations: Operation<any>[]) {\n try {\n new CircularOperationValidator(operations);\n } catch (e) {\n throw e;\n }\n\n operations.forEach((op: Operation<any>) => {\n if (!this.map[op.id]) {\n this.map[op.id] = true;\n op.isInQueue = true;\n this._bindOperation(op);\n };\n this._preProcessOperations(op.dependencies);\n });\n }\n\n private _bindOperation(operation: Operation<any>) {\n operation.on(OperationEvent.START, this._onOperationStart.bind(this));\n operation.on(OperationEvent.READY, this._onOperationReady.bind(this));\n operation.on(OperationEvent.CANCEL, this._onOperationCancel.bind(this));\n operation.on(OperationEvent.DONE, this._onOperationDone.bind(this));\n }\n\n private _unbindOperation(operation: Operation<any>) {\n operation.off(OperationEvent.START, this._onOperationStart.bind(this));\n operation.off(OperationEvent.READY, this._onOperationReady.bind(this));\n operation.off(OperationEvent.CANCEL, this._onOperationCancel.bind(this));\n operation.off(OperationEvent.DONE, this._onOperationDone.bind(this));\n }\n\n private _begin() {\n if (this.promise) {\n this._startOperations();\n } else {\n this.promise = new Promise((resolve, reject) => {\n\n this.resolve = resolve;\n this.reject = reject;\n\n this._startOperations();\n });\n }\n }\n\n private _startOperations() {\n this._processedOperations.forEach(operation => {\n this._startOperation(operation);\n });\n }\n\n private _startOperation(operation: Operation<any>) {\n operation.start();\n }\n\n private _onOperationStart(operation): void {\n\n }\n\n private _onOperationReady(operation: Operation<any>): void {\n this.readyQueueMap[operation.id] = true;\n this.queues[operation.queuePriority].push(operation);\n this._checkNextOperation()\n }\n\n private _onOperationDone(operation: Operation<any>): void {\n this._unbindOperation(operation);\n\n this.runningQueue = this.runningQueue.filter(op => op.id !== operation.id);\n\n delete this.map[operation.id];\n delete this.runningQueueMap[operation.id];\n\n if (isObjectEmpty(this.map)) {\n this.emit(QueueEvent.DONE, this);\n this.done();\n } else {\n this._checkNextOperation();\n }\n }\n\n private _checkNextOperation(): void {\n if (this._paused) {\n return;\n }\n\n if (this.runningQueue.length < this.maximumConcurrentOperations && this.hasOperations()) {\n const operation = this.getNextOperation();\n if (operation\n && !operation.isExecuting\n || !operation.isCancelled\n || !this.runningQueueMap[operation.id]) {\n this.runningQueueMap[operation.id] = true;\n this.runningQueue.push(operation);\n operation.main();\n this._checkNextOperation()\n }\n }\n }\n\n /**\n * @returns {boolean}\n */\n public hasOperations(): boolean {\n return !!(this.queues[QueuePriority.veryHigh].length\n + this.queues[QueuePriority.high].length\n + this.queues[QueuePriority.normal].length\n + this.queues[QueuePriority.low].length\n + this.queues[QueuePriority.veryLow].length);\n }\n\n /**\n * Returns the next operation to be executed\n *\n * @returns {?Operation}\n */\n public getNextOperation(): Operation<any> {\n let operation = null;\n if (this.queues[QueuePriority.veryHigh].length) {\n operation = this.queues[QueuePriority.veryHigh].pop();\n return operation;\n }\n if (this.queues[QueuePriority.high].length) {\n operation = this.queues[QueuePriority.high].pop();\n return operation;\n }\n if (this.queues[QueuePriority.normal].length) {\n operation = this.queues[QueuePriority.normal].pop();\n return operation;\n }\n if (this.queues[QueuePriority.low].length) {\n operation = this.queues[QueuePriority.low].pop();\n return operation;\n }\n if (this.queues[QueuePriority.veryLow].length) {\n operation = this.queues[QueuePriority.veryLow].pop();\n return operation;\n }\n return operation;\n }\n\n private _onOperationCancel(operation: Operation<any>): void {\n delete this.map[operation.id];\n delete this.queues[operation.queuePriority];\n this.operations = this.operations.filter(op => op.id !== operation.id);\n if (isObjectEmpty(this.map)) {\n this.emit(QueueEvent.DONE, this);\n this.done();\n }\n }\n\n}","\n/**\n * Events fired from OperationQueue\n */\nexport enum QueueEvent {\n DONE = 'done',\n PAUSED = 'paused',\n RESUMED = 'resumed'\n}","\nimport { Operation } from './Operation';\nimport { OperationQueue } from './OperationQueue';\nimport { BlockOperation } from './BlockOperation';\nimport { GroupOperation } from './GroupOperation';\nimport { OperationEvent } from './OperationEvent';\nimport { QueueEvent } from './QueueEvent';\nimport { QueuePriority } from './QueuePriority';\n\nmodule.exports = {\n Operation,\n OperationQueue,\n BlockOperation,\n GroupOperation,\n OperationEvent,\n QueueEvent,\n QueuePriority\n};","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","import { Operation } from './Operation';\n\nclass CircularOperationValidatorError extends Error {\n constructor(message: string) {\n super();\n this.message = message;\n }\n}\n\nexport class CircularOperationValidator {\n\n private operations: Operation<any>[];\n\n /**\n * @param {Array.<Operation>} operations\n */\n constructor(operations: Operation<any>[]) {\n this.operations = operations;\n this._checkCircular();\n }\n\n _checkCircular() {\n this.operations.forEach((operation: Operation<any>) => {\n operation.dependencies.forEach(op => {\n let map: Object = {};\n map[operation.id] = Object.keys(map).length;\n this._verifyOpMap(op, map); \n this._checkDependencies(op, map)\n });\n });\n }\n\n _checkDependencies(operation: Operation<any>, mapHash: Object) {\n operation.dependencies.forEach((op: Operation<any>) => {\n let map = JSON.parse(JSON.stringify(mapHash));\n this._verifyOpMap(op, map);\n this._checkDependencies(op, map)\n })\n }\n\n /**\n * @param {Operation} op\n * @param map\n * @private\n */\n _verifyOpMap(op: Operation<any>, map: Object) {\n if (map[op.id] !== undefined) {\n this._throwError(op, map)\n }\n\n map[op.id] = Object.keys(map).length;\n }\n\n _throwError(op: Operation<any>, map: Object) {\n let mapValues = {};\n for (let key in map) {\n const value = map[key];\n mapValues[value] = key;\n }\n\n const values = Object.values(mapValues);\n values.push(op.id);\n throw new CircularOperationValidatorError(`Circular: ${values}`);\n }\n\n}","import { Operation } from './Operation';\n\ntype BlockResult = any[] | any;\n\n/**\n * Operation Subclass that accepts a function as an argument which will be the task to run.\n * Additionally, multiple functions can be appended to run simultaneously as the same task.\n */\nexport class BlockOperation extends Operation<any> {\n\n public blocks: Function[];\n\n constructor() {\n let id;\n let block;\n\n const first = arguments[0];\n if (typeof first === 'number') {\n id = first;\n const second = arguments[1];\n if (typeof second === 'function') {\n block = second;\n }\n } else if (typeof first === 'function') {\n block = first;\n } else {\n throw new Error('Wrong arguments passed: missing ID and/or function');\n }\n \n super(id);\n this.blocks = [block];\n }\n\n /**\n *\n */\n async run(): Promise<BlockResult> {\n const promises: any[] = [];\n this.blocks.forEach(block => {\n promises.push(block(this));\n });\n\n const results: any[] = await Promise.all(promises);\n return results.length === 1\n ? results[0]\n : results;\n }\n\n /**\n * Append another function to run simultaneously as the same task\n * @param {function} block - function to add \n */\n addBlock(block: Function) {\n this.blocks.push(block);\n }\n}","import { Operation } from './Operation';\nimport { OperationQueue } from './OperationQueue';\n\ntype GroupResult = any[];\n\n/**\n * @class GroupOperation\n */\nexport class GroupOperation<U> extends Operation<any> {\n\n public operations: Operation<any>[];\n public queue: OperationQueue;\n\n constructor() {\n super();\n this.queue = new OperationQueue(); \n this.operations = [];\n }\n\n /**\n * @override\n * \n * @returns {Promise}\n */\n public async run(): Promise<GroupResult> {\n await this.queue.addOperations(this.operations);\n\n const accum: GroupResult = [];\n return this.operations.reduce((accum, operation) => {\n accum.push(operation.result);\n return accum;\n }, accum);\n }\n\n /**\n * @override\n */\n async start() {\n this.dependencies = [];\n return super.start();\n }\n\n /**\n * @param {Operation} operation \n */\n addOperation(operation: Operation<any>) {\n this.operations.push(operation);\n this.dependencies = [];\n }\n\n /**\n * @param {Array.<Operation>} operations\n */\n addOperations(operations: Operation<any>[]) {\n this.operations = this.operations.concat(operations);\n this.dependencies = [];\n }\n}"],"sourceRoot":""}
\No newline at end of file