Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Aug 8, 2022
1 parent 6d8be3b commit 6327868
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions packages/node-opcua-address-space/source/helpers/argument_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,11 @@ export function isArgumentValid(addressSpace: IAddressSpace, argDefinition: Argu
export function verifyArguments_ArgumentList(
addressSpace: IAddressSpace,
methodInputArguments: Argument[],
inputArguments?: Variant[]
inputArguments: Variant[]
): {
inputArgumentResults?: StatusCode[];
statusCode: StatusCode;
} {
if (!inputArguments) {
// it is possible to not provide inputArguments when method has no arguments
return methodInputArguments.length === 0
? { statusCode: StatusCodes.Good }
: { statusCode: StatusCodes.BadArgumentsMissing };
}

const inputArgumentResults: StatusCode[] = methodInputArguments.map((methodInputArgument, index) => {
const argument = inputArguments![index];
if (!argument) {
Expand Down Expand Up @@ -300,31 +293,4 @@ export function verifyArguments_ArgumentList(
? StatusCodes.BadInvalidArgument
: StatusCodes.Good
};
}

export function build_retrieveInputArgumentsDefinition(
addressSpace: IAddressSpace
): (objectId: NodeId, methodId: NodeId) => Argument[] {
const the_address_space = addressSpace;
return (objectId: NodeId, methodId: NodeId) => {
const response = getMethodDeclaration_ArgumentList(the_address_space, objectId, methodId);

/* istanbul ignore next */
if (response.statusCode !== StatusCodes.Good) {
debugLog(" StatusCode = " + response.statusCode.toString());
throw new Error(
"Invalid Method " +
response.statusCode.toString() +
" ObjectId= " +
objectId.toString() +
"Method Id =" +
methodId.toString()
);
}
const methodDeclaration = response.methodDeclaration!;
// verify input Parameters
const methodInputArguments = methodDeclaration.getInputArguments();
assert(Array.isArray(methodInputArguments));
return methodInputArguments;
};
}
}

0 comments on commit 6327868

Please sign in to comment.