@@ -308,6 +308,22 @@ function addWhitelistedInterpolationParam(param: string): void {
308
308
SUPPORTED_INTERPOLATION_PARAMS [ param ] = true ;
309
309
}
310
310
311
+ function isSupportedColorStyleProp ( prop : string ) : boolean {
312
+ return SUPPORTED_COLOR_STYLES . hasOwnProperty ( prop ) ;
313
+ }
314
+
315
+ function isSupportedStyleProp ( prop : string ) : boolean {
316
+ return SUPPORTED_STYLES . hasOwnProperty ( prop ) ;
317
+ }
318
+
319
+ function isSupportedTransformProp ( prop : string ) : boolean {
320
+ return SUPPORTED_TRANSFORMS . hasOwnProperty ( prop ) ;
321
+ }
322
+
323
+ function isSupportedInterpolationParam ( param : string ) : boolean {
324
+ return SUPPORTED_INTERPOLATION_PARAMS . hasOwnProperty ( param ) ;
325
+ }
326
+
311
327
function validateTransform (
312
328
configs : Array <
313
329
| {
@@ -325,7 +341,7 @@ function validateTransform(
325
341
> ,
326
342
) : void {
327
343
configs. forEach ( config => {
328
- if ( ! SUPPORTED_TRANSFORMS . hasOwnProperty ( config . property ) ) {
344
+ if ( ! isSupportedTransformProp ( config . property ) ) {
329
345
throw new Error (
330
346
`Property '${ config . property } ' is not supported by native animated module` ,
331
347
) ;
@@ -335,7 +351,7 @@ function validateTransform(
335
351
336
352
function validateStyles ( styles : { [ key : string ] : ?number , ...} ) : void {
337
353
for ( const key in styles ) {
338
- if ( ! SUPPORTED_STYLES . hasOwnProperty ( key ) ) {
354
+ if ( ! isSupportedStyleProp ( key ) ) {
339
355
throw new Error (
340
356
`Style property '${ key } ' is not supported by native animated module` ,
341
357
) ;
@@ -345,7 +361,7 @@ function validateStyles(styles: {[key: string]: ?number, ...}): void {
345
361
346
362
function validateInterpolation ( config : InterpolationConfigType ) : void {
347
363
for ( const key in config ) {
348
- if ( ! SUPPORTED_INTERPOLATION_PARAMS . hasOwnProperty ( key ) ) {
364
+ if ( ! isSupportedInterpolationParam ( key ) ) {
349
365
throw new Error (
350
366
`Interpolation property '${ key } ' is not supported by native animated module` ,
351
367
) ;
@@ -411,10 +427,10 @@ function transformDataType(value: number | string): number | string {
411
427
412
428
module . exports = {
413
429
API ,
414
- SUPPORTED_STYLES ,
415
- SUPPORTED_COLOR_STYLES ,
416
- SUPPORTED_TRANSFORMS ,
417
- SUPPORTED_INTERPOLATION_PARAMS ,
430
+ isSupportedColorStyleProp ,
431
+ isSupportedStyleProp ,
432
+ isSupportedTransformProp ,
433
+ isSupportedInterpolationParam ,
418
434
addWhitelistedStyleProp,
419
435
addWhitelistedTransformProp,
420
436
addWhitelistedInterpolationParam,
0 commit comments