if-defined.js 445 B

1234567891011121314
  1. /**
  2. * @license
  3. * Copyright 2018 Google LLC
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. import { nothing } from '../lit-html.js';
  7. /**
  8. * For AttributeParts, sets the attribute if the value is defined and removes
  9. * the attribute if the value is undefined.
  10. *
  11. * For other part types, this directive is a no-op.
  12. */
  13. export const ifDefined = (value) => value !== null && value !== void 0 ? value : nothing;
  14. //# sourceMappingURL=if-defined.js.map