src/directives/if-defined.js
function ifDefinedDirective(value) {
  return function(part) {
    if (value === undefined && isAttributePart(part)) {
      return part.setValue(nothingString);
    }
    part.setValue(value);
  };
}
function ifDefinedDirective(value) {
  return function(part) {
    if (value === undefined && isAttributePart(part)) {
      return part.setValue(nothingString);
    }
    part.setValue(value);
  };
}
function ifDefinedDirective ( value ) { return function ( part ) { if ( value === undefined && isAttributePart ( part ) ) { return part . setValue ( nothingString ) ; } part . setValue ( value ) ; } ; }
Sets the attribute if 'value' is defined,
removes the attribute if undefined.

@param { any } value
@returns { (part: AttributePart) => void }
Sets the attribute if value is defined removes the attribute if undefined .