Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(preferenceNames).forEach(function (key) {
html += '<div class="pref-item">'
if (typeof preference[key] === 'boolean') {
html += '<label>'
html += '<input id="' + key + '" type="checkbox">'
html += preferenceNames[key]
html += '</label>'
} else if (key === 'skin-tone-modifier') {
html += '<label for="' + key + '">'
html += preferenceNames[key]
html += '</label>'
html += '<select id="' + key + '">>'
html += `<option value="">None</option>`
modifiers.forEach(function (modifier) {
html += `<option value="${modifier}">${modifier}</option>`
})
html += '</select>'
html += ''
} else {
html += '<label for="' + key + '">'
html += preferenceNames[key]
html += '</label>'
html += '<input placeholder="' + defaultPreference[key] + '" value="' + preference[key] + '" id="' + key + '" type="text">'
}
html += '</div>'
})
html += '<label></label><button type="submit">Save</button>'
Object.keys(preferenceNames).forEach(function (key) {
html += '<div class="pref-item">'
if (typeof preference[key] === 'boolean') {
html += '<label>'
html += '<input id="' + key + '" type="checkbox">'
html += preferenceNames[key]
html += '</label>'
} else if (key === 'skin-tone-modifier') {
html += '<label for="' + key + '">'
html += preferenceNames[key]
html += '</label>'
html += '<select id="' + key + '">>'
html += `<option value="">None</option>`
modifiers.forEach(function (modifier) {
html += `<option value="${modifier}">${modifier}</option>`
})
html += '</select>'
html += ''
} else {
html += '<label for="' + key + '">'
html += preferenceNames[key]
html += '</label>'
html += '<input placeholder="' + defaultPreference[key] + '" value="' + preference[key] + '" id="' + key + '" type="text">'
}
html += '</div>'
})
html += '<label></label><button type="submit">Save</button>'