emo icon indicating copy to clipboard operation
emo copied to clipboard

Query not specific enough for `emo::flag` and other errors

Open matiasandina opened this issue 2 years ago • 0 comments

The behavior of flag is not able to pattern match properly China

> emo::flag("Hong Kong SAR China")
🇭🇰
> purrr:::map(c("China","Hong Kong SAR China"), emo::flag)
Error in .f(.x[[i]], ...) : 
  Query not specific enough, found 3 flags: 'China', 'Hong Kong SAR China', 'Macau SAR China'
> purrr:::map(c("China"), emo::flag)
Error in .f(.x[[i]], ...) : 
  Query not specific enough, found 3 flags: 'China', 'Hong Kong SAR China', 'Macau SAR China'
> purrr:::map(c("china"), emo::flag)
Error in .f(.x[[i]], ...) : Cannot find flag 'china'  

The behavior of emo::ji is different and produces "expected" results. I get that they are internally implemented differently but if flag is meant as a shorthand, it might be better to not have it fail like this.

> emo::ji("china")
🇨🇳 
> emo::ji("China")
🇨🇳 
> emo::ji("Hong_Kong_SAR_China")
🇭🇰 

I am using, maybe this got fixed in next versions and I didn't check.

packageVersion("emo")
[1] ‘0.0.0.9000’

matiasandina avatar Dec 01 '21 17:12 matiasandina