-
Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathpaimon-moe.ts
36 lines (33 loc) · 863 Bytes
/
paimon-moe.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import _ from 'lodash';
import { getItemKeyFromName, getItemNameByKey } from 'utils';
import { TSourceConfig } from '../type';
export default <TSourceConfig>{
type: 'xlsx',
name: 'paimon-moe',
isCurrentSource(sheets) {
const characterSheet = sheets.find((sheet) => sheet.name === 'Character Event');
if (!characterSheet) return false;
const headers = characterSheet.headers;
return headers.includes('⭐');
},
parseSheet() {
return {
character: 'Character Event',
weapon: 'Weapon Event',
permanent: 'Standard',
novice: `Beginners' Wish`,
};
},
parseItem(item) {
const name = item['Name'];
const key = getItemKeyFromName(name);
if (key)
return {
key,
time: item['Time'],
name,
};
console.error('cannot find name', name);
return false;
},
};