change "hasOwnProperty" to "Object.hasOwn"

This commit is contained in:
Benjamin 2025-01-19 17:14:13 -05:00
parent df53bf04f5
commit 6f59dabf38
No known key found for this signature in database
GPG Key ID: E9469FAA8B44BB16
2 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ const setSpelling = (spelling: string) => {
{{ display }}
</button>
</div>
<div v-if="relatedLocalesLookup.hasOwnProperty(config.locale)" class="btn-group m-2">
<div v-if="Object.hasOwn(relatedLocalesLookup, config.locale)" class="btn-group m-2">
<a
v-for="(display, code) in relatedLocalesLookup[config.locale]"
:href="$locales[code].url"

View File

@ -73,7 +73,7 @@ export const hbsLatinToCyrillic = (str: string): string => {
if (i + 1 < str.length) {
// check for digraphs
const digraph = str.substring(i, i + 2);
if (HBS_LATIN_TO_CYRILLIC.hasOwnProperty(digraph)) {
if (Object.hasOwn(HBS_LATIN_TO_CYRILLIC, digraph)) {
result += HBS_LATIN_TO_CYRILLIC[digraph];
i += 2;
continue;
@ -81,7 +81,7 @@ export const hbsLatinToCyrillic = (str: string): string => {
}
const char = str[i];
if (HBS_LATIN_TO_CYRILLIC.hasOwnProperty(char)) {
if (Object.hasOwn(HBS_LATIN_TO_CYRILLIC, char)) {
result += HBS_LATIN_TO_CYRILLIC[char];
} else {
result += char;