From 02e4fb51819fc684552c1aeb34c56f29baca625f Mon Sep 17 00:00:00 2001 From: Nick Elsbree Date: Mon, 27 Jul 2015 10:21:53 -0700 Subject: [PATCH] Throw error when insertAt parameter is not 'top' or 'bottom'. --- addStyles.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addStyles.js b/addStyles.js index c693b0b..5c6023f 100644 --- a/addStyles.js +++ b/addStyles.js @@ -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; }