# All files / extensions provinces.js

0% Statements 0/4
100% Branches 0/0
0% Functions 0/4
0% Lines 0/4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

     import provinceData from 'provinces';

    /**
     * Provides a list of short-code provinces (states, etc) for the country codes provided.
     */
    export default countries =>
      countries.reduce(
        (regions, countryCode) =>
          regions.concat(
            provinceData
              .filter(province => province.country === countryCode.toUpperCase())
              .map(province => province.short)
              .sort(),
          ),
        [],
      );