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);
|
||||
} else if (options.insertAt === "bottom") {
|
||||
head.appendChild(styleElement);
|
||||
} else {
|
||||
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
||||
}
|
||||
return styleElement;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue