import { LineResults } from "../LineResults" ; import { CommandNames } from "../Names/CommandNames" ; import { Command } from "./Command" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; import { SingleParameter } from "./Metadata/Parameters/SingleParameter" ; /**
 * Parses a language's alias for a value.
 */ export class ValueCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . Value ) . withDescription ( "Parses a language's alias for a value" ) . withParameters ( [ new SingleParameter ( "value" , "A value to parse." , true ) ] ) ; returns public getMetadata ( ) { return ValueCommand . metadata ; } param parameters returns public render ( parameters ) { return LineResults . newSingleLine ( this . convertValue ( parameters [ 1 ] ) ) ; } param typeNameRaw returns private convertValue ( valueRaw ) { if ( ! { } . hasOwnProperty . call ( this . language . syntax . variables . aliases , valueRaw ) ) { return valueRaw ; } return this . language . syntax . variables . aliases [ valueRaw ] ; } }