Skip to content

Commit feea078

Browse files
committed
parse Date type instead of string
1 parent f28b392 commit feea078

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/templates/partials/base.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{{~#equals @root.httpClient 'axios'}}Blob{{/equals~}}
55
{{~#equals @root.httpClient 'angular'}}Blob{{/equals~}}
66
{{~#equals @root.httpClient 'node'}}Blob{{/equals~}}
7+
{{~else equals format 'date-time'~}}
8+
Date
79
{{~else~}}
810
{{{base}}}
9-
{{~/equals~}}
11+
{{~/equals~}}

src/utils/exportData.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import fs from 'fs';
2+
3+
export const genOutput = (data: any, fileName = 'output') => {
4+
fs.writeFile(`${fileName}.json`, JSON.stringify(data, null, 2), err => {
5+
if (err) {
6+
console.error('Error writing file', err);
7+
} else {
8+
console.log('Successfully wrote file');
9+
}
10+
});
11+
};

0 commit comments

Comments
 (0)