mirror of
https://github.com/brzzdev/FlagEmojis.git
synced 2026-09-05 08:20:12 +00:00
FlagEmojis is a single-file library for matching country code/names to their respective emojis
- Swift 77.7%
- Just 21.2%
- Ruby 1%
- Shell 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [nicklockwood/SwiftFormat](https://redirect.github.com/nicklockwood/SwiftFormat) | minor | `0.62.1` → `0.63.0` | --- ### Release Notes <details> <summary>nicklockwood/SwiftFormat (nicklockwood/SwiftFormat)</summary> ### [`v0.63.0`](https://redirect.github.com/nicklockwood/SwiftFormat/blob/HEAD/CHANGELOG.md#0630-2026-08-30) [Compare Source](https://redirect.github.com/nicklockwood/SwiftFormat/compare/0.62.1...0.63.0) - Added `ifExpressions` rule to convert ternaries to if expressions - Added `preferLazyMap` rule - Added `redundantExtendedLifetime` rule - Added `<!-- no-format -->` HTML comment syntax for disabling formatting of markdown code blocks - Added warning when `--enable` is used for a rule that is already enabled by default - Added `--redundant-optional-binding` option, defaulting to `same-name-only` - Made `--wrapstringinterpolation preserve` the default - Changed default of `--single-line-ternary` to `convert` - Distinguished default, opt-in, and deprecated rules in `--rules` and `--rule-info` output - Updated `organizeDeclarations` to categorize associatedtype declarations as beforeMarks - Updated `hoistAwait` and `hoistTry` to automatically detect and preserve autoclosures within same file as definition - Updated `redundantType` and `propertyTypes` to support more `ExpressibleByXLiteral` types - Updated `redundantReturn` to preserve bare `return` in closures where removal would create single-expression body - Updated `redundantOptionalBinding` to convert `if let x = property` to `if let property` - Updated `urlMacro` rule to support `try #require(URL(string:))` pattern - Updated `redundantBackticks` to preserve backticks on Swift Testing `@Test` functions - Updated `swiftTestingTestCaseNames` to convert backticked names with test prefix or underscores - Updated `genericExtensions` rule to support collection types - Updated `unusedPrivateDeclarations` to preserve properties used in compiler-generated `Equatable` and `Hashable` conformances - Increased stack size to 1MB for Linux release builds - Fixed `redundantClosure` false positive for if statements with no else branch - Fixed spaces around module selectors in generics - Fixed `preferForLoop` incorrectly applying to dollar-prefixed identifiers - Fixed blank line before trailing infix operators - Fixed `swiftTestingTestCaseNames` not adding backticks when required - Fixed `--preserve-acronyms` to work as substring match, not just exact identifier match - Fixed `genericExtensions` rule leaving stray comma with additional where conditions - Fixed `indent` dropping switch case body indentation inside `#if` with `--ifdef no-indent` - Fixed `redundantSwiftUIGroup` removing `Group(subviews:)` - Fixed `redundantReturn` removing redundant returns from switch/if inside a flatMap closure - Fixed `--ifdef no-indent` indentation for method chains and directives - Fixed `environmentEntry` edge cases - Fixed `redundantInternal` stripping required internal inside `#if` in non-internal extensions - Fixed indent of trailing closure in method chain member inside `#if` - Fixed `spaceAroundParens` spurious violations for keyword identifiers after `::` module selector </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/brzzdev/FlagEmojis). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC40OS4wIiwidXBkYXRlZEluVmVyIjoiNDQuNDkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
| .github/workflows | ||
| .scripts | ||
| Sources/FlagEmojis | ||
| Tests/FlagEmojis | ||
| .gitignore | ||
| .swiftlint.yml | ||
| .swiftlint_child.yml | ||
| Brewfile | ||
| CLAUDE.md | ||
| justfile | ||
| Mintfile | ||
| Package.swift | ||
| README.md | ||
| renovate.json | ||
FlagEmojis
FlagEmojis is a single-file Swift library for matching country code/names to their respective emojis
API
public static func flag(for country: String) -> String?
public static subscript(country: String) -> String?
public static func countryCode(for country: String) -> String?
Example Usage
FlagEmojis.flag(for: "italy") // 🇮🇹
FlagEmojis["United Kingdom"] // 🇬🇧
FlagEmojis["States"] // nil (Too ambiguous)
FlagEmojis.countryCode(for: "Germany") // DE
Installation
SPM
Targets
- From the File menu, select Add Package Dependencies...
- Enter "https://github.com/brzzdev/FlagEmojis" into the package repository URL text field
Package.swift
.package(
url: "https://github.com/brzzdev/FlagEmojis",
from: "1.0.0"
),
Manual
Add the file to your project, or copy and paste to your hearts desire
Credit
Heavily based on SwiftFlags, which itself credits country-emoji, and flag-emoji-from-country-code 💜