Skip to content

Commit

Permalink
Remove DeepReadonly and its implications
Browse files Browse the repository at this point in the history
  • Loading branch information
2colours committed Mar 6, 2024
1 parent 4e13943 commit 64a4d67
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions common/common-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,19 @@ export class Command {
readonly name: string;
readonly helpRelated: HelpInfo;
readonly type: CommandType;
constructor(baseData: DeepReadonly<CommandRawData>) {
constructor(baseData: CommandRawData) {
this.type = baseData.type;
this.name = baseData.name;
let orderedFilters = Array.from(baseData.filters as Set<Filter>);
let orderedFilters = Array.from(baseData.filters);
orderedFilters.sort(Filter.compare);
this.decoratedAction = aggregateDecorators(orderedFilters.map(elem => elem.decorator))(baseData.action as Action);
this.decoratedAction = aggregateDecorators(orderedFilters.map(elem => elem.decorator))(baseData.action);
this.helpRelated = {
requirements: orderedFilters.map(elem => elem.description),
params: baseData.params as ParameterData[],
params: baseData.params,
ownDescription: baseData.descrip
};
}
}
export type DeepReadonly<T> = { readonly [K in keyof T]: DeepReadonly<T[K]> }
export type CommandType = 'unlimited' | 'adminOnly' | 'grantable' | 'creatorsOnly';
export interface HelpInfo {
requirements: string[];
Expand Down

0 comments on commit 64a4d67

Please sign in to comment.