tsyringe icon indicating copy to clipboard operation
tsyringe copied to clipboard

refine value provider check if user passes a 'undefined' value

Open intellild opened this issue 3 years ago • 2 comments

If user pass { useValue: undefined }, isProvider returns false, causing https://github.com/microsoft/tsyringe/blob/f738999f3058b223bdb81dada0164a358db2460e/src/dependency-container.ts#L91 treat the object as a class

intellild avatar Jul 29 '22 03:07 intellild

Fixed this in tsyringe-neo

risenxxx avatar Jul 19 '24 16:07 risenxxx

What is the use case to register undefined for a certain token? Would using the new isOptional property of @inject solve this?

etiennenoel avatar Apr 06 '25 04:04 etiennenoel