compileBooleanMatcherFromLists = (positiveItems, negativeItems) => {
  if (positiveItems.length === 0) {
    return () => "false";
  }

  if (negativeItems.length === 0) {
    return () => "true";
  }

  if (positiveItems.length === 1) {
    return (value) => `${toSimpleString(positiveItems[0])} == ${value}`;
  }

  if (negativeItems.length === 1) {
    return (value) => `${toSimpleString(negativeItems[0])} != ${value}`;
  }

  const positiveRegexp = itemsToRegexp(positiveItems);
  const negativeRegexp = itemsToRegexp(negativeItems);

  if (positiveRegexp.length <= negativeRegexp.length) {
    return (value) => `/^${positiveRegexp}$/.test(${value})`;
  }

  return (value) => `!/^${negativeRegexp}$/.test(${value})`;
}
@param {string[]} positiveItems positive items
@param {string[]} negativeItems negative items
@returns {function(string): string} a template function to determine the value at runtime