Fix bug when dependency type doesn't exist in package

Have to check that the dependencyType is in the package_json first. This should also be a slight optimization over the alternative default value approach