Watch
1
0
Fork
You've already forked FlagEmojis
0
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%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
renovate[bot] 50db7484d9
chore(deps): update dependency nicklockwood/swiftformat to v0.63.0 (#11)
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>
2026-08-31 00:30:50 +00:00
.github/workflows chore(deps): update actions/checkout action to v7 (#6) 2026-08-03 00:14:33 +01:00
.scripts chore: add shared tooling and project config 2026-03-30 21:09:53 +01:00
Sources/FlagEmojis style: apply shared swiftformat and swiftlint fixes 2026-03-30 21:10:08 +01:00
Tests/FlagEmojis style: apply shared swiftformat and swiftlint fixes 2026-03-30 21:10:08 +01:00
.gitignore build: add SwiftLint configuration 2026-03-30 17:09:16 +01:00
.swiftlint.yml build: add SwiftLint configuration 2026-03-30 17:09:16 +01:00
.swiftlint_child.yml build: add SwiftLint configuration 2026-03-30 17:09:16 +01:00
Brewfile fix(tooling): fail closed in the format recipes, un-vendor git-format-staged (#10) 2026-08-29 22:44:59 +01:00
CLAUDE.md chore: add shared tooling and project config 2026-03-30 21:09:53 +01:00
justfile fix(tooling): fail closed in the format recipes, un-vendor git-format-staged (#10) 2026-08-29 22:44:59 +01:00
Mintfile chore(deps): update dependency nicklockwood/swiftformat to v0.63.0 (#11) 2026-08-31 00:30:50 +00:00
Package.swift style: apply shared swiftformat and swiftlint fixes 2026-03-30 21:10:08 +01:00
README.md FlagEmojis 2025-03-16 00:06:46 +00:00
renovate.json chore(renovate): automerge minor and patch updates (#9) 2026-08-29 11:27:46 +01:00

FlagEmojis

CI

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

  1. From the File menu, select Add Package Dependencies...
  2. 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 💜