You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
460 B
17 lines
460 B
5 months ago
|
var staticLocation = require('./staticLocation')
|
||
|
|
||
|
var helperGetLocatOrigin = require('./helperGetLocatOrigin')
|
||
|
|
||
|
var lastIndexOf = require('./lastIndexOf')
|
||
|
|
||
|
function getBaseURL () {
|
||
|
if (staticLocation) {
|
||
|
var pathname = staticLocation.pathname
|
||
|
var lastIndex = lastIndexOf(pathname, '/') + 1
|
||
|
return helperGetLocatOrigin() + (lastIndex === pathname.length ? pathname : pathname.substring(0, lastIndex))
|
||
|
}
|
||
|
return ''
|
||
|
}
|
||
|
|
||
|
module.exports = getBaseURL
|