首页 > TAG信息列表 > DeepReadonly

[Typescript] 18. Medium - Deep Readonly

Implement a generic DeepReadonly<T> which make every parameter of an object - and its sub-objects recursively - readonly. You can assume that we are only dealing with Objects in this challenge. Arrays, Functions, Classes and so on do not need to be

Typescript类型体操 - Deep Readonly

题目 中文 实现一个通用的DeepReadonly<T>,它将对象的每个参数及其子对象递归地设为只读。 您可以假设在此挑战中我们仅处理对象。数组,函数,类等都无需考虑。但是,您仍然可以通过覆盖尽可能多的不同案例来挑战自己。 例如 type X = { x: { a: 1 b: 'hi' } y: 'hey' }