mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d07506266c | ||
|
|
cea1d40797 | ||
|
|
0f2dc9f11e | ||
|
|
23250259eb |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sqliteviz",
|
||||
"version": "0.14.0",
|
||||
"version": "0.14.1",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -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}`)
|
||||
|
||||
@@ -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']
|
||||
]
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user