Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public save(): void {
this.editMode = false;
console.info("[EditorTitleBarComponent] User changed the title to: " + this.newTitle);
let command: ICommand = CommandFactory.createChangeTitleCommand(this.newTitle);
this.commandService.emit(command);
}
public cloneApi(): string {
let sourceDoc: Document = this.document;
CommandFactory.createChangeTitleCommand(this.title).execute(sourceDoc);
if (sourceDoc.getDocumentType() == DocumentType.openapi2 && this.convertApi) {
console.info("[CopyPageComponent] Converting API from 2.0 to 3.0.x!");
sourceDoc = this.transformDocument(sourceDoc as Oas20Document);
}
let sourceJs: any = Library.writeNode(sourceDoc);
let sourceStr: string = JSON.stringify(sourceJs);
let sourceB64: string = Base64.encode(sourceStr);
return sourceB64;
}