import { LineResults } from "../LineResults" ; import { CommandNames } from "../Names/CommandNames" ; import { Command } from "./Command" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; import { SingleParameter } from "./Metadata/Parameters/SingleParameter" ; /**
 * Checks whether a variable is not null.
 */ export class IsNotNullCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . IsNotNull ) . withDescription ( "Checks whether a variable is not null" ) . withParameters ( [ new SingleParameter ( "value" , "A value to check against null." , true ) ] ) ; returns public getMetadata ( ) { return IsNotNullCommand . metadata ; } param parameters returns public render ( parameters ) { const left = this . language . syntax . variables . isNotNullLeft ; const middle = this . language . syntax . variables . isNotNullMiddle ; const right = this . language . syntax . variables . nullRight ; return LineResults . newSingleLine ( left + parameters [ 1 ] + middle + right ) ; } }