mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 11:32:52 +08:00
9 lines
226 B
TypeScript
9 lines
226 B
TypeScript
export default function getDataAttributes(props: any) {
|
|
return Object.keys(props).reduce((prev: any, key: string) => {
|
|
if (key.substr(0, 5) === 'data-') {
|
|
prev[key] = props[key];
|
|
}
|
|
return prev;
|
|
}, {});
|
|
}
|