fix parse kv
This commit is contained in:
@@ -936,20 +936,24 @@ export const isKnownUri = (uri:string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function parseKeyValue(template:string){
|
export function parseKeyValue(template:string){
|
||||||
if(!template){
|
try {
|
||||||
|
if(!template){
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
const keyValue:[string, string][] = []
|
||||||
|
|
||||||
|
for(const line of template.split('\n')){
|
||||||
|
const [key, value] = line.split('=')
|
||||||
|
if(key && value){
|
||||||
|
keyValue.push([key, value])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return keyValue
|
||||||
|
} catch (error) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyValue:[string, string][] = []
|
|
||||||
|
|
||||||
for(const line of template.split('\n')){
|
|
||||||
const [key, value] = line.split('=')
|
|
||||||
if(key && value){
|
|
||||||
keyValue.push([key, value])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return keyValue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sortableOptions = {
|
export const sortableOptions = {
|
||||||
|
|||||||
Reference in New Issue
Block a user