feat(CollapseItem): add readonly prop (#8445)

This commit is contained in:
neverland
2021-04-01 20:41:56 +08:00
committed by GitHub
parent b594ab1192
commit 65185069bf
8 changed files with 51 additions and 26 deletions
+3 -1
View File
@@ -38,6 +38,8 @@ export function get(object: any, path: string): any {
return result;
}
type Writeable<T> = { -readonly [P in keyof T]: T[P] };
export function pick<T, U extends keyof T>(
obj: T,
keys: ReadonlyArray<U>,
@@ -48,5 +50,5 @@ export function pick<T, U extends keyof T>(
ret[key] = obj[key];
}
return ret;
}, {} as Pick<T, U>);
}, {} as Writeable<Pick<T, U>>);
}