Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace undefsafe with lodash.get #371

Merged
merged 1 commit into from
Feb 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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