This gist is based on the mikemunsie's "Phone Masks by Country Code", but all the keys are lowercased, the duplicates are combined into arrays, the missing country codes are added, and the masks are sorted by length in the ascending order. This gist is designed to work perfectly with RobinHerbots's inputmask and jackocnr's intl-tel-input