mirror of
https://github.com/zoriya/flood.git
synced 2026-05-30 18:10:09 +00:00
Fix baseURI prefix and suffix slashes
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
import BaseStore from './BaseStore';
|
||||
|
||||
const transformConfig = {
|
||||
baseURI: baseURI => baseURI.replace(/\/$/, '')
|
||||
baseURI: baseURI => {
|
||||
const shouldAddSlashEnd = !baseURI.endsWith('/');
|
||||
const shouldAddSlashStart = !baseURI.startsWith('/');
|
||||
|
||||
if (shouldAddSlashEnd) {
|
||||
baseURI = `${baseURI}/`;
|
||||
}
|
||||
|
||||
if (shouldAddSlashStart) {
|
||||
baseURI = `/${baseURI}`;
|
||||
}
|
||||
|
||||
return baseURI;
|
||||
}
|
||||
};
|
||||
|
||||
class ConfigStoreClass extends BaseStore {
|
||||
|
||||
Reference in New Issue
Block a user