Skip to content

Commit

Permalink
chore: replace undefsafe with lodash.get
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill89 committed Feb 17, 2019
1 parent f124e0b commit d448d88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"source-map-support": "^0.5.9",
"tempfile": "^2.0.0",
"then-fs": "^2.0.0",
"undefsafe": "^2.0.0",
"update-notifier": "^2.5.0",
"uuid": "^3.2.1"
},
Expand Down
5 changes: 2 additions & 3 deletions src/cli/commands/protect/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var fmt = require('util').format;
var debug = require('debug')('snyk');
var protect = require('../../../lib/protect');
var moduleToObject = require('snyk-module');
var undefsafe = require('undefsafe');
var config = require('../../../lib/config');
var snykPolicy = require('snyk-policy');
var chalk = require('chalk');
Expand Down Expand Up @@ -851,7 +850,7 @@ function nextSteps(pkg, prevAnswers) {
var prompts = [];
var i;

i = (undefsafe(pkg, 'scripts.test') || '').indexOf('snyk test');
i = _.get(pkg, 'scripts.test', '').indexOf('snyk test');
if (i === -1) {
prompts.push({
name: 'misc-add-test',
Expand All @@ -868,7 +867,7 @@ function nextSteps(pkg, prevAnswers) {
return prompts;
}

i = (undefsafe(pkg, 'scripts.prepublish') || '').indexOf('snyk-pro');
i = _.get(pkg, 'scripts.prepublish', '').indexOf('snyk-pro');

// if `snyk protect` doesn't already appear, then check if we need to add it
if (i === -1) {
Expand Down

0 comments on commit d448d88

Please sign in to comment.