@@ -0,0 +1,15 @@
+/* global axe */
+/**
+ * Convenience function to extract primary language subtag from a given value
+ * @method getBaseLang
+ * @memberof axe.commons.utils
+ * @instance
+ * @param {String} value value specified as lang or xml:lang attribute
+ * @return {String}
+ */
+axe.utils.getBaseLang = function getBaseLang(lang) {
+	return lang
+		.trim()
+		.split('-')[0]
+		.toLowerCase();
+};
Very minor: I'd suggest letting this function handle the null case, so that you don't have to do it separately a bunch of times.