10 lines
330 B
JavaScript
10 lines
330 B
JavaScript
const acceptValue = ['input','textarea','option','select']
|
|
module.exports = (tag, type, attr) => {
|
|
return (
|
|
(attr === 'value' && acceptValue.includes(tag)) && type !== 'button' ||
|
|
(attr === 'selected' && tag === 'option') ||
|
|
(attr === 'checked' && tag === 'input') ||
|
|
(attr === 'muted' && tag === 'video')
|
|
)
|
|
}
|