codex-marketplace-ui-compon.../utils/attributes.ts

7 lines
243 B
TypeScript
Raw Normal View History

2024-08-20 13:57:58 +00:00
type Attributes = Record<string, unknown>;
export const attributes = (attributes: Attributes) =>
Object.keys(attributes)
.filter((key) => attributes[key] !== false)
.reduce((prev, key) => ({ ...prev, [key]: attributes[key] }), {});