sindresorhus / normalize-url

Normalize a URL
MIT License
840 stars 122 forks source link

The type definition of removeDirectoryIndex is not correct #154

Closed Robot-Inventor closed 3 years ago

Robot-Inventor commented 3 years ago
normalizeUrl('www.sindresorhus.com/foo/default.php', { removeDirectoryIndex: true });
// Type 'true' is not assignable to type 'readonly (string | RegExp)[] | undefined'.

In readme.md, type of removeDirectoryIndex is boolean | Array<RegExp | string>, but in index.d.ts, it is ReadonlyArray<RegExp | string>.