Skip to content

Check for function existence #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ var merge = function merge(schema, form, ignore, options, readonly) {

var stdForm = getDefaults(schema, ignore, options);
// simple case, we have a "*", just put the stdForm there
var idx = form.indexOf("*");
var idx = form.indexOf && form.indexOf("*") || -1;
if (idx !== -1) {
form = form.slice(0, idx).concat(stdForm.form).concat(form.slice(idx + 1));
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ const merge = (schema, form, ignore, options, readonly) => {

const stdForm = getDefaults(schema, ignore, options);
// simple case, we have a "*", just put the stdForm there
const idx = form.indexOf("*");
const idx = form.indexOf && form.indexOf("*") || -1;
if (idx !== -1) {
form = form
.slice(0, idx)
Expand Down