feat(parse): local type is now file
This commit is contained in:
parent
45a94fe73d
commit
2451ac3ade
@ -10,7 +10,7 @@ export const parse = string => {
|
||||
|
||||
const [type, rest] = string.split('://')
|
||||
if (type === 'file') {
|
||||
object.type = 'local'
|
||||
object.type = 'file'
|
||||
object.path = `/${trimStart(rest, '/')}` // the leading slash has been forgotten on client side first implementation
|
||||
} else if (type === 'nfs') {
|
||||
object.type = 'nfs'
|
||||
|
@ -14,7 +14,7 @@ const data = deepFreeze({
|
||||
file: {
|
||||
string: 'file:///var/lib/xoa/backup',
|
||||
object: {
|
||||
type: 'local',
|
||||
type: 'file',
|
||||
path: '/var/lib/xoa/backup'
|
||||
}
|
||||
},
|
||||
@ -37,13 +37,23 @@ const parseData = deepFreeze({
|
||||
'file with missing leading slash (#7)': {
|
||||
string: 'file://var/lib/xoa/backup',
|
||||
object: {
|
||||
type: 'local',
|
||||
type: 'file',
|
||||
path: '/var/lib/xoa/backup'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const formatData = data
|
||||
const formatData = deepFreeze({
|
||||
...data,
|
||||
|
||||
'file with local type': {
|
||||
string: 'file:///var/lib/xoa/backup',
|
||||
object: {
|
||||
type: 'local',
|
||||
path: '/var/lib/xoa/backup'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user