Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for (const param of apiFunction.params) {
// FIXME: any
if (apiFunction.documentation.parameters[param.name] == null) {
apiFunction.documentation.parameters[param.name] = {} as any;
}
this.visitApiParam(param, apiFunction.documentation.parameters[param.name]);
}
const returnValueNode: IReturn = {
type: apiFunction.returnType,
description: apiFunction.documentation.returnsMessage
};
const newNode: Object = {
kind: ApiJsonFile.convertKindToJson(apiFunction.kind),
returnValue: returnValueNode,
parameters: apiFunction.documentation.parameters,
deprecatedMessage: apiFunction.documentation.deprecatedMessage || [],
summary: apiFunction.documentation.summary || [],
remarks: apiFunction.documentation.remarks || [],
isBeta: apiFunction.documentation.releaseTag === ReleaseTag.Beta
};
if (refObject != null) {
refObject[apiFunction.name] = newNode;
}
}
newNode = {
kind: ApiJsonFile.convertKindToJson(ApiItemKind.Constructor),
signature: apiMethod.getDeclarationLine(),
parameters: apiMethod.documentation.parameters || {},
deprecatedMessage: apiMethod.documentation.deprecatedMessage || [],
summary: apiMethod.documentation.summary || [],
remarks: apiMethod.documentation.remarks || []
};
} else {
const returnValueNode: IReturn = {
type: apiMethod.returnType,
description: apiMethod.documentation.returnsMessage
};
newNode = {
kind: ApiJsonFile.convertKindToJson(apiMethod.kind),
signature: apiMethod.getDeclarationLine(),
accessModifier: apiMethod.accessModifier ? AccessModifier[apiMethod.accessModifier].toLowerCase() : "",
isOptional: !!apiMethod.isOptional,
isStatic: !!apiMethod.isStatic,
returnValue: returnValueNode,
parameters: apiMethod.documentation.parameters,
deprecatedMessage: apiMethod.documentation.deprecatedMessage || [],
summary: apiMethod.documentation.summary || [],
remarks: apiMethod.documentation.remarks || [],
isBeta: apiMethod.documentation.releaseTag === ReleaseTag.Beta
};
}
if (refObject != null) {
refObject[apiMethod.name] = newNode;
}