1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 02:28:54 +08:00

add fileUtilities module

This commit is contained in:
lana-k
2021-01-20 17:16:33 +01:00
parent eb1f71608d
commit 86825475f0
3 changed files with 19 additions and 19 deletions

View File

@@ -65,24 +65,6 @@ export default {
return JSON.stringify(preparedData, null, 4)
},
exportQueries (str, fileName, type = 'octet/stream') {
// Create downloader
const downloader = document.createElement('a')
// const name = data.name || 'My sqlitevis queries'
const blob = new Blob([str], { type })
const url = URL.createObjectURL(blob)
downloader.href = url
downloader.download = fileName
// Trigger click
downloader.click()
// Clean up
URL.revokeObjectURL(url)
downloader.remove()
},
/**
* It calls onSuccess with imported queries as argument when
* file read. We can't use Promises here because we can't