feat(parse): local type is now file

This commit is contained in:
Julien Fontanet 2016-06-08 14:38:31 +02:00
parent 45a94fe73d
commit 2451ac3ade
2 changed files with 14 additions and 4 deletions

View File

@ -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'

View File

@ -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'
}
}
})
// -------------------------------------------------------------------