Skip to content

Commit

Permalink
chore(check): check object using schema
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Jun 25, 2017
1 parent 90b9229 commit cb105d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/revert.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
const debug = require('debug')('next-update')
const is = require('check-more-types')
const la = require('lazy-ass')
var getDependenciesToCheck = require('./dependencies')
var installModule = require('./module-install')
var q = require('q')

const isRevertInfo = is.schema({
name: is.unemptyString,
version: is.unemptyString
})

// returns promise
function revert (moduleName) {
if (moduleName) {
Expand All @@ -14,6 +21,7 @@ function revert (moduleName) {
debug(toCheck)

var installPromises = toCheck.map(function (info) {
la(isRevertInfo(info), 'invalid revert info', info)
return installModule.bind(null, {
name: info.name,
version: info.version,
Expand Down

0 comments on commit cb105d1

Please sign in to comment.