Make sure i18n find does not match the wrong mapping

This commit is contained in:
Nuckyz 2025-02-18 16:31:21 -03:00
parent edf6480b8f
commit 71ade7d658
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 3 additions and 4 deletions

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { runtimeHashMessageKey } from "@utils/intlHash";
import type { Channel } from "discord-types/general"; import type { Channel } from "discord-types/general";
// eslint-disable-next-line path-alias/no-relative // eslint-disable-next-line path-alias/no-relative
@ -58,8 +57,8 @@ export const { match, P }: Pick<typeof import("ts-pattern"), "match" | "P"> = ma
export const lodash: typeof import("lodash") = findByPropsLazy("debounce", "cloneDeep"); export const lodash: typeof import("lodash") = findByPropsLazy("debounce", "cloneDeep");
export const i18n = mapMangledModuleLazy('defaultLocale:"en-US"', { export const i18n = mapMangledModuleLazy('defaultLocale:"en-US"', {
t: filters.byProps(runtimeHashMessageKey("DISCORD")), t: m => m?.[Symbol.toStringTag] === "IntlMessagesProxy",
intl: filters.byProps("string", "format"), intl: m => m != null && Object.getPrototypeOf(m)?.withFormatters != null
}, true); }, true);
export let SnowflakeUtils: t.SnowflakeUtils; export let SnowflakeUtils: t.SnowflakeUtils;

View file

@ -504,7 +504,7 @@ function getAllPropertyNames(object: Record<PropertyKey, any>, includeNonEnumera
const getKeys = includeNonEnumerable ? Object.getOwnPropertyNames : Object.keys; const getKeys = includeNonEnumerable ? Object.getOwnPropertyNames : Object.keys;
do { do {
getKeys(object).forEach(name => names.add(name)); getKeys(object).forEach(name => name !== "__esModule" && names.add(name));
object = Object.getPrototypeOf(object); object = Object.getPrototypeOf(object);
} while (object != null); } while (object != null);