@leafer/task 1.8.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/task",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "description": "@leafer/task",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/math": "1.8.0",
26
- "@leafer/debug": "1.8.0"
25
+ "@leafer/math": "1.9.1",
26
+ "@leafer/debug": "1.9.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.8.0"
29
+ "@leafer/interface": "1.9.1"
30
30
  }
31
31
  }
@@ -1,5 +1,5 @@
1
1
  import { IFunction, ITaskProcessor, ITaskProcessorConfig, ITaskOptions, ITaskItem } from '@leafer/interface'
2
- import { DataHelper } from '@leafer/data'
2
+ import { DataHelper, isNumber, isUndefined } from '@leafer/data'
3
3
 
4
4
  import { TaskItem } from './TaskItem'
5
5
 
@@ -62,7 +62,7 @@ export class TaskProcessor implements ITaskProcessor {
62
62
  const task = new TaskItem(taskCallback)
63
63
  task.parent = this
64
64
 
65
- if (typeof options === 'number') {
65
+ if (isNumber(options)) {
66
66
  delay = options
67
67
  } else if (options) {
68
68
  parallel = options.parallel
@@ -74,7 +74,7 @@ export class TaskProcessor implements ITaskProcessor {
74
74
  if (time) task.time = time
75
75
  if (parallel === false) task.parallel = false
76
76
 
77
- if (delay === undefined) {
77
+ if (isUndefined(delay)) {
78
78
  this.push(task, start)
79
79
  } else {
80
80
  this.delayNumber++