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 }} {{ display }}
</button> </button>
</div> </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 <a
v-for="(display, code) in relatedLocalesLookup[config.locale]" v-for="(display, code) in relatedLocalesLookup[config.locale]"
:href="$locales[code].url" :href="$locales[code].url"

View File

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