isDirective = (o) => {
    return typeof o === 'function' && directives.has(o);
}
Brands a function as a directive factory function so that lit-html will call
the function during template rendering, rather than passing as a value.

A _directive_ is a function that takes a Part as an argument. It has the
signature: `(part: Part) => void`.

A directive _factory_ is a function that takes arguments for data and
configuration and returns a directive. Users of directive usually refer to
the directive factory as the directive. For example, "The repeat directive".

Usually a template author will invoke a directive factory in their template
with relevant arguments, which will then return a directive function.

Here's an example of using the `repeat()` directive factory that takes an
array and a function to render an item:

```js
html`<ul><${repeat(items, (item) => html`<li>${item}</li>`)}</ul>`
```

When `repeat` is invoked, it returns a directive function that closes over
`items` and the template function. When the outer template is rendered, the
return directive function is called with the Part for the expression.
`repeat` then performs it's custom logic to render multiple items.

@param f The directive factory function. Must be a function that returns a
function of the signature `(part: Part) => void`. The returned function will
be called with the part object.

@example

import {directive, html} from 'lit-html';

const immutable = directive((v) => (part) => {
  if (part.value !== v) {
    part.setValue(v)
  }
});