express-remove-route
express-remove-route copied to clipboard
TypeScript enablement, yarn 2 compatibility, removal awareness
TypeScript enablement: added definition file and tweaked the package to ensure usage in order to better integrate in TypeScript contexts; this required adding the @types/express package as an optional dependency in order to ensure JS environments are not affected
Yarn 2 compatibility: yarn warns out when dealing with undefined dependencies, as such I took the liberty of removing (rather then declaring as dependency) underscore module. The usage was to check if provided method was empty (has 0 lenght) while method was further expected to be a string: !method || method.trim().length === 0
Route removals will properly inform the outer context if any route matching the search criterias have been removed.