XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

chore: enable no-deprecated warning (#2762)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2762 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

9c55a8a4
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

5 个文件 +17 -16
Modified .eslintrc +2 -1
@@ -31,7 +31,8 @@
31 31 "no-mixed-spaces-and-tabs": "error",
32 32 "@typescript-eslint/require-await": "error",
33 33 "import/no-named-as-default-member": "off",
34 "import/no-cycle": "warn"
34 "import/no-cycle": "warn",
35 "@typescript-eslint/no-deprecated": "warn"
35 36 },
36 37 "parser": "@typescript-eslint/parser",
37 38 "parserOptions": {
Modified src/controllers/api/focusController.ts +1 -1
@@ -231,7 +231,7 @@ interface ILensInstallRequest {
231 231
232 232 // Works for ways & upgrades
233 233 const focusTypeToPolarity = (type: string): TFocusPolarity => {
234 return ("AP_" + type.substr(1).split("/")[3].toUpperCase()) as TFocusPolarity;
234 return ("AP_" + type.substring(1).split("/")[3].toUpperCase()) as TFocusPolarity;
235 235 };
236 236
237 237 const shardValues = {
Modified src/controllers/custom/getItemListsController.ts +2 -2
@@ -70,7 +70,7 @@ const relicQualitySuffixes: Record<TRelicQuality, string> = {
70 70 };
71 71
72 72 /*const toTitleCase = (str: string): string => {
73 return str.replace(/[^\s-]+/g, word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase());
73 return str.replace(/[^\s-]+/g, word => word.charAt(0).toUpperCase() + word.substring(1).toLowerCase());
74 74 };*/
75 75
76 76 const getItemListsController: RequestHandler = (req, response) => {
@@ -221,7 +221,7 @@ const getItemListsController: RequestHandler = (req, response) => {
221 221 }
222 222 if (
223 223 name &&
224 uniqueName.substr(0, 30) != "/Lotus/Types/Game/Projections/" &&
224 uniqueName.substring(0, 30) != "/Lotus/Types/Game/Projections/" &&
225 225 uniqueName != "/Lotus/Types/Gameplay/EntratiLab/Resources/EntratiLanthornBundle"
226 226 ) {
227 227 res.miscitems.push({
Modified src/routes/cache.ts +2 -2
@@ -14,8 +14,8 @@ cacheRouter.get(/^\/origin\/[a-zA-Z0-9]+\/[0-9]+\/H\.Cache\.bin.*$/, (req, res)
14 14
15 15 cacheRouter.get(/^\/0\/.+!.+$/, async (req, res) => {
16 16 try {
17 const dir = req.path.substr(0, req.path.lastIndexOf("/"));
18 const file = req.path.substr(dir.length + 1);
17 const dir = req.path.substring(0, req.path.lastIndexOf("/"));
18 const file = req.path.substring(dir.length + 1);
19 19 const filePath = `static/data${dir}/${file}`;
20 20
21 21 // Return file if we have it
Modified src/services/inventoryService.ts +10 -10
@@ -687,10 +687,10 @@ export const addItem = async (
687 687 }
688 688
689 689 // Path-based duck typing
690 switch (typeName.substr(1).split("/")[1]) {
690 switch (typeName.substring(1).split("/")[1]) {
691 691 case "Powersuits":
692 692 if (typeName.endsWith("AugmentCard")) break;
693 switch (typeName.substr(1).split("/")[2]) {
693 switch (typeName.substring(1).split("/")[2]) {
694 694 default: {
695 695 return {
696 696 ...(await addPowerSuit(inventory, typeName, {
@@ -725,7 +725,7 @@ export const addItem = async (
725 725 }
726 726 break;
727 727 case "Upgrades": {
728 switch (typeName.substr(1).split("/")[2]) {
728 switch (typeName.substring(1).split("/")[2]) {
729 729 case "Mods": // Legendary Core
730 730 case "CosmeticEnhancers": // Traumatic Peculiar
731 731 {
@@ -782,12 +782,12 @@ export const addItem = async (
782 782 break;
783 783 }
784 784 case "Types":
785 switch (typeName.substr(1).split("/")[2]) {
785 switch (typeName.substring(1).split("/")[2]) {
786 786 case "Sentinels": {
787 787 return addSentinel(inventory, typeName, premiumPurchase);
788 788 }
789 789 case "Game": {
790 if (typeName.substr(1).split("/")[3] == "Projections") {
790 if (typeName.substring(1).split("/")[3] == "Projections") {
791 791 // Void Relics, e.g. /Lotus/Types/Game/Projections/T2VoidProjectionGaussPrimeDBronze
792 792 const miscItemChanges = [
793 793 {
@@ -801,8 +801,8 @@ export const addItem = async (
801 801 MiscItems: miscItemChanges
802 802 };
803 803 } else if (
804 typeName.substr(1).split("/")[3] == "CatbrowPet" ||
805 typeName.substr(1).split("/")[3] == "KubrowPet"
804 typeName.substring(1).split("/")[3] == "CatbrowPet" ||
805 typeName.substring(1).split("/")[3] == "KubrowPet"
806 806 ) {
807 807 if (
808 808 typeName != "/Lotus/Types/Game/KubrowPet/Eggs/KubrowPetEggItem" &&
@@ -826,7 +826,7 @@ export const addItem = async (
826 826 break;
827 827 }
828 828 case "Items": {
829 if (typeName.substr(1).split("/")[3] == "Emotes") {
829 if (typeName.substring(1).split("/")[3] == "Emotes") {
830 830 return addCustomization(inventory, typeName);
831 831 }
832 832 break;
@@ -875,8 +875,8 @@ export const addItem = async (
875 875 }
876 876 break;
877 877 case "Weapons": {
878 if (typeName.substr(1).split("/")[4] == "MeleeTrees") break;
879 const productCategory = typeName.substr(1).split("/")[3];
878 if (typeName.substring(1).split("/")[4] == "MeleeTrees") break;
879 const productCategory = typeName.substring(1).split("/")[3];
880 880 switch (productCategory) {
881 881 case "Pistols":
882 882 case "LongGuns":