We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5da8d1 commit 208d44dCopy full SHA for 208d44d
extension/package.json
@@ -1715,7 +1715,7 @@
1715
"appdirs": "1.1.0",
1716
"execa": "5.1.1",
1717
"fs-extra": "11.1.1",
1718
- "json-2-csv": "4.1.1",
+ "json-2-csv": "5.0.0",
1719
"json5": "2.2.3",
1720
"lodash.clonedeep": "4.5.0",
1721
"lodash.get": "4.4.2",
extension/src/fileSystem/index.test.ts
@@ -245,8 +245,8 @@ describe('writeJson', () => {
245
})
246
247
describe('writeCsv', () => {
248
- it('should write csv into given file', async () => {
249
- await writeCsv('file-name.csv', [
+ it('should write csv into given file', () => {
+ writeCsv('file-name.csv', [
250
{ nested: { string: 'string1' }, value: 3 },
251
{ nested: { string: 'string2' }, value: 4 },
252
{ nested: { string: 'string3' }, value: 6 }
@@ -260,8 +260,8 @@ describe('writeCsv', () => {
260
261
262
describe('writeTsv', () => {
263
- it('should write tsv into given file', async () => {
264
- await writeTsv('file-name.tsv', [
+ it('should write tsv into given file', () => {
+ writeTsv('file-name.tsv', [
265
266
267
extension/src/fileSystem/index.ts
@@ -384,19 +384,13 @@ export const writeJson = <
384
return writeFile(path, json)
385
}
386
387
-export const writeCsv = async (
388
- path: string,
389
- arr: Array<Record<string, unknown>>
390
-) => {
391
- const csv = await json2csv(arr)
+export const writeCsv = (path: string, arr: Array<Record<string, unknown>>) => {
+ const csv = json2csv(arr)
392
return writeFile(path, csv)
393
394
395
-export const writeTsv = async (
396
397
398
399
- const csv = await json2csv(arr, { delimiter: { field: '\t' } })
+export const writeTsv = (path: string, arr: Array<Record<string, unknown>>) => {
+ const csv = json2csv(arr, { delimiter: { field: '\t' } })
400
401
402
extension/src/plots/model/index.ts
@@ -236,10 +236,7 @@ export class PlotsModel extends ModelWithPersistence {
236
237
238
public savePlotDataAsJson(filePath: string, plotId: string) {
239
- void this.savePlotData(filePath, plotId, data => {
240
- writeJson(filePath, data, true)
241
- return Promise.resolve()
242
- })
+ this.savePlotData(filePath, plotId, data => writeJson(filePath, data, true))
243
244
public savePlotDataAsCsv(filePath: string, plotId: string) {
@@ -508,10 +505,10 @@ export class PlotsModel extends ModelWithPersistence {
508
505
return collectCustomPlotRawData(orderValue, experiments)
509
506
510
507
511
- private async savePlotData(
+ private savePlotData(
512
filePath: string,
513
plotId: string,
514
- writeToFile: (rawData: Array<Record<string, unknown>>) => Promise<void>
+ writeToFile: (rawData: Array<Record<string, unknown>>) => void
515
) {
516
const foundCustomPlot = this.customPlotsOrder.find(
517
({ metric, param }) => getCustomPlotId(metric, param) === plotId
@@ -522,7 +519,7 @@ export class PlotsModel extends ModelWithPersistence {
522
519
: this.getSelectedTemplatePlotData(plotId)
523
520
524
521
try {
525
- await writeToFile(rawData)
+ writeToFile(rawData)
526
void openFileInEditor(filePath)
527
} catch {
528
void Toast.showError('Cannot write to file')
yarn.lock
@@ -15595,10 +15595,10 @@ jsesc@~0.5.0:
15595
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
15596
integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=
15597
15598
-json-2-csv@4.1.1:
15599
- version "4.1.1"
15600
- resolved "https://registry.yarnpkg.com/json-2-csv/-/json-2-csv-4.1.1.tgz#ebba9c7dd60a35675ab47435cb19e716249e5163"
15601
- integrity sha512-xqP/61jVw6hlW5a+JuffbfGneYxuKOIixdSjmLtBY/qeNgMIzTc+vLRkTkLwb+ZVLHMqmJz64brY9U34BvIHZA==
+json-2-csv@5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/json-2-csv/-/json-2-csv-5.0.0.tgz#c8f8fc688a5c7460d48e01bce54c494f631b8bca"
+ integrity sha512-7+LmJmeO1UJqt8sqVYiSe5ufWGWPt1TwfdBSgCFLz66fq4jrX3K7+g8+J9gYc/Yp6VMfNhBSfZgaapBSt70IRQ==
15602
dependencies:
15603
deeks "3.0.2"
15604
doc-path "4.0.2"
0 commit comments