Skip to content

Commit 37c82ad

Browse files
committed
getCitySectionListにSpreadsheetServiceを追加
1 parent d65505f commit 37c82ad

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

lib/getCitySectionList.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { SpreadsheetService } from '../service/SpreadsheetService.js'
2+
3+
const convertStringBoolean = (stringBoolean: string) => {
4+
return stringBoolean === 'TRUE'
5+
}
6+
7+
const isAvailable = (row: any) => {
8+
return convertStringBoolean(row['投票対象'])
9+
}
10+
11+
// 無名即時関数
12+
;(async () => {
13+
const spreadsheet = new SpreadsheetService()
14+
await spreadsheet.init()
15+
16+
console.log('hello')
17+
18+
spreadsheet.getRows().then((rows) => {
19+
rows.forEach((row: any, index: number) => {
20+
if (isAvailable(row)) {
21+
console.log(`${row['作品名']},${row['国名']},${row['都市名']}`)
22+
}
23+
})
24+
})
25+
})()

lib/spreadsheet.ts

-15
This file was deleted.

0 commit comments

Comments
 (0)