1.2.3 • Published 10 years ago
strong-url-defaults v1.2.3
strong-url-defaults
Normalize URLs, providing defaults and overrides.
defaults = require('strong-url-defaults')
Exports a single function, defaults().
url = defaults(url, defaults, overrides)
- url {String} url to reformat
- defaults {Object} components to set on
urlif they were not already set. - overrides {Object} components to set on
urleven if they were already set.
Defaults can be any of:
hostportauth
Its not possible to distinguish with url.parse() whether a path was supplied,
so it can't be "defaulted".
Overrides can be any of:
protocolhostportpathauth