Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public changeType(newType: SimplifiedType): void {
let nt: SimplifiedPropertyType = new SimplifiedPropertyType();
nt.required = this.model().required;
nt.type = newType.type;
nt.enum_ = newType.enum_;
nt.of = newType.of;
nt.as = newType.as;
let command: ICommand = CommandFactory.createChangePropertyTypeCommand(this.item, nt);
this.commandService.emit(command);
this._model = nt;
}
public changeRequired(newValue: string): void {
this.model().required = newValue === "required";
let nt: SimplifiedPropertyType = SimplifiedPropertyType.fromPropertySchema(this.item);
nt.required = this.model().required;
let command: ICommand = CommandFactory.createChangePropertyTypeCommand(this.item, nt);
this.commandService.emit(command);
}