1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

4 Commits

Author SHA1 Message Date
lana-k
d07506266c fix lint error 2021-07-15 22:41:36 +02:00
lana-k
cea1d40797 Merge branch 'master' of github.com:lana-k/sqliteviz 2021-07-15 22:36:33 +02:00
lana-k
0f2dc9f11e fix ISO time columns when no column names #66 2021-07-15 22:36:07 +02:00
lana-k
23250259eb Update package.json 2021-07-04 13:57:13 +02:00
3 changed files with 9 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sqliteviz",
"version": "0.14.0",
"version": "0.14.1",
"license": "Apache-2.0",
"private": true,
"scripts": {

View File

@@ -24,7 +24,9 @@ export default {
return resultRow
})
} else {
result.values = source.data
result.values = source.data.map(row => row.map(value =>
value instanceof Date ? value.toISOString() : value
))
result.columns = []
for (let i = 1; i <= source.data[0].length; i++) {
result.columns.push(`col${i}`)

View File

@@ -30,16 +30,16 @@ describe('csv.js', () => {
it('getResult without fields', () => {
const source = {
data: [
[1, 'foo'],
[2, 'bar']
[1, 'foo', new Date('2021-06-30T14:10:24.717Z')],
[2, 'bar', new Date('2021-07-30T14:10:15.717Z')]
],
meta: {}
}
expect(csv.getResult(source)).to.eql({
columns: ['col1', 'col2'],
columns: ['col1', 'col2', 'col3'],
values: [
[1, 'foo'],
[2, 'bar']
[1, 'foo', '2021-06-30T14:10:24.717Z'],
[2, 'bar', '2021-07-30T14:10:15.717Z']
]
})
})