Skip to content

Conversation

@k0stik
Copy link
Member

@k0stik k0stik commented Feb 23, 2024

No description provided.

* @returns {*}
*/
prop<T>(name: string, defaultValue: T | null = null): unknown {
prop<T = undefined>(name: string, defaultValue?: T): T | undefined {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I replaced default return value from null to undefined
The prop() must return undefined instead of null.
Next problem happened in web-app's class ServiceLevel:

get expirationPeriodType() {
     return this.prop("expirationPeriodType");
}

setExpirationTypeAndDate(type = "monthly") {
   // expect the `type` prop to be "monthly" if empty, but receive `null`
}

serviceLevel.setExpirationTypeAndDate(serviceLevel.expirationPeriodType);

@k0stik k0stik merged commit 766605b into main Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants