Skip to content

Commit b75cc9a

Browse files
authored
Merge pull request #6 from jaychang99/release/v0.1.0-alpha
Release/v0.1.0 alpha
2 parents f8a2e0a + 0143fc0 commit b75cc9a

15 files changed

+675
-78
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A Workflow that runs on pull requests and diffs any api changes based on
1313

1414
```bash
1515
npm install
16-
npm run package:local # This compiles ts files and watches for changes
16+
npm run package:watch:local # This compiles ts files and watches for changes
1717
npm run dev:nodemon # This starts a local development server on localhost:5050
1818
```
1919

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 219 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
type TableArgType<T> = {
2+
headers: string[]
3+
dataIndex: string[]
4+
rows: T[]
5+
}
6+
7+
export const tableFromObject = <T extends { [key: string]: string }>({
8+
headers,
9+
dataIndex,
10+
rows
11+
}: TableArgType<T>): string => {
12+
const headerRow = headers.join(' | ')
13+
const headerSeparator = headers.map(() => '---').join(' | ')
14+
const bodyRows = rows
15+
.map(row => {
16+
return dataIndex.map(index => row[index]).join(' | ')
17+
})
18+
.join('\n')
19+
20+
return `${headerRow}\n${headerSeparator}\n${bodyRows}`
21+
}

0 commit comments

Comments
 (0)