Download ant-design/components/_util/extendsObject.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 577 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/components/_util/extendsObject.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/components/_util/extendsObject.ts
-
curl -L -o extendsObject.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/components/_util/extendsObject.ts
577 Bytes
| // copied https://github.com/ant-design/ant-design-mobile/blob/d3b3bae/src/utils/with-default-props.tsx | |
| function mergeProps<A, B>(a: A, b: B): B & A; | |
| function mergeProps<A, B, C>(a: A, b: B, c: C): C & B & A; | |
| function mergeProps<A, B, C, D>(a: A, b: B, c: C, d: D): D & C & B & A; | |
| function mergeProps(...items: any[]) { | |
| const ret: any = {}; | |
| items.forEach((item) => { | |
| if (item) { | |
| Object.keys(item).forEach((key) => { | |
| if (item[key] !== undefined) { | |
| ret[key] = item[key]; | |
| } | |
| }); | |
| } | |
| }); | |
| return ret; | |
| } | |
| export default mergeProps; | |