Node.js 是否有一个 URL 模块来解决这个问题?
getCorrectUrl('http://www.domain.com/folder/folder/', '../../img/some.jpg'); // http://www.domain.com/img/some.jpg
getCorrectUrl('http://www.domain.com/folder/folder/', './img/some.jpg'); // http://www.domain.com/img/some.jpg
getCorrectUrl('http://www.domain.com/folder/folder/', 'http://www.domain.com/img/some.jpg'); // http://www.domain.com/img/some.jpg
getCorrectUrl('http://www.domain.com/folder/folder/', '../img/some.jpg'); // http://www.domain.com/folder/img/some.jpg
getCorrectUrl('http://www.domain.com/folder/folder/', 'img/some.jpg'); // http://www.domain.com/folder/folder/img/some.jpg