@lycoristech/azurdata 0.0.1
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/LICENSE +25 -0
- package/README.md +123 -0
- package/data/.gitkeep +0 -0
- package/data/id-map.json +3530 -0
- package/data/ship-list.json +4478 -0
- package/data/ships.json +143282 -0
- package/data/version.json +5 -0
- package/dist/cjs/client/AzurData.js +69 -0
- package/dist/cjs/client/fetcher.js +121 -0
- package/dist/cjs/client/index.js +7 -0
- package/dist/cjs/client/ships.js +80 -0
- package/dist/cjs/config.js +14 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/ingest/files.js +134 -0
- package/dist/cjs/ingest/index.js +18 -0
- package/dist/cjs/ingest/upstream.js +12 -0
- package/dist/cjs/normalize/construction.js +186 -0
- package/dist/cjs/normalize/identity.js +131 -0
- package/dist/cjs/normalize/index.js +25 -0
- package/dist/cjs/normalize/misc.js +31 -0
- package/dist/cjs/normalize/retrofit.js +21 -0
- package/dist/cjs/normalize/ship.js +406 -0
- package/dist/cjs/normalize/skills.js +194 -0
- package/dist/cjs/normalize/skins.js +141 -0
- package/dist/cjs/normalize/slots.js +35 -0
- package/dist/cjs/normalize/stats.js +182 -0
- package/dist/cjs/output/index.js +20 -0
- package/dist/cjs/output/writeIdMap.js +52 -0
- package/dist/cjs/output/writeShipList.js +31 -0
- package/dist/cjs/output/writeShips.js +33 -0
- package/dist/cjs/output/writeVersion.js +23 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/schema/output/index.js +17 -0
- package/dist/cjs/schema/output/ship.js +169 -0
- package/dist/cjs/schema/raw/attributeInfoByType.js +11 -0
- package/dist/cjs/schema/raw/equipDataByType.js +12 -0
- package/dist/cjs/schema/raw/fleetTechGroup.js +10 -0
- package/dist/cjs/schema/raw/fleetTechShipClass.js +15 -0
- package/dist/cjs/schema/raw/fleetTechShipTemplate.js +20 -0
- package/dist/cjs/schema/raw/index.js +38 -0
- package/dist/cjs/schema/raw/shipDataBlueprint.js +11 -0
- package/dist/cjs/schema/raw/shipDataBreakout.js +17 -0
- package/dist/cjs/schema/raw/shipDataByStar.js +10 -0
- package/dist/cjs/schema/raw/shipDataByType.js +13 -0
- package/dist/cjs/schema/raw/shipDataCreateExchange.js +10 -0
- package/dist/cjs/schema/raw/shipDataGroup.js +22 -0
- package/dist/cjs/schema/raw/shipDataStatistics.js +24 -0
- package/dist/cjs/schema/raw/shipDataStrengthen.js +12 -0
- package/dist/cjs/schema/raw/shipDataTemplate.js +26 -0
- package/dist/cjs/schema/raw/shipDataTrans.js +13 -0
- package/dist/cjs/schema/raw/shipSkinTemplate.js +23 -0
- package/dist/cjs/schema/raw/shipSkinWords.js +11 -0
- package/dist/cjs/schema/raw/shopTemplate.js +14 -0
- package/dist/cjs/schema/raw/skillDataDisplay.js +11 -0
- package/dist/cjs/schema/raw/skillDataTemplate.js +17 -0
- package/dist/cjs/schema/raw/transformDataTemplate.js +18 -0
- package/dist/cjs/schema/raw/voiceActorCn.js +11 -0
- package/dist/cjs/translate/enums.js +131 -0
- package/dist/cjs/translate/index.js +19 -0
- package/dist/cjs/translate/lookups.js +63 -0
- package/dist/cjs/translate/strings.js +98 -0
- package/dist/client/AzurData.d.ts +25 -0
- package/dist/client/AzurData.d.ts.map +1 -0
- package/dist/client/AzurData.js +63 -0
- package/dist/client/AzurData.js.map +1 -0
- package/dist/client/fetcher.d.ts +25 -0
- package/dist/client/fetcher.d.ts.map +1 -0
- package/dist/client/fetcher.js +116 -0
- package/dist/client/fetcher.js.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/ships.d.ts +20 -0
- package/dist/client/ships.d.ts.map +1 -0
- package/dist/client/ships.js +74 -0
- package/dist/client/ships.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/files.d.ts +25 -0
- package/dist/ingest/files.d.ts.map +1 -0
- package/dist/ingest/files.js +108 -0
- package/dist/ingest/files.js.map +1 -0
- package/dist/ingest/index.d.ts +3 -0
- package/dist/ingest/index.d.ts.map +1 -0
- package/dist/ingest/index.js +3 -0
- package/dist/ingest/index.js.map +1 -0
- package/dist/ingest/upstream.d.ts +4 -0
- package/dist/ingest/upstream.d.ts.map +1 -0
- package/dist/ingest/upstream.js +6 -0
- package/dist/ingest/upstream.js.map +1 -0
- package/dist/normalize/construction.d.ts +30 -0
- package/dist/normalize/construction.d.ts.map +1 -0
- package/dist/normalize/construction.js +184 -0
- package/dist/normalize/construction.js.map +1 -0
- package/dist/normalize/identity.d.ts +47 -0
- package/dist/normalize/identity.d.ts.map +1 -0
- package/dist/normalize/identity.js +129 -0
- package/dist/normalize/identity.js.map +1 -0
- package/dist/normalize/index.d.ts +10 -0
- package/dist/normalize/index.d.ts.map +1 -0
- package/dist/normalize/index.js +10 -0
- package/dist/normalize/index.js.map +1 -0
- package/dist/normalize/misc.d.ts +15 -0
- package/dist/normalize/misc.d.ts.map +1 -0
- package/dist/normalize/misc.js +29 -0
- package/dist/normalize/misc.js.map +1 -0
- package/dist/normalize/retrofit.d.ts +14 -0
- package/dist/normalize/retrofit.d.ts.map +1 -0
- package/dist/normalize/retrofit.js +19 -0
- package/dist/normalize/retrofit.js.map +1 -0
- package/dist/normalize/ship.d.ts +67 -0
- package/dist/normalize/ship.d.ts.map +1 -0
- package/dist/normalize/ship.js +369 -0
- package/dist/normalize/ship.js.map +1 -0
- package/dist/normalize/skills.d.ts +20 -0
- package/dist/normalize/skills.d.ts.map +1 -0
- package/dist/normalize/skills.js +192 -0
- package/dist/normalize/skills.js.map +1 -0
- package/dist/normalize/skins.d.ts +14 -0
- package/dist/normalize/skins.d.ts.map +1 -0
- package/dist/normalize/skins.js +139 -0
- package/dist/normalize/skins.js.map +1 -0
- package/dist/normalize/slots.d.ts +14 -0
- package/dist/normalize/slots.d.ts.map +1 -0
- package/dist/normalize/slots.js +33 -0
- package/dist/normalize/slots.js.map +1 -0
- package/dist/normalize/stats.d.ts +19 -0
- package/dist/normalize/stats.d.ts.map +1 -0
- package/dist/normalize/stats.js +180 -0
- package/dist/normalize/stats.js.map +1 -0
- package/dist/output/index.d.ts +5 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +5 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/writeIdMap.d.ts +16 -0
- package/dist/output/writeIdMap.d.ts.map +1 -0
- package/dist/output/writeIdMap.js +47 -0
- package/dist/output/writeIdMap.js.map +1 -0
- package/dist/output/writeShipList.d.ts +9 -0
- package/dist/output/writeShipList.d.ts.map +1 -0
- package/dist/output/writeShipList.js +26 -0
- package/dist/output/writeShipList.js.map +1 -0
- package/dist/output/writeShips.d.ts +15 -0
- package/dist/output/writeShips.d.ts.map +1 -0
- package/dist/output/writeShips.js +28 -0
- package/dist/output/writeShips.js.map +1 -0
- package/dist/output/writeVersion.d.ts +11 -0
- package/dist/output/writeVersion.d.ts.map +1 -0
- package/dist/output/writeVersion.js +18 -0
- package/dist/output/writeVersion.js.map +1 -0
- package/dist/schema/output/index.d.ts +2 -0
- package/dist/schema/output/index.d.ts.map +1 -0
- package/dist/schema/output/index.js +2 -0
- package/dist/schema/output/index.js.map +1 -0
- package/dist/schema/output/ship.d.ts +977 -0
- package/dist/schema/output/ship.d.ts.map +1 -0
- package/dist/schema/output/ship.js +167 -0
- package/dist/schema/output/ship.js.map +1 -0
- package/dist/schema/raw/attributeInfoByType.d.ts +25 -0
- package/dist/schema/raw/attributeInfoByType.d.ts.map +1 -0
- package/dist/schema/raw/attributeInfoByType.js +9 -0
- package/dist/schema/raw/attributeInfoByType.js.map +1 -0
- package/dist/schema/raw/equipDataByType.d.ts +31 -0
- package/dist/schema/raw/equipDataByType.d.ts.map +1 -0
- package/dist/schema/raw/equipDataByType.js +10 -0
- package/dist/schema/raw/equipDataByType.js.map +1 -0
- package/dist/schema/raw/fleetTechGroup.d.ts +19 -0
- package/dist/schema/raw/fleetTechGroup.d.ts.map +1 -0
- package/dist/schema/raw/fleetTechGroup.js +8 -0
- package/dist/schema/raw/fleetTechGroup.js.map +1 -0
- package/dist/schema/raw/fleetTechShipClass.d.ts +49 -0
- package/dist/schema/raw/fleetTechShipClass.d.ts.map +1 -0
- package/dist/schema/raw/fleetTechShipClass.js +13 -0
- package/dist/schema/raw/fleetTechShipClass.js.map +1 -0
- package/dist/schema/raw/fleetTechShipTemplate.d.ts +79 -0
- package/dist/schema/raw/fleetTechShipTemplate.d.ts.map +1 -0
- package/dist/schema/raw/fleetTechShipTemplate.js +18 -0
- package/dist/schema/raw/fleetTechShipTemplate.js.map +1 -0
- package/dist/schema/raw/index.d.ts +23 -0
- package/dist/schema/raw/index.d.ts.map +1 -0
- package/dist/schema/raw/index.js +23 -0
- package/dist/schema/raw/index.js.map +1 -0
- package/dist/schema/raw/shipDataBlueprint.d.ts +25 -0
- package/dist/schema/raw/shipDataBlueprint.d.ts.map +1 -0
- package/dist/schema/raw/shipDataBlueprint.js +9 -0
- package/dist/schema/raw/shipDataBlueprint.js.map +1 -0
- package/dist/schema/raw/shipDataBreakout.d.ts +61 -0
- package/dist/schema/raw/shipDataBreakout.d.ts.map +1 -0
- package/dist/schema/raw/shipDataBreakout.js +15 -0
- package/dist/schema/raw/shipDataBreakout.js.map +1 -0
- package/dist/schema/raw/shipDataByStar.d.ts +19 -0
- package/dist/schema/raw/shipDataByStar.d.ts.map +1 -0
- package/dist/schema/raw/shipDataByStar.js +8 -0
- package/dist/schema/raw/shipDataByStar.js.map +1 -0
- package/dist/schema/raw/shipDataByType.d.ts +37 -0
- package/dist/schema/raw/shipDataByType.d.ts.map +1 -0
- package/dist/schema/raw/shipDataByType.js +11 -0
- package/dist/schema/raw/shipDataByType.js.map +1 -0
- package/dist/schema/raw/shipDataCreateExchange.d.ts +19 -0
- package/dist/schema/raw/shipDataCreateExchange.d.ts.map +1 -0
- package/dist/schema/raw/shipDataCreateExchange.js +8 -0
- package/dist/schema/raw/shipDataCreateExchange.js.map +1 -0
- package/dist/schema/raw/shipDataGroup.d.ts +79 -0
- package/dist/schema/raw/shipDataGroup.d.ts.map +1 -0
- package/dist/schema/raw/shipDataGroup.js +20 -0
- package/dist/schema/raw/shipDataGroup.js.map +1 -0
- package/dist/schema/raw/shipDataStatistics.d.ts +103 -0
- package/dist/schema/raw/shipDataStatistics.d.ts.map +1 -0
- package/dist/schema/raw/shipDataStatistics.js +22 -0
- package/dist/schema/raw/shipDataStatistics.js.map +1 -0
- package/dist/schema/raw/shipDataStrengthen.d.ts +31 -0
- package/dist/schema/raw/shipDataStrengthen.d.ts.map +1 -0
- package/dist/schema/raw/shipDataStrengthen.js +10 -0
- package/dist/schema/raw/shipDataStrengthen.js.map +1 -0
- package/dist/schema/raw/shipDataTemplate.d.ts +115 -0
- package/dist/schema/raw/shipDataTemplate.d.ts.map +1 -0
- package/dist/schema/raw/shipDataTemplate.js +24 -0
- package/dist/schema/raw/shipDataTemplate.js.map +1 -0
- package/dist/schema/raw/shipDataTrans.d.ts +37 -0
- package/dist/schema/raw/shipDataTrans.d.ts.map +1 -0
- package/dist/schema/raw/shipDataTrans.js +11 -0
- package/dist/schema/raw/shipDataTrans.js.map +1 -0
- package/dist/schema/raw/shipSkinTemplate.d.ts +97 -0
- package/dist/schema/raw/shipSkinTemplate.d.ts.map +1 -0
- package/dist/schema/raw/shipSkinTemplate.js +21 -0
- package/dist/schema/raw/shipSkinTemplate.js.map +1 -0
- package/dist/schema/raw/shipSkinWords.d.ts +25 -0
- package/dist/schema/raw/shipSkinWords.d.ts.map +1 -0
- package/dist/schema/raw/shipSkinWords.js +9 -0
- package/dist/schema/raw/shipSkinWords.js.map +1 -0
- package/dist/schema/raw/shopTemplate.d.ts +43 -0
- package/dist/schema/raw/shopTemplate.d.ts.map +1 -0
- package/dist/schema/raw/shopTemplate.js +12 -0
- package/dist/schema/raw/shopTemplate.js.map +1 -0
- package/dist/schema/raw/skillDataDisplay.d.ts +25 -0
- package/dist/schema/raw/skillDataDisplay.d.ts.map +1 -0
- package/dist/schema/raw/skillDataDisplay.js +9 -0
- package/dist/schema/raw/skillDataDisplay.js.map +1 -0
- package/dist/schema/raw/skillDataTemplate.d.ts +61 -0
- package/dist/schema/raw/skillDataTemplate.d.ts.map +1 -0
- package/dist/schema/raw/skillDataTemplate.js +15 -0
- package/dist/schema/raw/skillDataTemplate.js.map +1 -0
- package/dist/schema/raw/transformDataTemplate.d.ts +67 -0
- package/dist/schema/raw/transformDataTemplate.d.ts.map +1 -0
- package/dist/schema/raw/transformDataTemplate.js +16 -0
- package/dist/schema/raw/transformDataTemplate.js.map +1 -0
- package/dist/schema/raw/voiceActorCn.d.ts +25 -0
- package/dist/schema/raw/voiceActorCn.d.ts.map +1 -0
- package/dist/schema/raw/voiceActorCn.js +9 -0
- package/dist/schema/raw/voiceActorCn.js.map +1 -0
- package/dist/translate/enums.d.ts +34 -0
- package/dist/translate/enums.d.ts.map +1 -0
- package/dist/translate/enums.js +126 -0
- package/dist/translate/enums.js.map +1 -0
- package/dist/translate/index.d.ts +4 -0
- package/dist/translate/index.d.ts.map +1 -0
- package/dist/translate/index.js +4 -0
- package/dist/translate/index.js.map +1 -0
- package/dist/translate/lookups.d.ts +37 -0
- package/dist/translate/lookups.d.ts.map +1 -0
- package/dist/translate/lookups.js +61 -0
- package/dist/translate/lookups.js.map +1 -0
- package/dist/translate/strings.d.ts +40 -0
- package/dist/translate/strings.d.ts.map +1 -0
- package/dist/translate/strings.js +92 -0
- package/dist/translate/strings.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { StatBlock } from "../schema/output/ship.js";
|
|
2
|
+
/** Maps integer rarity → AzurAPI rarity string */
|
|
3
|
+
export declare const RARITY_MAP: Record<number, "Normal" | "Rare" | "Elite" | "Super Rare" | "Ultra Rare">;
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a rarity integer to its display string.
|
|
6
|
+
*
|
|
7
|
+
* Rules:
|
|
8
|
+
* - int === 6 && isResearch && blueprintVersion >= 6 → "Decisive"
|
|
9
|
+
* - int === 6 && isResearch → "Priority"
|
|
10
|
+
* - else → RARITY_MAP[int] || "Normal"
|
|
11
|
+
*/
|
|
12
|
+
export declare function rarityName(rarity: number, isResearch: boolean, blueprintVersion: number | undefined): string;
|
|
13
|
+
/** Nationality int → display string. Matches Azur Lane wiki convention. */
|
|
14
|
+
export declare const NATIONALITY_MAP: Record<number, string>;
|
|
15
|
+
/** Look up a nationality code; falls back to "Universal". */
|
|
16
|
+
export declare function nationalityName(code: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* Skill type int → AzurAPI color.
|
|
19
|
+
* 1 = offensive (yellow), 2 = support (pink), 3 = defensive (blue), 0 = unset (pink).
|
|
20
|
+
*/
|
|
21
|
+
export declare const SKILL_COLOR_MAP: Record<number, "red" | "pink" | "gold" | "yellow" | "blue">;
|
|
22
|
+
/** Look up a skill type color; falls back to "pink". */
|
|
23
|
+
export declare function skillColor(type: number): "red" | "pink" | "gold" | "yellow" | "blue";
|
|
24
|
+
/**
|
|
25
|
+
* Stat index (0..11) → AzurAPI stat field name (on StatBlock).
|
|
26
|
+
* Only the 10 exposed stats. armor (6) and antisub (11) are intentionally missing.
|
|
27
|
+
*/
|
|
28
|
+
export declare const STAT_INDEX_TO_FIELD: Record<number, keyof StatBlock | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Fleet-tech attribute id → display name.
|
|
31
|
+
* From attribute_info_by_type.json, but hard-coded to avoid a data lookup per ship.
|
|
32
|
+
*/
|
|
33
|
+
export declare const FLEET_TECH_STAT_MAP: Record<number, string>;
|
|
34
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/translate/enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAM1D,kDAAkD;AAClD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAOhG,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,gBAAgB,EAAE,MAAM,GAAG,SAAS,GACnC,MAAM,CAQR;AAMD,2EAA2E;AAC3E,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA4BlD,CAAC;AAEF,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAMD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAKvF,CAAC;AAEF,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAEpF;AAMD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,SAAS,GAAG,SAAS,CAa3E,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAatD,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Rarity
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/** Maps integer rarity → AzurAPI rarity string */
|
|
5
|
+
export const RARITY_MAP = {
|
|
6
|
+
1: "Normal",
|
|
7
|
+
2: "Normal",
|
|
8
|
+
3: "Rare",
|
|
9
|
+
4: "Elite",
|
|
10
|
+
5: "Super Rare",
|
|
11
|
+
6: "Ultra Rare",
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a rarity integer to its display string.
|
|
15
|
+
*
|
|
16
|
+
* Rules:
|
|
17
|
+
* - int === 6 && isResearch && blueprintVersion >= 6 → "Decisive"
|
|
18
|
+
* - int === 6 && isResearch → "Priority"
|
|
19
|
+
* - else → RARITY_MAP[int] || "Normal"
|
|
20
|
+
*/
|
|
21
|
+
export function rarityName(rarity, isResearch, blueprintVersion) {
|
|
22
|
+
if (rarity === 6 && isResearch) {
|
|
23
|
+
if (blueprintVersion !== undefined && blueprintVersion >= 6) {
|
|
24
|
+
return "Decisive";
|
|
25
|
+
}
|
|
26
|
+
return "Priority";
|
|
27
|
+
}
|
|
28
|
+
return RARITY_MAP[rarity] ?? "Normal";
|
|
29
|
+
}
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Nationality
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
/** Nationality int → display string. Matches Azur Lane wiki convention. */
|
|
34
|
+
export const NATIONALITY_MAP = {
|
|
35
|
+
0: "Universal",
|
|
36
|
+
1: "Eagle Union",
|
|
37
|
+
2: "Royal Navy",
|
|
38
|
+
3: "Sakura Empire",
|
|
39
|
+
4: "Iron Blood",
|
|
40
|
+
5: "Dragon Empery",
|
|
41
|
+
6: "Sardegna Empire",
|
|
42
|
+
7: "Northern Parliament",
|
|
43
|
+
8: "Iris Libre",
|
|
44
|
+
9: "Vichya Dominion",
|
|
45
|
+
10: "Iris Orthodoxy",
|
|
46
|
+
11: "Kingdom of Tulipa",
|
|
47
|
+
96: "Universal",
|
|
48
|
+
97: "Tempesta",
|
|
49
|
+
98: "Universal",
|
|
50
|
+
101: "META",
|
|
51
|
+
102: "Universal",
|
|
52
|
+
103: "Universal",
|
|
53
|
+
104: "Universal",
|
|
54
|
+
105: "Neptunia",
|
|
55
|
+
106: "KizunaAI",
|
|
56
|
+
107: "Hololive",
|
|
57
|
+
108: "Venus Vacation",
|
|
58
|
+
109: "The Idolmaster",
|
|
59
|
+
110: "SSSS",
|
|
60
|
+
111: "Atelier Ryza",
|
|
61
|
+
112: "Senran Kagura",
|
|
62
|
+
};
|
|
63
|
+
/** Look up a nationality code; falls back to "Universal". */
|
|
64
|
+
export function nationalityName(code) {
|
|
65
|
+
return NATIONALITY_MAP[code] ?? "Universal";
|
|
66
|
+
}
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Skill color
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
/**
|
|
71
|
+
* Skill type int → AzurAPI color.
|
|
72
|
+
* 1 = offensive (yellow), 2 = support (pink), 3 = defensive (blue), 0 = unset (pink).
|
|
73
|
+
*/
|
|
74
|
+
export const SKILL_COLOR_MAP = {
|
|
75
|
+
0: "pink",
|
|
76
|
+
1: "yellow",
|
|
77
|
+
2: "pink",
|
|
78
|
+
3: "blue",
|
|
79
|
+
};
|
|
80
|
+
/** Look up a skill type color; falls back to "pink". */
|
|
81
|
+
export function skillColor(type) {
|
|
82
|
+
return SKILL_COLOR_MAP[type] ?? "pink";
|
|
83
|
+
}
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Stat index map
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
/**
|
|
88
|
+
* Stat index (0..11) → AzurAPI stat field name (on StatBlock).
|
|
89
|
+
* Only the 10 exposed stats. armor (6) and antisub (11) are intentionally missing.
|
|
90
|
+
*/
|
|
91
|
+
export const STAT_INDEX_TO_FIELD = {
|
|
92
|
+
0: "health",
|
|
93
|
+
1: "firepower",
|
|
94
|
+
2: "torpedo",
|
|
95
|
+
3: "antiwar", // AA — keep AzurAPI typo
|
|
96
|
+
4: "aviation",
|
|
97
|
+
5: "reload",
|
|
98
|
+
6: undefined, // armor — not in StatBlock
|
|
99
|
+
7: "accuracy",
|
|
100
|
+
8: "evasion",
|
|
101
|
+
9: "speed",
|
|
102
|
+
10: "luck",
|
|
103
|
+
11: undefined, // antisub — not in StatBlock
|
|
104
|
+
};
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Fleet-tech stat map
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
/**
|
|
109
|
+
* Fleet-tech attribute id → display name.
|
|
110
|
+
* From attribute_info_by_type.json, but hard-coded to avoid a data lookup per ship.
|
|
111
|
+
*/
|
|
112
|
+
export const FLEET_TECH_STAT_MAP = {
|
|
113
|
+
1: "health",
|
|
114
|
+
2: "firepower",
|
|
115
|
+
3: "torpedo",
|
|
116
|
+
4: "antiaircraft",
|
|
117
|
+
5: "aviation",
|
|
118
|
+
6: "reload",
|
|
119
|
+
7: "armor",
|
|
120
|
+
8: "accuracy",
|
|
121
|
+
9: "evasion",
|
|
122
|
+
10: "speed",
|
|
123
|
+
11: "luck",
|
|
124
|
+
12: "antisub",
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/translate/enums.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,kDAAkD;AAClD,MAAM,CAAC,MAAM,UAAU,GAA8E;IACnG,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,YAAY;CAChB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,MAAc,EACd,UAAmB,EACnB,gBAAoC;IAEpC,IAAI,MAAM,KAAK,CAAC,IAAI,UAAU,EAAE,CAAC;QAC/B,IAAI,gBAAgB,KAAK,SAAS,IAAI,gBAAgB,IAAI,CAAC,EAAE,CAAC;YAC5D,OAAO,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,UAAU,CAAC,IAAY;IACrC,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;AACzC,CAAC;AAED,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAgD;IAC9E,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,WAAW;IACd,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,SAAS,EAAI,yBAAyB;IACzC,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,SAAS,EAAI,2BAA2B;IAC3C,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,OAAO;IACV,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,SAAS,EAAG,6BAA6B;CAC9C,CAAC;AAEF,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,WAAW;IACd,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,cAAc;IACjB,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,SAAS;IACZ,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,SAAS;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translate/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/translate/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FleetTechShipTemplate, FleetTechShipClass, ShipDataByType, EquipDataByType, SkillDataTemplate, SkillDataDisplay, VoiceActorCn } from "../schema/raw/index.js";
|
|
2
|
+
/** Inputs required to build a Lookups helper. */
|
|
3
|
+
export interface LookupInputs {
|
|
4
|
+
fleetTechShipTemplate: FleetTechShipTemplate;
|
|
5
|
+
fleetTechShipClass: FleetTechShipClass;
|
|
6
|
+
shipDataByType: ShipDataByType;
|
|
7
|
+
equipDataByType: EquipDataByType;
|
|
8
|
+
skillDataTemplate: SkillDataTemplate;
|
|
9
|
+
skillDataDisplay: SkillDataDisplay;
|
|
10
|
+
voiceActorCn: VoiceActorCn;
|
|
11
|
+
}
|
|
12
|
+
/** Lookup helper object returned by createLookups. */
|
|
13
|
+
export interface Lookups {
|
|
14
|
+
/**
|
|
15
|
+
* group_type (string) → class name, e.g. "Edinburgh Class".
|
|
16
|
+
* Falls back to fallbackFromTagList if no fleet_tech entry is found.
|
|
17
|
+
*/
|
|
18
|
+
classNameFor(groupType: string, fallbackFromTagList?: string): string;
|
|
19
|
+
/** type id → hull type pretty name. Fallback: "Unknown". */
|
|
20
|
+
hullTypeName(typeId: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* equipment type id → display name.
|
|
23
|
+
* "type_name2" preferred, fallback "type_name". Fallback: "Unknown".
|
|
24
|
+
*/
|
|
25
|
+
equipTypeName(typeId: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* skill id → display name.
|
|
28
|
+
* Prefers skill_data_template.name, fallback skill_data_display.name.
|
|
29
|
+
* Fallback: `Skill ${id}`.
|
|
30
|
+
*/
|
|
31
|
+
skillName(id: number): string;
|
|
32
|
+
/** voice actor code → name, fallback "Unknown". */
|
|
33
|
+
voiceActorName(code: number): string;
|
|
34
|
+
}
|
|
35
|
+
/** Build a Lookups helper from the raw upstream tables. */
|
|
36
|
+
export declare function createLookups(inputs: LookupInputs): Lookups;
|
|
37
|
+
//# sourceMappingURL=lookups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookups.d.ts","sourceRoot":"","sources":["../../src/translate/lookups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAMhC,iDAAiD;AACjD,MAAM,WAAW,YAAY;IAC3B,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,sDAAsD;AACtD,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtE,4DAA4D;IAC5D,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAErC;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAE9B,mDAAmD;IACnD,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAMD,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAoE3D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Factory
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/** Build a Lookups helper from the raw upstream tables. */
|
|
5
|
+
export function createLookups(inputs) {
|
|
6
|
+
const { fleetTechShipTemplate, fleetTechShipClass, shipDataByType, equipDataByType, skillDataTemplate, skillDataDisplay, voiceActorCn, } = inputs;
|
|
7
|
+
// Pre-build a code→name map for voice actors (keyed by `code` field value, not the record key)
|
|
8
|
+
const voiceActorByCode = new Map();
|
|
9
|
+
for (const entry of Object.values(voiceActorCn)) {
|
|
10
|
+
if (entry.code !== undefined && entry.actor_name !== undefined) {
|
|
11
|
+
voiceActorByCode.set(entry.code, entry.actor_name);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
classNameFor(groupType, fallbackFromTagList) {
|
|
16
|
+
const techEntry = fleetTechShipTemplate[groupType];
|
|
17
|
+
if (techEntry !== undefined) {
|
|
18
|
+
const classId = String(techEntry.class);
|
|
19
|
+
const classEntry = fleetTechShipClass[classId];
|
|
20
|
+
if (classEntry !== undefined) {
|
|
21
|
+
return classEntry.name;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return fallbackFromTagList ?? "Unknown";
|
|
25
|
+
},
|
|
26
|
+
hullTypeName(typeId) {
|
|
27
|
+
const entry = shipDataByType[String(typeId)];
|
|
28
|
+
return entry?.type_name ?? "Unknown";
|
|
29
|
+
},
|
|
30
|
+
equipTypeName(typeId) {
|
|
31
|
+
const entry = equipDataByType[String(typeId)];
|
|
32
|
+
if (entry === undefined)
|
|
33
|
+
return "Unknown";
|
|
34
|
+
return entry.type_name2 ?? entry.type_name ?? "Unknown";
|
|
35
|
+
},
|
|
36
|
+
skillName(id) {
|
|
37
|
+
const key = String(id);
|
|
38
|
+
const templateEntry = skillDataTemplate[key];
|
|
39
|
+
if (templateEntry?.name !== undefined) {
|
|
40
|
+
return templateEntry.name;
|
|
41
|
+
}
|
|
42
|
+
const displayEntry = skillDataDisplay[key];
|
|
43
|
+
if (displayEntry?.name !== undefined) {
|
|
44
|
+
return displayEntry.name;
|
|
45
|
+
}
|
|
46
|
+
return `Skill ${id}`;
|
|
47
|
+
},
|
|
48
|
+
voiceActorName(code) {
|
|
49
|
+
// Try the pre-built code→name map first (keyed by the `code` field in each record)
|
|
50
|
+
const byCode = voiceActorByCode.get(code);
|
|
51
|
+
if (byCode !== undefined)
|
|
52
|
+
return byCode;
|
|
53
|
+
// Also try looking up by record key directly (some files key by code number)
|
|
54
|
+
const entry = voiceActorCn[String(code)];
|
|
55
|
+
if (entry?.actor_name !== undefined)
|
|
56
|
+
return entry.actor_name;
|
|
57
|
+
return "Unknown";
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=lookups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookups.js","sourceRoot":"","sources":["../../src/translate/lookups.ts"],"names":[],"mappings":"AAqDA,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,2DAA2D;AAC3D,MAAM,UAAU,aAAa,CAAC,MAAoB;IAChD,MAAM,EACJ,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,GAAG,MAAM,CAAC;IAEX,+FAA+F;IAC/F,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACnD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QAChD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAC/D,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,OAAO;QACL,YAAY,CAAC,SAAiB,EAAE,mBAA4B;YAC1D,MAAM,SAAS,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;YACnD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC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1C,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,MAAM,CAAC;YAExC,6EAA6E;YAC7E,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;YACzC,IAAI,KAAK,EAAE,UAAU,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC,UAAU,CAAC;YAE7D,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a raw skill description by substituting $1, $2, ... placeholders.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* substitutePlaceholders("Increases DMG by $1 and AoE by $2.", ["25.0%", "3.0%"])
|
|
6
|
+
* // → "Increases DMG by 25.0% and AoE by 3.0%."
|
|
7
|
+
*/
|
|
8
|
+
export declare function substitutePlaceholders(raw: string, substitutions: ReadonlyArray<string>): string;
|
|
9
|
+
/**
|
|
10
|
+
* Extract the max-rank substitution value from a skill's desc_add array.
|
|
11
|
+
*
|
|
12
|
+
* The true shape of desc_add is `Array<Array<Array<string | number>>>`:
|
|
13
|
+
* - Outer: one entry per placeholder ($N → outer[N-1])
|
|
14
|
+
* - Middle: one entry per skill level (length = max_level, usually 10)
|
|
15
|
+
* - Inner: a tuple of [current_value, delta] or [value] — we take index 0
|
|
16
|
+
*
|
|
17
|
+
* For the max-rank value we take desc_add[n-1][maxLevel-1][0].
|
|
18
|
+
* If anything looks wrong, we use the last available entry, or "" as a last resort.
|
|
19
|
+
*/
|
|
20
|
+
export declare function extractMaxLevelSubstitutions(descAdd: unknown, maxLevel: number): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Convert star count 1..6 to a unicode-star string like "★★★★".
|
|
23
|
+
*/
|
|
24
|
+
export declare function starsString(count: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* Convert an EN ship name to a wiki URL.
|
|
27
|
+
* e.g. "Belfast" → "https://azurlane.koumakan.jp/wiki/Belfast"
|
|
28
|
+
*/
|
|
29
|
+
export declare function wikiUrlFor(name: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Split a limit-break bonus string on "/" or "|" into bullet items. Trim whitespace.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* splitLimitBreakBonuses("Unlock X/Main gun +5%/+10 FP")
|
|
35
|
+
* // → ["Unlock X", "Main gun +5%", "+10 FP"]
|
|
36
|
+
*
|
|
37
|
+
* Returns [] for the empty string or for "None".
|
|
38
|
+
*/
|
|
39
|
+
export declare function splitLimitBreakBonuses(raw: string): string[];
|
|
40
|
+
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/translate/strings.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,GACnC,MAAM,CAKR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,EAAE,CA8BV;AAMD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAMD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAMD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAI5D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Placeholder substitution
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/**
|
|
5
|
+
* Format a raw skill description by substituting $1, $2, ... placeholders.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* substitutePlaceholders("Increases DMG by $1 and AoE by $2.", ["25.0%", "3.0%"])
|
|
9
|
+
* // → "Increases DMG by 25.0% and AoE by 3.0%."
|
|
10
|
+
*/
|
|
11
|
+
export function substitutePlaceholders(raw, substitutions) {
|
|
12
|
+
return raw.replace(/\$(\d+)/g, (_match, indexStr) => {
|
|
13
|
+
const idx = parseInt(indexStr, 10) - 1; // convert 1-based to 0-based
|
|
14
|
+
return substitutions[idx] ?? _match;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Extract the max-rank substitution value from a skill's desc_add array.
|
|
19
|
+
*
|
|
20
|
+
* The true shape of desc_add is `Array<Array<Array<string | number>>>`:
|
|
21
|
+
* - Outer: one entry per placeholder ($N → outer[N-1])
|
|
22
|
+
* - Middle: one entry per skill level (length = max_level, usually 10)
|
|
23
|
+
* - Inner: a tuple of [current_value, delta] or [value] — we take index 0
|
|
24
|
+
*
|
|
25
|
+
* For the max-rank value we take desc_add[n-1][maxLevel-1][0].
|
|
26
|
+
* If anything looks wrong, we use the last available entry, or "" as a last resort.
|
|
27
|
+
*/
|
|
28
|
+
export function extractMaxLevelSubstitutions(descAdd, maxLevel) {
|
|
29
|
+
if (!Array.isArray(descAdd))
|
|
30
|
+
return [];
|
|
31
|
+
const result = [];
|
|
32
|
+
for (const outerEntry of descAdd) {
|
|
33
|
+
// outerEntry should be an array of per-level arrays
|
|
34
|
+
if (!Array.isArray(outerEntry) || outerEntry.length === 0) {
|
|
35
|
+
result.push("");
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
// Pick the last-level entry, clamped to available entries
|
|
39
|
+
const levelIndex = Math.min(maxLevel - 1, outerEntry.length - 1);
|
|
40
|
+
const innerEntry = outerEntry[Math.max(0, levelIndex)];
|
|
41
|
+
if (!Array.isArray(innerEntry) || innerEntry.length === 0) {
|
|
42
|
+
result.push("");
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const value = innerEntry[0];
|
|
46
|
+
if (value === null || value === undefined) {
|
|
47
|
+
result.push("");
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
result.push(String(value));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Stars
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
/**
|
|
59
|
+
* Convert star count 1..6 to a unicode-star string like "★★★★".
|
|
60
|
+
*/
|
|
61
|
+
export function starsString(count) {
|
|
62
|
+
return "★".repeat(Math.max(0, count));
|
|
63
|
+
}
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Wiki URL
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
/**
|
|
68
|
+
* Convert an EN ship name to a wiki URL.
|
|
69
|
+
* e.g. "Belfast" → "https://azurlane.koumakan.jp/wiki/Belfast"
|
|
70
|
+
*/
|
|
71
|
+
export function wikiUrlFor(name) {
|
|
72
|
+
return `https://azurlane.koumakan.jp/wiki/${encodeURIComponent(name)}`;
|
|
73
|
+
}
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// Limit break bonus string splitting
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
/**
|
|
78
|
+
* Split a limit-break bonus string on "/" or "|" into bullet items. Trim whitespace.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* splitLimitBreakBonuses("Unlock X/Main gun +5%/+10 FP")
|
|
82
|
+
* // → ["Unlock X", "Main gun +5%", "+10 FP"]
|
|
83
|
+
*
|
|
84
|
+
* Returns [] for the empty string or for "None".
|
|
85
|
+
*/
|
|
86
|
+
export function splitLimitBreakBonuses(raw) {
|
|
87
|
+
const trimmed = raw.trim();
|
|
88
|
+
if (trimmed === "" || trimmed === "None")
|
|
89
|
+
return [];
|
|
90
|
+
return trimmed.split(/[/|]/).map((s) => s.trim()).filter((s) => s.length > 0);
|
|
91
|
+
}
|
|
92
|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C,CAAC;AAChF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lycoristech/azurdata",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/cjs/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"data"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "npx tsc -p tsconfig.build.json && npx tsc -p tsconfig.cjs.json && echo\n '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
20
|
+
"build:data": "tsx scripts/build-data.ts",
|
|
21
|
+
"verify": "tsx scripts/verify.ts",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"prepare": "tsc -p tsconfig.build.json && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"fuse.js": "^7.0.0",
|
|
29
|
+
"zod": "^3.24.2"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^22.0.0",
|
|
33
|
+
"tsx": "^4.19.3",
|
|
34
|
+
"typescript": "^5.8.3",
|
|
35
|
+
"vitest": "^3.1.1"
|
|
36
|
+
}
|
|
37
|
+
}
|