7 lines
243 B
TypeScript
7 lines
243 B
TypeScript
|
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] }), {});
|