Skip to content

Commit

Permalink
Use more inclusive language in Animated
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Peter Argany authored and facebook-github-bot committed Jul 16, 2020
1 parent 3d1e127 commit 3137c44
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Libraries/Animated/src/NativeAnimatedHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -192,7 +192,7 @@ const STYLES_WHITELIST = {
translateY: true,
};

const TRANSFORM_WHITELIST = {
const SUPPORTED_TRANSFORMS = {
translateX: true,
translateY: true,
scale: true,
Expand All @@ -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 {
Expand All @@ -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`,
);
Expand All @@ -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`,
);
Expand Down

0 comments on commit 3137c44

Please sign in to comment.