diff --git a/src/keyword-set.js b/src/keyword-set.js index 18cf9d8..9d33df5 100644 --- a/src/keyword-set.js +++ b/src/keyword-set.js @@ -1,5 +1,3 @@ -import { strEquals } from "./string-utils.js" - /** * @description A Set-like construct to search CSS keywords in a case-insensitive way */ @@ -7,19 +5,12 @@ export class KeywordSet { /** @param {string[]} items */ constructor(items) { - /** @type {string[]} */ - this.set = items + /** @type {Set} */ + this.set = new Set(items) } /** @param {string} item */ has(item) { - let len = this.set.length - - for (let index = 0; index < len; index++) { - if (strEquals(this.set[index], item)) { - return true - } - } - return false + return this.set.has(item.toLowerCase()) } } \ No newline at end of file