MCPcopy
hub / github.com/SYJun404/frank / makePerkData

Function makePerkData

src/main/views/rune/get101Runes.ts:45–76  ·  view source on GitHub ↗
(perk:any, champion:string, position:string)

Source from the content-addressed store, hash-verified

43}
44
45const makePerkData = (perk:any, champion:string, position:string) => {
46 const { runes,igamecnt } = perk;
47 const data = runes.reduce(
48 ({ primaryStyleId, subStyleId }:any, i:any) => {
49 if (!primaryStyleId) {
50 primaryStyleId = getStyleId(+i);
51 }
52 if (primaryStyleId && !subStyleId) {
53 const isStyleId = isDifferentStyleId(+primaryStyleId, +i);
54 if (isStyleId) {
55 subStyleId = getStyleId(+i);
56 }
57 }
58 return {
59 primaryStyleId,
60 subStyleId,
61 };
62 },
63 {
64 primaryStyleId: ``,
65 subStyleId: ``,
66 },
67 );
68 if (position==='mid'){
69 position = 'middle'
70 }
71 data.selectedPerkIds = runes
72 data.alias = champion;
73 data.position = position;
74 data.pickCount = igamecnt;
75 return data;
76};
77
78export const get101Runes = async (champId:string|number) => {
79 const url = `https://lol.qq.com/act/lbp/common/guides/champDetail/champDetail_${champId}.js`

Callers 1

get101RunesFunction · 0.85

Calls 2

getStyleIdFunction · 0.85
isDifferentStyleIdFunction · 0.85

Tested by

no test coverage detected