* Make a map and return a function for checking if a key * is in that map.
(str, expectsLowerCase)
| 106 | * is in that map. |
| 107 | */ |
| 108 | function makeMap(str, expectsLowerCase) { |
| 109 | var map = Object.create(null); |
| 110 | var list = str.split(","); |
| 111 | for (var i = 0; i < list.length; i++) { |
| 112 | map[list[i]] = true; |
| 113 | } |
| 114 | return expectsLowerCase |
| 115 | ? function(val) { |
| 116 | return map[val.toLowerCase()]; |
| 117 | } |
| 118 | : function(val) { |
| 119 | return map[val]; |
| 120 | }; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Check if a tag is a built-in tag. |
no test coverage detected