Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/schema/lib/pickFormFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function pickFormFields (schema, options) {
for (const key in schema) {
if (shouldIncludeField(key, schema[key], { include, exclude })) {
const field = schema[key]
if (!field.label) field.label = camelCaseToLabel(key)
if (field.label === undefined || field.label === null) field.label = camelCaseToLabel(key)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if (field.label === undefined || field.label === null) field.label = camelCaseToLabel(key)
if (field.label == null) field.label = camelCaseToLabel(key)

это устоявшийся способ проверить является ли undefined или null. И единственное допустимое использование слабого равно == в JS.

} else {
delete schema[key]
}
Expand Down