Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public onProducesChange(newValue: string[]): void {
console.info("[InfoSectionComponent] User changed the produces to: ", newValue);
let command: ICommand = CommandFactory.createChangePropertyCommand(this.document, "produces", newValue);
this.commandService.emit(command);
let path = Library.createNodePath(this.document);
path.appendSegment("produces", false);
this.selectionService.select(path.toString());
}
public addMediaType(mediaType: string): void {
let command: ICommand = CommandFactory.createNewMediaTypeCommand(this.parent, mediaType);
this.commandService.emit(command);
let nodePath = Library.createNodePath(this.parent);
nodePath.appendSegment("content", false);
nodePath.appendSegment(mediaType, true);
this.selectionService.select(nodePath.toString());
}
public addExample(exampleData: any): void {
let command: ICommand = CommandFactory.createAddExampleCommand(this.item,
exampleData.value, exampleData.name, null, null);
this.commandService.emit(command);
let nodePath = Library.createNodePath(this.item);
nodePath.appendSegment("examples", false);
this.__selectionService.select(nodePath.toString());
}
public setLicense(licenseInfo: any): void {
let command: ICommand = CommandFactory.createChangeLicenseCommand(licenseInfo.name, licenseInfo.url);
this.commandService.emit(command);
let path = Library.createNodePath(this.document);
path.appendSegment("info", false);
path.appendSegment("license", false);
this.selectionService.select(path.toString());
}
public setDescription(description: string): void {
let command: ICommand = CommandFactory.createChangePropertyCommand(this.scheme, "description", description);
this.commandService.emit(command);
let path = Library.createNodePath(this.scheme);
path.appendSegment("description", false);
this.selectionService.select(path.toString());
}
public selectNode(node: Node): void {
this.select(Library.createNodePath(node).toString());
}
public static nodeToPath(node: Node): string {
if (node) {
return Library.createNodePath(node).toString();
} else {
return null;
}
}