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: Improve propertySetup error handling #1023

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/transform/propertySetup.js
Expand Up @@ -29,7 +29,7 @@ function propertySetup(property, name, path) {
if (!property && !_.isPlainObject(property))
throw new Error('Property object must be an object');
if (!name || !_.isString(name))
throw new Error('Name must be a string');
throw new Error('Name must be a string at path: ' + _.isArray(path) ? path.join('.') : path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In v4 we're aiming to ditch lodash and es6 helpers, you can use native Array.isArray() instead

if (!path || !_.isArray(path))
throw new Error('Path must be an array');

Expand Down