reserve-protocol/elm-i3166-data/1.0.0

Renamed to reserve-protocol/elm-iso3166-data. It is published under that name, and new versions come out there.

Versions published as reserve-protocol/elm-i3166-data still install under that name. 1 version of 1 come from the new location (see their notes).

Rerouted (renamed, needs approval). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/reserve-protocol/elm-iso3166-data.

What we checked: The repo moved to github.com/reserve-protocol/elm-iso3166-data and tag 1.0.0 is there; its commit 6fa463f5b6ba is from 2019-01-11 03:09 UTC, after the version was published (2019-01-11 03:01 UTC); elm.json differs from package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one and nothing else confirms its contents.

We could not verify this copy against what was published, so the Lamdera compiler asks before using it (y/n). Without a terminal, as in CI, it stops with an error unless approved:

  • lamdera make --auto-approve-package-rerouting approves rerouted versions for that run,
  • LAMDERA_AUTO_APPROVE_PACKAGE_REROUTING=1 does the same for every run in that environment,
  • LAMDERA_CACHE=off skips the Lamdera package server altogether: packages come from package.elm-lang.org and GitHub only, as with elm, and a rerouted version then fails to download.

Details · package.elm-lang.org's zip: https://github.com/reserve-protocol/elm-i3166-data/zipball/1.0.0/

elm-iso3166-data

Information about world countries. This library contains lists of facts about countries.

Convert Alpha-2 Code to name

Find the name of a country including the country name in local language in parenthesis

Convert Alpha-2 Code to flag

Find the flag of a country in a sprite sheet.

> import Iso3166
> Dict.get Iso3166.flagPositions "MX"
Just ( -112, -144 )
    : Maybe.Maybe (Float, Float)
> import Html exposing (div)
> (x, y) = (-112, -144)
> div
    [ style "background-image" ("url(\"" ++ Iso3166.flagImageData ++ "\")"
    , style "background-position" (String.fromFloat x ++ "px " ++ String.fromFloat y ++ "px")
    ]
    []