question-store
Advanced tools
Comparing version 0.2.2 to 0.2.3
24
index.js
@@ -10,3 +10,4 @@ /*! | ||
var Emitter = require('component-emitter'); | ||
var util = require('util'); | ||
var Options = require('option-cache'); | ||
var Question = require('./lib/question'); | ||
@@ -30,3 +31,3 @@ var utils = require('./lib/utils'); | ||
this.options = options || {}; | ||
Options.apply(this, arguments); | ||
if (this.options.force === true) { | ||
@@ -44,6 +45,6 @@ this.options.forceAll = true; | ||
/** | ||
* Inherit emitter | ||
* Mixin `Emitter` methods | ||
*/ | ||
Emitter(Questions.prototype); | ||
util.inherits(Questions, Options); | ||
@@ -352,2 +353,5 @@ /** | ||
// force exit if "ctrl+c" is pressed | ||
utils.forceExit(); | ||
setImmediate(function() { | ||
@@ -385,2 +389,3 @@ utils.async.reduce(questions, {}, function(answers, question, next) { | ||
var len = keys.length, i = -1; | ||
var queue = []; | ||
var arr = []; | ||
@@ -391,3 +396,6 @@ | ||
if (utils.isObject(key) && key.isQuestion) { | ||
arr.push(key); | ||
if (queue.indexOf(key.name) === -1) { | ||
queue.push(key.name); | ||
arr.push(key); | ||
} | ||
continue; | ||
@@ -403,3 +411,7 @@ } | ||
} | ||
if (question) arr.push(question); | ||
if (question && queue.indexOf(question.name) === -1) { | ||
queue.push(question.name); | ||
arr.push(question); | ||
} | ||
} | ||
@@ -406,0 +418,0 @@ } |
@@ -216,5 +216,2 @@ /*! | ||
// force exit if "ctrl+c" is pressed | ||
utils.forceExit(); | ||
setImmediate(function() { | ||
@@ -221,0 +218,0 @@ this.inquirer.prompt(opts, function(answer) { |
@@ -18,8 +18,12 @@ 'use strict'; | ||
require('get-value', 'get'); | ||
require('resolve-dir'); | ||
require('object-visit', 'visit'); | ||
require('inquirer2', 'inquirer'); | ||
require('resolve-dir'); | ||
require('async'); | ||
require = fn; | ||
/** | ||
* Force exit if "ctrl+c" is pressed | ||
*/ | ||
utils.forceExit = function() { | ||
@@ -26,0 +30,0 @@ var stdin = process.stdin; |
{ | ||
"name": "question-store", | ||
"description": "Ask questions, persist the answers. Basic support for i18n and storing answers based on current working directory.", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"homepage": "https://github.com/jonschlinkert/question-store", | ||
@@ -26,3 +26,2 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"async": "^1.5.0", | ||
"component-emitter": "^1.2.0", | ||
"define-property": "^0.2.5", | ||
@@ -36,2 +35,3 @@ "extend-shallow": "^2.0.1", | ||
"object-visit": "^0.3.4", | ||
"option-cache": "^3.2.0", | ||
"resolve-dir": "^0.1.0", | ||
@@ -38,0 +38,0 @@ "set-value": "^0.3.1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32305
809
+ Addedoption-cache@^3.2.0
+ Addedcollection-visit@1.0.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedkind-of@3.2.2(transitive)
+ Addedlazy-cache@2.0.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedoption-cache@3.5.0(transitive)
+ Addedset-getter@0.1.1(transitive)
+ Addedset-value@0.4.3(transitive)
+ Addedto-object-path@0.3.0(transitive)
- Removedcomponent-emitter@^1.2.0