Add type validation for parameters and fix types
This commit introduces type validation for parameter values within the parser/compiler, aligning with the YAML schema. It aims to eliminate dependencies on side effects in the collection files. This update changes the treatment of data types in the Windows collection, moving away from unintended type casting by the compiler. Previously, numeric and boolean values were used even though only string types were supported. This behavior was unstable and untested, and has now been adjusted to use strings exclusively. Changes ensure that parameter values are correctly validated as strings, enhancing stability and maintainability.
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import type { IFunctionParameter } from '@/application/Parser/Executable/Script/Compiler/Function/Parameter/IFunctionParameter';
|
||||
import type { IFunctionParameterCollection } from '@/application/Parser/Executable/Script/Compiler/Function/Parameter/IFunctionParameterCollection';
|
||||
import type { FunctionParameter } from '@/application/Parser/Executable/Script/Compiler/Function/Parameter/FunctionParameter';
|
||||
import { FunctionParameterStub } from './FunctionParameterStub';
|
||||
|
||||
export class FunctionParameterCollectionStub implements IFunctionParameterCollection {
|
||||
private parameters = new Array<IFunctionParameter>();
|
||||
private parameters = new Array<FunctionParameter>();
|
||||
|
||||
public addParameter(parameter: IFunctionParameter): void {
|
||||
public addParameter(parameter: FunctionParameter): void {
|
||||
this.parameters.push(parameter);
|
||||
}
|
||||
|
||||
public get all(): readonly IFunctionParameter[] {
|
||||
public get all(): readonly FunctionParameter[] {
|
||||
return this.parameters;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user