Set labels = undefined if pocket tags is undefined
This commit is contained in:
@ -14,7 +14,7 @@ export const importCsv = async (ctx: ImportContext, stream: Stream) => {
|
||||
try {
|
||||
const url = new URL(row[0])
|
||||
const state = row.length > 1 ? row[1] : undefined
|
||||
// labels follows format: "[label1,label2]" or "[]"
|
||||
// labels follows format: "[label1,label2]"
|
||||
const labels =
|
||||
row.length > 2
|
||||
? (row[2] as string)
|
||||
|
||||
@ -83,7 +83,7 @@ describe('Load a complex CSV file', () => {
|
||||
{
|
||||
url: new URL('https://test.com'),
|
||||
state: 'SUCCEEDED',
|
||||
labels: [],
|
||||
labels: ['test', 'development'],
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
"https://omnivore.app",ARCHIVED,"[test]"
|
||||
"https://google.com",SUCCEEDED,"[test,development]"
|
||||
https://test.com,SUCCEEDED,"[]"
|
||||
https://test.com,SUCCEEDED,"[test, development]"
|
||||
|
||||
|
Reference in New Issue
Block a user