This repository was archived by the owner on Mar 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
packages/common/src/constraints Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -451,14 +451,16 @@ export const checkSanctionedGeoArea = async (
451451 candidate . name ,
452452 ) ;
453453 if ( location && location . region && location . country ) {
454- const sanctionedCountries = config . constraints ?. sanctionedCountries ;
455- const sanctionedRegions = config . constraints ?. sanctionedRegions ;
454+ const sanctionedCountries = config . constraints ?. sanctionedCountries . map (
455+ ( x ) => x . trim ( ) . toLowerCase ( ) ,
456+ ) ;
457+ const sanctionedRegions = config . constraints ?. sanctionedRegions . map ( ( x ) =>
458+ x . trim ( ) . toLowerCase ( ) ,
459+ ) ;
460+
456461 if (
457- sanctionedCountries . includes ( location . country . trim ( ) . toUpperCase ( ) ) ||
458- sanctionedRegions . includes (
459- location . region . trim ( ) . charAt ( 0 ) . toUpperCase ( ) +
460- location . region . trim ( ) . slice ( 1 ) . toLowerCase ( ) ,
461- )
462+ sanctionedCountries . includes ( location . country . trim ( ) . toLowerCase ( ) ) ||
463+ sanctionedRegions . includes ( location . region . trim ( ) . toLowerCase ( ) )
462464 ) {
463465 logger . info (
464466 `${ candidate . name } is in a sanctioned location: Country: ${ location . country } , Region: ${ location . region } ` ,
You can’t perform that action at this time.
0 commit comments