listr
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -8,7 +8,4 @@ 'use strict'; | ||
const state = require('./state'); | ||
const utils = require('./utils'); | ||
const isListr = obj => obj && obj.setRenderer && obj.add && obj.run; | ||
// https://github.com/sindresorhus/is-observable/issues/1 | ||
const isObservable = obj => obj && typeof obj.subscribe === 'function' && typeof obj.constructor.create === 'function'; | ||
const defaultSkipFn = () => false; | ||
@@ -90,3 +87,3 @@ | ||
// Detect the subtask | ||
if (isListr(result)) { | ||
if (utils.isListr(result)) { | ||
result.setRenderer(renderers.silent); | ||
@@ -108,3 +105,3 @@ this._subtasks = result.tasks; | ||
// Detect Observable | ||
if (isObservable(result)) { | ||
if (utils.isObservable(result)) { | ||
result = new Promise((resolve, reject) => { | ||
@@ -111,0 +108,0 @@ result.subscribe({ |
{ | ||
"name": "listr", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Terminal task list", | ||
@@ -61,3 +61,4 @@ "license": "MIT", | ||
"hook-std": "^0.2.0", | ||
"xo": "*" | ||
"xo": "*", | ||
"zen-observable": "^0.3.0" | ||
}, | ||
@@ -64,0 +65,0 @@ "xo": { |
14289
8
227
6