Skip to content

Change pre_release to Object and pack_id_table to inverse mapping Object#3

Merged
salix5 merged 3 commits intomasterfrom
copilot/update-pre-release-object
Feb 23, 2026
Merged

Change pre_release to Object and pack_id_table to inverse mapping Object#3
salix5 merged 3 commits intomasterfrom
copilot/update-pre-release-object

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

pre_release was unnecessarily wrapped in a Map, and pack_id_table was derived as a Map via inverse_mapping(). Both are converted to plain Objects, consistent with how pack_list is used elsewhere.

Changes

  • ygo-json-loader.mjs

    • pre_release: export raw JSON import directly instead of new Map(Object.entries(pre_table))
    • pack_id_table: replace inverse_mapping(pre_release) with Object.fromEntries-based inversion → plain {[id: number]: string} Object
    • pack_id_table.get(pack_id)pack_id_table[pack_id]
  • ygo-query.mjs

    • pre_release.has(params.pack)Object.hasOwn(pre_release, params.pack) (×2)
    • pre_release.get(params.pack)pre_release[params.pack] (×2)
// Before
export const pre_release = new Map(Object.entries(pre_table));
const pack_id_table = inverse_mapping(pre_release); // Map<number, string>

// After
export const pre_release = pre_table; // plain Object
const pack_id_table = Object.fromEntries(Object.entries(pre_release).map(([k, v]) => [v, k]));

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: salix5 <2851577+salix5@users.noreply.github.com>
Copilot AI changed the title [WIP] Change pre_release to Object and pack_id_table to inverse mapping Object Change pre_release to plain Object and pack_id_table to inverse mapping Object Feb 23, 2026
Copilot AI requested a review from salix5 February 23, 2026 04:40
Co-authored-by: salix5 <2851577+salix5@users.noreply.github.com>
Copilot AI changed the title Change pre_release to plain Object and pack_id_table to inverse mapping Object Revert unintended package-lock.json changes Feb 23, 2026
@salix5 salix5 marked this pull request as ready for review February 23, 2026 04:44
Copilot AI changed the title Revert unintended package-lock.json changes Change pre_release to Object and pack_id_table to inverse mapping Object Feb 23, 2026
Copilot AI requested a review from salix5 February 23, 2026 04:48
@salix5 salix5 merged commit a8c1e46 into master Feb 23, 2026
3 checks passed
@salix5 salix5 deleted the copilot/update-pre-release-object branch February 23, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants