timepiece/node_modules/lit-html/node/development/directives/if-defined.js

18 lines
463 B
JavaScript
Raw Normal View History

2024-05-14 14:54:12 +00:00
import { nothing } from '../lit-html.js';
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* For AttributeParts, sets the attribute if the value is defined and removes
* the attribute if the value is undefined.
*
* For other part types, this directive is a no-op.
*/
const ifDefined = (value) => value !== null && value !== void 0 ? value : nothing;
export { ifDefined };
//# sourceMappingURL=if-defined.js.map