Skip to content

Commit fb2cf53

Browse files
committed
fix: eslint no-prototype-builtins
1 parent ce31151 commit fb2cf53

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Picker.addTranslation = (language, translation) => {
3333
};
3434

3535
Picker.modifyTranslation = (language, translation) => {
36-
if (TRANSLATIONS.hasOwnProperty(language)) {
36+
if (Object.prototype.hasOwnProperty.call(TRANSLATIONS,language)) {
3737
TRANSLATIONS[language] = { ...TRANSLATIONS[language], ...translation };
3838
}
3939
};

src/components/Picker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ function Picker({
446446

447447
if (
448448
scrollViewRef.current &&
449-
itemPositionsRef.current.hasOwnProperty(value)
449+
Object.prototype.hasOwnProperty.call(itemPositionsRef.current,value)
450450
) {
451451
scrollViewRef.current?.scrollTo?.({
452452
x: 0,
@@ -593,7 +593,7 @@ function Picker({
593593
* @returns {string}
594594
*/
595595
const _language = useMemo(() => {
596-
if (TRANSLATIONS.hasOwnProperty(language)) return language;
596+
if (Object.prototype.hasOwnProperty.call(TRANSLATIONS,language)) return language;
597597

598598
return LANGUAGE.FALLBACK;
599599
}, [language]);

src/constants/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const RTL_DIRECTION = (rtl, style) => {
7979
const newStyle = { ...style };
8080

8181
if (rtl && !I18nManager.isRTL) {
82-
if (newStyle.hasOwnProperty('flexDirection')) {
82+
if (Object.prototype.hasOwnProperty.call(newStyle, "flexDirection")) {
8383
newStyle.flexDirection =
8484
newStyle.flexDirection === 'row' ? 'row-reverse' : 'row';
8585
} else {
@@ -95,7 +95,7 @@ export const RTL_STYLE = (rtl, style) => {
9595

9696
if (rtl && !I18nManager.isRTL) {
9797
Object.keys(style).map((key) => {
98-
if (STYLE_DIRECTION_KEYS.hasOwnProperty(key)) {
98+
if (Object.prototype.hasOwnProperty.call(STYLE_DIRECTION_KEYS, key)) {
9999
newStyle[STYLE_DIRECTION_KEYS[key]] = newStyle[key];
100100
delete newStyle[key];
101101
} else {

0 commit comments

Comments
 (0)