SED-4855 Decommission the Keyword packages - #1451
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the deprecated "Keyword Packages" feature, including all its associated services, components, models, and modules (such as FunctionPackagesModule, KeywordPackagesService, and FunctionPackageTypeRegistryService) from the codebase. Feedback was provided regarding an unsafe non-null assertion (!) on keyword.attributes in function.module.ts, suggesting the use of optional chaining with a fallback value to prevent potential runtime errors.
| map((keyword) => keyword.attributes!['name']), | ||
| map((name) => `${name}.sta`), |
There was a problem hiding this comment.
The use of the non-null assertion operator (!) on keyword.attributes is unsafe because the attributes property is optional on the Function type. This could lead to a runtime error if attributes is undefined. It's safer to use optional chaining (?.) and provide a fallback value for the name, such as the keyword's ID which is available in the id constant. Additionally, combining the two map operators will make the code more concise.
map((keyword) => `${keyword.attributes?.['name'] || id}.sta`)
No description provided.