Papooch / nestjs-cls

A continuation-local storage (async context) module compatible with NestJS's dependency injection.
https://papooch.github.io/nestjs-cls/
MIT License
431 stars 28 forks source link

fix(core): handle setting falsy value in proxy providers #118

Closed alexandre-abrioux closed 8 months ago

alexandre-abrioux commented 8 months ago

This PR fixes setting a falsy value on a proxyfied object. Without the fix, the test fails with the following error when running proxy.booleanTest = false:

'set' on proxy: trap returned falsish for property 'booleanTest'

This behavior is documented here on MDN:

If the set() method returns false, and the assignment happened in strict-mode code, a TypeError will be thrown.

alexandre-abrioux commented 8 months ago

@Papooch Thanks! Done in https://github.com/Papooch/nestjs-cls/pull/118/commits/1623c2188152eb5753537a4134b6429b2bedabda

Papooch commented 8 months ago

Released in 4.0.3