Skip to content

Commit

Permalink
What a dumb bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Oct 13, 2024
1 parent 0ddeec7 commit b14997d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonlight-mod/moonmap",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default class Moonmap {
original,
moduleExport.key,
moduleExport.value
)?.value;
)?.key;
}

case ModuleExportType.Constant: {
Expand Down
10 changes: 5 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export function findObjectFromKey(exports: Record<string, any>, key: string) {
const obj = exports[exportKey];
if (obj && obj[key] !== undefined) {
if (subKey) {
if (obj[key][subKey]) return obj;
if (obj[key][subKey]) return exportKey;
} else {
return obj;
return exportKey;
}
}
}
Expand All @@ -40,11 +40,11 @@ export function findObjectFromValue(exports: Record<string, any>, value: any) {
for (const exportKey in exports) {
const obj = exports[exportKey];
// eslint-disable-next-line eqeqeq
if (obj == value) return obj;
if (obj == value) return exportKey;
for (const subKey in obj) {
// eslint-disable-next-line eqeqeq
if (obj && obj[subKey] == value) {
return obj;
return exportKey;
}
}
}
Expand All @@ -60,7 +60,7 @@ export function findObjectFromKeyValuePair(
const obj = exports[exportKey];
// eslint-disable-next-line eqeqeq
if (obj && obj[key] == value) {
return { key, value };
return { key: exportKey, value };
}
}
return null;
Expand Down

0 comments on commit b14997d

Please sign in to comment.