sekai-calculator 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -78,15 +78,15 @@ class DeckService {
78
78
  .map(async (id) => await this.getUserCard(id === null ? 0 : id)));
79
79
  }
80
80
  static toUserChallengeLiveSoloDeck(userCards, characterId) {
81
- if (userCards.length !== 5)
82
- throw new Error('deck card should be 5');
81
+ if (userCards.length < 2)
82
+ throw new Error('deck card should more than 1');
83
83
  return {
84
84
  characterId,
85
85
  leader: userCards[0].cardId,
86
86
  support1: userCards[1].cardId,
87
- support2: userCards[2].cardId,
88
- support3: userCards[3].cardId,
89
- support4: userCards[4].cardId
87
+ support2: userCards.length < 3 ? null : userCards[2].cardId,
88
+ support3: userCards.length < 4 ? null : userCards[3].cardId,
89
+ support4: userCards.length < 5 ? null : userCards[4].cardId
90
90
  };
91
91
  }
92
92
  }
package/dist/index.d.ts CHANGED
@@ -345,9 +345,9 @@ interface GameCharacter {
345
345
  id: number;
346
346
  seq: number;
347
347
  resourceId: number;
348
- firstName: string;
348
+ firstName?: string;
349
349
  givenName: string;
350
- firstNameRuby: string;
350
+ firstNameRuby?: string;
351
351
  givenNameRuby: string;
352
352
  gender: string;
353
353
  height: number;
package/dist/index.mjs CHANGED
@@ -76,15 +76,15 @@ class DeckService {
76
76
  .map(async (id) => await this.getUserCard(id === null ? 0 : id)));
77
77
  }
78
78
  static toUserChallengeLiveSoloDeck(userCards, characterId) {
79
- if (userCards.length !== 5)
80
- throw new Error('deck card should be 5');
79
+ if (userCards.length < 2)
80
+ throw new Error('deck card should more than 1');
81
81
  return {
82
82
  characterId,
83
83
  leader: userCards[0].cardId,
84
84
  support1: userCards[1].cardId,
85
- support2: userCards[2].cardId,
86
- support3: userCards[3].cardId,
87
- support4: userCards[4].cardId
85
+ support2: userCards.length < 3 ? null : userCards[2].cardId,
86
+ support3: userCards.length < 4 ? null : userCards[3].cardId,
87
+ support4: userCards.length < 5 ? null : userCards[4].cardId
88
88
  };
89
89
  }
90
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sekai-calculator",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Project SEKAI Calculator for deck power, live score, event point and more.",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",