Throw error when insertAt parameter is not 'top' or 'bottom'.
parent
99d8fe064c
commit
02e4fb5181
|
@ -106,6 +106,8 @@ function createStyleElement(options) {
|
||||||
head.insertBefore(styleElement, head.firstChild);
|
head.insertBefore(styleElement, head.firstChild);
|
||||||
} else if (options.insertAt === "bottom") {
|
} else if (options.insertAt === "bottom") {
|
||||||
head.appendChild(styleElement);
|
head.appendChild(styleElement);
|
||||||
|
} else {
|
||||||
|
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
||||||
}
|
}
|
||||||
return styleElement;
|
return styleElement;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue