From 3137c443f498002dcf0f6addd8fafc7a31bce218 Mon Sep 17 00:00:00 2001 From: Peter Argany Date: Thu, 16 Jul 2020 15:58:49 -0700 Subject: [PATCH] Use more inclusive language in Animated Summary: This appears to be the only usage of whitelist/blacklist in react-native-github, let's use some more inclusive language. Changelog: [JS][Internal] Reviewed By: kacieb Differential Revision: D22539431 fbshipit-source-id: 21d4cd54a5a2a676996ccec7b02ef15c421efee1 --- Libraries/Animated/src/NativeAnimatedHelper.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/Animated/src/NativeAnimatedHelper.js b/Libraries/Animated/src/NativeAnimatedHelper.js index e24ba00097f087..632b543c50ea6f 100644 --- a/Libraries/Animated/src/NativeAnimatedHelper.js +++ b/Libraries/Animated/src/NativeAnimatedHelper.js @@ -168,7 +168,7 @@ const API = { * In general native animated implementation should support any numeric property that doesn't need * to be updated through the shadow view hierarchy (all non-layout properties). */ -const STYLES_WHITELIST = { +const SUPPORTED_STYLES = { opacity: true, transform: true, borderRadius: true, @@ -192,7 +192,7 @@ const STYLES_WHITELIST = { translateY: true, }; -const TRANSFORM_WHITELIST = { +const SUPPORTED_TRANSFORMS = { translateX: true, translateY: true, scale: true, @@ -214,11 +214,11 @@ const SUPPORTED_INTERPOLATION_PARAMS = { }; function addWhitelistedStyleProp(prop: string): void { - STYLES_WHITELIST[prop] = true; + SUPPORTED_STYLES[prop] = true; } function addWhitelistedTransformProp(prop: string): void { - TRANSFORM_WHITELIST[prop] = true; + SUPPORTED_TRANSFORMS[prop] = true; } function addWhitelistedInterpolationParam(param: string): void { @@ -242,7 +242,7 @@ function validateTransform( >, ): void { configs.forEach(config => { - if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) { + if (!SUPPORTED_TRANSFORMS.hasOwnProperty(config.property)) { throw new Error( `Property '${config.property}' is not supported by native animated module`, ); @@ -252,7 +252,7 @@ function validateTransform( function validateStyles(styles: {[key: string]: ?number, ...}): void { for (const key in styles) { - if (!STYLES_WHITELIST.hasOwnProperty(key)) { + if (!SUPPORTED_STYLES.hasOwnProperty(key)) { throw new Error( `Style property '${key}' is not supported by native animated module`, );