Build URLS from JSON
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've created a function that can build nested urls like so. I was wondering if there existed a more mainstream library to build urls / uris like this. I'd rather use a standard. utility.urlConstruct({ "scheme": "https://", "domain": "domain.com", "path": "/login", "query":{ "user":"thomasreggi", "from":utility.urlConstruct({ "scheme": "https://", "domain": "redirect.com", "path": "/funstuff", }), } }); Spits out https://domain.com/login?user=thomasreggi&from=https%3A%2F%2Fredirect.com%2Ffunstuff 回答1: The correct answer is node's built in URL