jriecken / dependency-graph

A simple dependency graph for Node.js
http://jriecken.github.io/dependency-graph/
MIT License
333 stars 49 forks source link

Explicitly support using any types as names #48

Open houyonglu opened 9 months ago

houyonglu commented 9 months ago

Added a generic type K to DepGraph to constrain the type of name. This is useful in DI frameworks for handling dependencies between classes. Setting K = string is for backward compatibility. Although currently setting K = any will not cause any breaking changes, I suggest changing it toany in future major versions to align with the types of Map/Set.