From 71746a86c1837b8a1b669e6740beef1125abe2e9 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 25 Dec 2023 19:51:38 +0100 Subject: [PATCH] [items] Minor code clean-up Signed-off-by: Florian Hotze --- items/items.js | 4 +--- types/items/items.d.ts.map | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/items/items.js b/items/items.js index 2ace8f199..c96fbd26c 100644 --- a/items/items.js +++ b/items/items.js @@ -571,9 +571,7 @@ function replaceItem (itemConfig) { */ function getItem (name, nullIfMissing = false) { try { - if (typeof name === 'string' || name instanceof String) { - return new Item(itemRegistry.getItem(name)); - } + return new Item(itemRegistry.getItem(name)); } catch (e) { if (nullIfMissing) { return null; diff --git a/types/items/items.d.ts.map b/types/items/items.d.ts.map index 8b2b6770b..bbfc565fc 100644 --- a/types/items/items.d.ts.map +++ b/types/items/items.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../items/items.js"],"names":[],"mappings":"2BAoBa,OAAO,qBAAqB,EAAE,YAAY;uBAQ1C,OAAO,aAAa,EAAE,QAAQ;;;;;;;;UAM7B,MAAM;;;;UACN,MAAM;;;;YACN,MAAM;;;;eACN,MAAM;;;;aACN,MAAM,EAAE;;;;WACR,MAAM,EAAE;;;;eACR,MAAM,MAAO;;;;;;;;iBAEb,MAAM;;;;;;AAmjBpB;;;;;GAKG;AACH,gCAHW,MAAM,GACJ,MAAM,CAIa;AAlDhC;;;;;;GAMG;AACH,8BAJW,MAAM,kBACN,OAAO,GACL,IAAI,GAAC,IAAI,CAcrB;AAED;;;;;GAKG;AACH,4BAFa,IAAI,EAAE,CAIlB;AA5ID;;;;;;;;;;;GAWG;AACH,oCALW,UAAU,GACR,IAAI,CA+BhB;AAuGD;;;;;;GAMG;AACH,2CAHW,MAAM,EAAE,GACN,IAAI,EAAE,CAIlB;AAhED;;;;;;;;;;;;;;GAcG;AACH,wCALW,UAAU,GACR,IAAI,GAAC,IAAI,CAWrB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GG;IACH,qBAEC;IAED;;;OAGG;IACH,qBAFc,MAAM,UAKnB;IAED;;;OAGG;IACH,wBAFc,MAAM,UAOnB;IAED,gBAEC;CACF;;;;;yBAnXY,OAAO,eAAe,EAAE,aAAa"} \ No newline at end of file +{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../items/items.js"],"names":[],"mappings":"2BAoBa,OAAO,qBAAqB,EAAE,YAAY;uBAQ1C,OAAO,aAAa,EAAE,QAAQ;;;;;;;;UAM7B,MAAM;;;;UACN,MAAM;;;;YACN,MAAM;;;;eACN,MAAM;;;;aACN,MAAM,EAAE;;;;WACR,MAAM,EAAE;;;;eACR,MAAM,MAAO;;;;;;;;iBAEb,MAAM;;;;;;AAkjBpB;;;;;GAKG;AACH,gCAHW,MAAM,GACJ,MAAM,CAIa;AAhDhC;;;;;;GAMG;AACH,8BAJW,MAAM,kBACN,OAAO,GACL,IAAI,GAAC,IAAI,CAYrB;AAED;;;;;GAKG;AACH,4BAFa,IAAI,EAAE,CAIlB;AA1ID;;;;;;;;;;;GAWG;AACH,oCALW,UAAU,GACR,IAAI,CA+BhB;AAqGD;;;;;;GAMG;AACH,2CAHW,MAAM,EAAE,GACN,IAAI,EAAE,CAIlB;AA9DD;;;;;;;;;;;;;;GAcG;AACH,wCALW,UAAU,GACR,IAAI,GAAC,IAAI,CAWrB;AApED;;;;;;GAMG;AACH,2CAHW,MAAM,GAAC,IAAI,GACT,IAAI,GAAC,IAAI,CAuCrB;AA9cD;;;;GAIG;AACH;IACE;;;;OAIG;IACH,+BAqBC;IAjBC;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,SAFU,WAAW,CAEkB;IAEvC;;;OAGG;IACH,WAFU,aAAa,CAE6B;IAGtD;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,2BAGC;IAED;;;OAGG;IACH,oDAWC;IAED;;;OA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