flag-resizer 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATTRIBUTION.txt +27 -2
- package/CHANGELOG.md +19 -1
- package/LICENSE-GRAPHICS +40 -2
- package/README.md +80 -23
- package/dist/generator.js +260 -2
- package/dist/generator.js.map +1 -1
- package/dist/index.d.ts +258 -0
- package/dist/index.d.ts.map +1 -1
- package/flags/ar-a.svg +75 -0
- package/flags/ar-b.svg +164 -0
- package/flags/ar-c.svg +653 -0
- package/flags/ar-d.svg +862 -0
- package/flags/ar-e.svg +35 -0
- package/flags/ar-f.svg +67 -0
- package/flags/ar-g.svg +74 -0
- package/flags/ar-h.svg +83 -0
- package/flags/ar-j.svg +228 -0
- package/flags/ar-k.svg +242 -0
- package/flags/ar-l.svg +1232 -0
- package/flags/ar-m.svg +810 -0
- package/flags/ar-n.svg +14 -0
- package/flags/ar-p.svg +257 -0
- package/flags/ar-q.svg +70 -0
- package/flags/ar-r.svg +26 -0
- package/flags/ar-s.svg +173 -0
- package/flags/ar-t.svg +24 -0
- package/flags/ar-u.svg +70 -0
- package/flags/ar-v.svg +21 -0
- package/flags/ar-w.svg +232 -0
- package/flags/ar-x.svg +22 -0
- package/flags/ar-y.svg +302 -0
- package/flags/ar-z.svg +173 -0
- package/flags/at-1.svg +214 -0
- package/flags/at-2.svg +495 -0
- package/flags/at-3.svg +189 -0
- package/flags/at-4.svg +109 -0
- package/flags/at-5.svg +69 -0
- package/flags/at-6.svg +12 -0
- package/flags/at-7.svg +320 -0
- package/flags/at-8.svg +217 -0
- package/flags/at-9.svg +92 -0
- package/flags/br-ac.svg +14 -0
- package/flags/br-al.svg +413 -0
- package/flags/br-am.svg +41 -0
- package/flags/br-ap.svg +22 -0
- package/flags/br-ba.svg +16 -0
- package/flags/br-ce.svg +88 -0
- package/flags/br-df.svg +15 -0
- package/flags/br-es.svg +23 -0
- package/flags/br-go.svg +17 -0
- package/flags/br-ma.svg +31 -0
- package/flags/br-mg.svg +29 -0
- package/flags/br-ms.svg +25 -0
- package/flags/br-mt.svg +24 -0
- package/flags/br-pa.svg +38 -0
- package/flags/br-pb.svg +15 -0
- package/flags/br-pe.svg +20 -0
- package/flags/br-pi.svg +36 -0
- package/flags/br-pr.svg +37 -0
- package/flags/br-rj.svg +357 -0
- package/flags/br-rn.svg +12 -0
- package/flags/br-ro.svg +17 -0
- package/flags/br-rr.svg +19 -0
- package/flags/br-rs.svg +103 -0
- package/flags/br-sc.svg +369 -0
- package/flags/br-se.svg +15 -0
- package/flags/br-sp.svg +36 -0
- package/flags/br-to.svg +19 -0
- package/flags/ch-ag.svg +13 -0
- package/flags/ch-ai.svg +13 -0
- package/flags/ch-ar.svg +13 -0
- package/flags/ch-be.svg +31 -0
- package/flags/ch-bl.svg +46 -0
- package/flags/ch-bs.svg +13 -0
- package/flags/ch-fr.svg +13 -0
- package/flags/ch-ge.svg +181 -0
- package/flags/ch-gl.svg +13 -0
- package/flags/ch-gr.svg +14 -0
- package/flags/ch-ju.svg +39 -0
- package/flags/ch-lu.svg +13 -0
- package/flags/ch-ne.svg +15 -0
- package/flags/ch-nw.svg +29 -0
- package/flags/ch-ow.svg +14 -0
- package/flags/ch-sg.svg +18 -0
- package/flags/ch-sh.svg +45 -0
- package/flags/ch-so.svg +13 -0
- package/flags/ch-sz.svg +13 -0
- package/flags/ch-tg.svg +47 -0
- package/flags/ch-ti.svg +13 -0
- package/flags/ch-ur.svg +176 -0
- package/flags/ch-vd.svg +43 -0
- package/flags/ch-vs.svg +45 -0
- package/flags/ch-zg.svg +15 -0
- package/flags/ch-zh.svg +13 -0
- package/flags/co-ama.svg +25 -0
- package/flags/co-ant.svg +16 -0
- package/flags/co-ara.svg +13 -0
- package/flags/co-atl.svg +13 -0
- package/flags/co-bol.svg +14 -0
- package/flags/co-boy.svg +39 -0
- package/flags/co-cal.svg +13 -0
- package/flags/co-caq.svg +39 -0
- package/flags/co-cas.svg +26 -0
- package/flags/co-cau.svg +13 -0
- package/flags/co-ces.svg +13 -0
- package/flags/co-cho.svg +14 -0
- package/flags/co-cor.svg +14 -0
- package/flags/co-cun.svg +287 -0
- package/flags/co-dc.svg +27 -0
- package/flags/co-gua.svg +14 -0
- package/flags/co-guv.svg +367 -0
- package/flags/co-hui.svg +22 -0
- package/flags/co-lag.svg +13 -0
- package/flags/co-mag.svg +34 -0
- package/flags/co-met.svg +13 -0
- package/flags/co-nar.svg +13 -0
- package/flags/co-nsa.svg +29 -0
- package/flags/co-put.svg +14 -0
- package/flags/co-qui.svg +14 -0
- package/flags/co-ris.svg +38 -0
- package/flags/co-san.svg +103 -0
- package/flags/co-sap.svg +13 -0
- package/flags/co-suc.svg +648 -0
- package/flags/co-tol.svg +13 -0
- package/flags/co-vac.svg +14 -0
- package/flags/co-vau.svg +14 -0
- package/flags/co-vid.svg +13 -0
- package/flags/gr-69.svg +59 -0
- package/flags/gr-a.svg +18 -0
- package/flags/gr-b.svg +18 -0
- package/flags/gr-c.svg +18 -0
- package/flags/it-21.svg +123 -0
- package/flags/it-23.svg +13 -0
- package/flags/it-25.svg +13 -0
- package/flags/it-32.svg +58 -0
- package/flags/it-34.svg +406 -0
- package/flags/it-36.svg +343 -0
- package/flags/it-42.svg +141 -0
- package/flags/it-45.svg +213 -0
- package/flags/it-52.svg +913 -0
- package/flags/it-55.svg +71 -0
- package/flags/it-57.svg +128 -0
- package/flags/it-62.svg +12 -0
- package/flags/it-65.svg +20 -0
- package/flags/it-67.svg +160 -0
- package/flags/it-72.svg +86 -0
- package/flags/it-75.svg +16 -0
- package/flags/it-77.svg +93 -0
- package/flags/it-78.svg +68 -0
- package/flags/it-82.svg +132 -0
- package/flags/it-88.svg +285 -0
- package/flags/jp-01.svg +26 -0
- package/flags/jp-02.svg +60 -0
- package/flags/jp-03.svg +15 -0
- package/flags/jp-04.svg +14 -0
- package/flags/jp-05.svg +13 -0
- package/flags/jp-06.svg +13 -0
- package/flags/jp-07.svg +17 -0
- package/flags/jp-08.svg +13 -0
- package/flags/jp-09.svg +17 -0
- package/flags/jp-10.svg +30 -0
- package/flags/jp-11.svg +20 -0
- package/flags/jp-12.svg +14 -0
- package/flags/jp-13.svg +21 -0
- package/flags/jp-14.svg +13 -0
- package/flags/jp-15.svg +13 -0
- package/flags/jp-16.svg +30 -0
- package/flags/jp-17.svg +36 -0
- package/flags/jp-18.svg +13 -0
- package/flags/jp-19.svg +22 -0
- package/flags/jp-20.svg +14 -0
- package/flags/jp-21.svg +40 -0
- package/flags/jp-22.svg +13 -0
- package/flags/jp-23.svg +53 -0
- package/flags/jp-24.svg +14 -0
- package/flags/jp-25.svg +13 -0
- package/flags/jp-26.svg +33 -0
- package/flags/jp-27.svg +20 -0
- package/flags/jp-28.svg +12 -0
- package/flags/jp-29.svg +17 -0
- package/flags/jp-30.svg +13 -0
- package/flags/jp-31.svg +13 -0
- package/flags/jp-32.svg +17 -0
- package/flags/jp-33.svg +23 -0
- package/flags/jp-34.svg +13 -0
- package/flags/jp-35.svg +13 -0
- package/flags/jp-36.svg +20 -0
- package/flags/jp-37.svg +19 -0
- package/flags/jp-38.svg +12 -0
- package/flags/jp-39.svg +13 -0
- package/flags/jp-40.svg +28 -0
- package/flags/jp-41.svg +22 -0
- package/flags/jp-42.svg +14 -0
- package/flags/jp-43.svg +13 -0
- package/flags/jp-44.svg +19 -0
- package/flags/jp-45.svg +12 -0
- package/flags/jp-46.svg +16 -0
- package/flags/jp-47.svg +15 -0
- package/flags/mx-agu.svg +942 -0
- package/flags/mx-bcn.svg +265 -0
- package/flags/mx-bcs.svg +200 -0
- package/flags/mx-cam.svg +3954 -0
- package/flags/mx-chh.svg +154 -0
- package/flags/mx-chp.svg +12 -0
- package/flags/mx-cmx.svg +12 -0
- package/flags/mx-coa.svg +1013 -0
- package/flags/mx-col.svg +1073 -0
- package/flags/mx-dur.svg +1022 -0
- package/flags/mx-gro.svg +135 -0
- package/flags/mx-gua.svg +1579 -0
- package/flags/mx-hid.svg +1442 -0
- package/flags/mx-jal.svg +65 -0
- package/flags/mx-mex.svg +560 -0
- package/flags/mx-mic.svg +3815 -0
- package/flags/mx-mor.svg +136 -0
- package/flags/mx-nay.svg +2206 -0
- package/flags/mx-nle.svg +133 -0
- package/flags/mx-oax.svg +3301 -0
- package/flags/mx-pue.svg +469 -0
- package/flags/mx-que.svg +1323 -0
- package/flags/mx-roo.svg +368 -0
- package/flags/mx-sin.svg +12 -0
- package/flags/mx-slp.svg +244 -0
- package/flags/mx-son.svg +467 -0
- package/flags/mx-tab.svg +275 -0
- package/flags/mx-tam.svg +236 -0
- package/flags/mx-tla.svg +634 -0
- package/flags/mx-ver.svg +561 -0
- package/flags/mx-yuc.svg +21 -0
- package/flags/mx-zac.svg +1285 -0
- package/flags/pl-02.svg +70 -0
- package/flags/pl-04.svg +14 -0
- package/flags/pl-06.svg +277 -0
- package/flags/pl-08.svg +44 -0
- package/flags/pl-10.svg +12 -0
- package/flags/pl-12.svg +70 -0
- package/flags/pl-14.svg +33 -0
- package/flags/pl-16.svg +27 -0
- package/flags/pl-18.svg +36 -0
- package/flags/pl-20.svg +15 -0
- package/flags/pl-22.svg +145 -0
- package/flags/pl-24.svg +34 -0
- package/flags/pl-26.svg +236 -0
- package/flags/pl-28.svg +88 -0
- package/flags/pl-30.svg +159 -0
- package/flags/pl-32.svg +109 -0
- package/flags/pt-01.svg +8 -0
- package/flags/pt-02.svg +10291 -0
- package/flags/pt-03.svg +8 -0
- package/flags/pt-04.svg +8 -0
- package/flags/pt-05.svg +8 -0
- package/flags/pt-06.svg +8 -0
- package/flags/pt-07.svg +8 -0
- package/flags/pt-08.svg +8 -0
- package/flags/pt-09.svg +8 -0
- package/flags/pt-10.svg +8 -0
- package/flags/pt-11.svg +1233 -0
- package/flags/pt-12.svg +1 -0
- package/flags/pt-13.svg +8 -0
- package/flags/pt-14.svg +8 -0
- package/flags/pt-15.svg +8 -0
- package/flags/pt-16.svg +8 -0
- package/flags/pt-17.svg +8 -0
- package/flags/pt-18.svg +8 -0
- package/flags/pt-20.svg +239 -0
- package/flags/pt-30.svg +16 -0
- package/package.json +1 -1
package/ATTRIBUTION.txt
CHANGED
|
@@ -12,12 +12,37 @@ Copyright (c) 2013 Panayiotis Lipiridis
|
|
|
12
12
|
Source: https://github.com/lipis/flag-icons
|
|
13
13
|
License: MIT
|
|
14
14
|
|
|
15
|
-
Canadian, Australian,
|
|
16
|
-
|
|
15
|
+
Argentinian, Austrian, Canadian, Australian, Brazilian, Swiss, Colombian,
|
|
16
|
+
German, Greek, Mexican, Polish, Portuguese, Spanish, Italian, and Japanese
|
|
17
|
+
subdivision flag graphics
|
|
18
|
+
(`ar-*`, `at-*`, `ca-*`, `au-*`, `br-*`, `ch-*` except `ch-ar`, `co-*`,
|
|
19
|
+
`de-*`, `gr-*`, `mx-*`, `pl-*`, `pt-*` except `pt-02`, `pt-12`, and
|
|
20
|
+
`pt-17`, `es-*`, `it-*`, `jp-*`)
|
|
17
21
|
Copyright (c) 2021 AJ McKenna
|
|
18
22
|
Source: https://github.com/amckenna41/iso3166-flags
|
|
19
23
|
License: MIT
|
|
20
24
|
|
|
25
|
+
Appenzell Ausserrhoden flag graphic (`ch-ar`)
|
|
26
|
+
Source: https://commons.wikimedia.org/wiki/File:Flag_of_Canton_of_Appenzell_Ausserrhoden.svg
|
|
27
|
+
License status: Public domain (Swiss official work)
|
|
28
|
+
|
|
29
|
+
Beja flag graphic (`pt-02`)
|
|
30
|
+
Author: 117-M-I-K-E
|
|
31
|
+
Source: https://commons.wikimedia.org/wiki/File:Flag_of_Beja.svg
|
|
32
|
+
License status: Public domain (Portuguese official insignia)
|
|
33
|
+
|
|
34
|
+
Portalegre flag crest (`pt-12`)
|
|
35
|
+
Author: Sérgio Horta
|
|
36
|
+
Source: https://commons.wikimedia.org/wiki/File:PTG.png
|
|
37
|
+
License: Creative Commons Attribution-ShareAlike 3.0 (CC BY-SA 3.0)
|
|
38
|
+
License URI: https://creativecommons.org/licenses/by-sa/3.0/
|
|
39
|
+
|
|
40
|
+
Vila Real flag graphic (`pt-17`)
|
|
41
|
+
Author: Zloyel
|
|
42
|
+
Source: https://commons.wikimedia.org/wiki/File:Bandeira_de_Vila_Real.jpg
|
|
43
|
+
License: Creative Commons Attribution-ShareAlike 3.0 (CC BY-SA 3.0)
|
|
44
|
+
License URI: https://creativecommons.org/licenses/by-sa/3.0/
|
|
45
|
+
|
|
21
46
|
U.S. state flag graphics (`us-*`)
|
|
22
47
|
Source: https://flagcdn.com/
|
|
23
48
|
Original vector sources: https://commons.wikimedia.org/
|
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,25 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
#### 0.0.
|
|
7
|
+
#### [v0.0.3](https://github.com/Celtian/flag-resizer/compare/v0.0.2...v0.0.3)
|
|
8
|
+
|
|
9
|
+
- Feat/regions [`#2`](https://github.com/Celtian/flag-resizer/pull/2)
|
|
10
|
+
- feat(resions): regional flags added [`3026ea3`](https://github.com/Celtian/flag-resizer/commit/3026ea3d1b9e6df19674cf143a7ad2e6247acd01)
|
|
11
|
+
- feat(regions): colombia, portugal, argentina [`da34b8d`](https://github.com/Celtian/flag-resizer/commit/da34b8d956f87cc0857ca0afd2ff6a558d1d1904)
|
|
12
|
+
- feat(regions): austria poland greece [`679cf45`](https://github.com/Celtian/flag-resizer/commit/679cf458bd8e0e390444b8a5414d83b00816cb9e)
|
|
13
|
+
|
|
14
|
+
#### [v0.0.2](https://github.com/Celtian/flag-resizer/compare/v0.0.1...v0.0.2)
|
|
15
|
+
|
|
16
|
+
> 30 July 2026
|
|
17
|
+
|
|
18
|
+
- Feat/flags [`#1`](https://github.com/Celtian/flag-resizer/pull/1)
|
|
19
|
+
- feat(flags): italian flags added [`52cde0d`](https://github.com/Celtian/flag-resizer/commit/52cde0d18947d6de57d590297f5a8e5349228d37)
|
|
20
|
+
- chore(readme): readme added [`f257d56`](https://github.com/Celtian/flag-resizer/commit/f257d56e4411c4c7a5dd6c06f3fdbc44eb79de8f)
|
|
21
|
+
- chore(update): patch release 0.0.2 🐛 [`daff60e`](https://github.com/Celtian/flag-resizer/commit/daff60e67d6c71b66393b6eb4eded5a0a7f7255b)
|
|
22
|
+
|
|
23
|
+
#### v0.0.1
|
|
24
|
+
|
|
25
|
+
> 30 July 2026
|
|
8
26
|
|
|
9
27
|
- feat(cli): cli added [`9565d56`](https://github.com/Celtian/flag-resizer/commit/9565d56a1af0f66f7bc16697533143999d5dcd30)
|
|
10
28
|
- feat(flags): more flags added [`0b138f0`](https://github.com/Celtian/flag-resizer/commit/0b138f0fded8e0d5846ca865c9e8d100d57f80c0)
|
package/LICENSE-GRAPHICS
CHANGED
|
@@ -21,12 +21,50 @@ Flagpedia identifies its flag images as public domain and available for use
|
|
|
21
21
|
without restriction:
|
|
22
22
|
https://flagpedia.net/terms
|
|
23
23
|
|
|
24
|
-
Canadian, Australian,
|
|
25
|
-
|
|
24
|
+
Argentinian, Austrian, Canadian, Australian, Brazilian, Swiss, Colombian,
|
|
25
|
+
German, Greek, Mexican, Polish, Portuguese, Spanish, Italian, and Japanese
|
|
26
|
+
subdivision flag graphics
|
|
27
|
+
(`ar-*.svg`, `at-*.svg`, `ca-*.svg`, `au-*.svg`, `br-*.svg`, `ch-*.svg`
|
|
28
|
+
except `ch-ar.svg`, `co-*.svg`, `de-*.svg`, `gr-*.svg`, `mx-*.svg`,
|
|
29
|
+
`pl-*.svg`, `pt-*.svg` except `pt-02.svg`, `pt-12.svg`, and `pt-17.svg`,
|
|
30
|
+
`es-*.svg`, `it-*.svg`, `jp-*.svg`)
|
|
26
31
|
|
|
27
32
|
Source:
|
|
28
33
|
https://github.com/amckenna41/iso3166-flags
|
|
29
34
|
|
|
35
|
+
Appenzell Ausserrhoden flag graphic (`ch-ar.svg`)
|
|
36
|
+
|
|
37
|
+
Source:
|
|
38
|
+
https://commons.wikimedia.org/wiki/File:Flag_of_Canton_of_Appenzell_Ausserrhoden.svg
|
|
39
|
+
|
|
40
|
+
This Swiss official work is identified as public domain on its Wikimedia
|
|
41
|
+
Commons source page. Legal restrictions on the use of official insignia may
|
|
42
|
+
apply independently of copyright.
|
|
43
|
+
|
|
44
|
+
Beja flag graphic (`pt-02.svg`)
|
|
45
|
+
|
|
46
|
+
Author: 117-M-I-K-E
|
|
47
|
+
Source:
|
|
48
|
+
https://commons.wikimedia.org/wiki/File:Flag_of_Beja.svg
|
|
49
|
+
|
|
50
|
+
The source page identifies this Portuguese official insignia as public domain.
|
|
51
|
+
The artwork was normalized to the package's rounded 36×36 SVG canvas.
|
|
52
|
+
|
|
53
|
+
Portalegre and Vila Real flag graphics (`pt-12.svg`, `pt-17.svg`)
|
|
54
|
+
|
|
55
|
+
Authors: Sérgio Horta (`pt-12.svg`) and Zloyel (`pt-17.svg`)
|
|
56
|
+
Sources:
|
|
57
|
+
https://commons.wikimedia.org/wiki/File:PTG.png
|
|
58
|
+
https://commons.wikimedia.org/wiki/File:Bandeira_de_Vila_Real.jpg
|
|
59
|
+
|
|
60
|
+
These source graphics are licensed under the Creative Commons
|
|
61
|
+
Attribution-ShareAlike 3.0 Unported license (CC BY-SA 3.0):
|
|
62
|
+
https://creativecommons.org/licenses/by-sa/3.0/
|
|
63
|
+
|
|
64
|
+
The Portalegre crest was composited over a reconstructed vector flag field, and
|
|
65
|
+
both graphics were resized and normalized to the package's rounded 36×36 SVG
|
|
66
|
+
canvas. These adaptations are distributed under CC BY-SA 3.0.
|
|
67
|
+
|
|
30
68
|
Northern Ireland flag graphic (`gb-nir.svg`)
|
|
31
69
|
|
|
32
70
|
Source:
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ a deterministic TypeScript manifest alongside the assets.
|
|
|
20
20
|
|
|
21
21
|
| Feature | Details |
|
|
22
22
|
| --------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
23
|
-
| 🏳️ **Bundled flags** | Includes
|
|
23
|
+
| 🏳️ **Bundled flags** | Includes 627 regional and subdivision flags across Twemoji, FlagCDN, and ISO 3166-2 sources. |
|
|
24
24
|
| 🖼️ **Optimized image sets** | Generates PNG, WebP, or both at every configured size and quality. |
|
|
25
25
|
| 🧩 **Typed application paths** | Produces country, size, format, dimension, and public-path constants with a typed path helper. |
|
|
26
26
|
| 🎯 **Reusable profiles** | Supports independent country filters, dimensions, formats, and output locations. |
|
|
@@ -85,9 +85,28 @@ export default defineConfig({
|
|
|
85
85
|
Filter values are lowercase flag or country codes, not language codes. They can be exact codes or
|
|
86
86
|
patterns using `*` as a wildcard. For example, use `cz` for the Czech flag, `gb` for the British
|
|
87
87
|
flag, or `us-*` for all 50 U.S. subdivision flags. The `us-*` pattern does not include the national
|
|
88
|
-
`us` flag; add `us` separately if needed. Likewise, `
|
|
89
|
-
selects
|
|
90
|
-
|
|
88
|
+
`us` flag; add `us` separately if needed. Likewise, `ar-*` selects Argentinian subdivisions,
|
|
89
|
+
`at-*` selects Austrian states, `ca-*` selects Canadian subdivisions, `au-*` selects Australian
|
|
90
|
+
subdivisions, `br-*` selects Brazilian federative units, `ch-*` selects Swiss cantons, `co-*`
|
|
91
|
+
selects Colombian subdivisions, `de-*` selects German states, `es-*` selects Spanish autonomous
|
|
92
|
+
communities and cities, `gr-*` selects the four Greek subdivision codes with bundled artwork,
|
|
93
|
+
`it-*` selects Italian regions, `jp-*` selects Japanese prefectures, `mx-*` selects Mexican federal
|
|
94
|
+
entities, `pl-*` selects Polish voivodeships, `pt-*` selects Portuguese subdivisions, and `*`
|
|
95
|
+
selects every bundled flag.
|
|
96
|
+
|
|
97
|
+
To generate only national and territorial flags, blacklist `*-*`:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
filter: {
|
|
101
|
+
type: 'blacklist',
|
|
102
|
+
values: ['*-*'],
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Every bundled subdivision code contains a hyphen, so `*-*` matches all subdivisions without
|
|
107
|
+
matching national or territorial codes such as `us`, `hk`, `mo`, or `ac`. Whitelisting `*-*`
|
|
108
|
+
instead generates only subdivisions. Additional exact exclusions can be combined with the global
|
|
109
|
+
pattern; for example, `values: ['*-*', 'cz']` excludes every subdivision and the Czech flag.
|
|
91
110
|
|
|
92
111
|
Subdivision codes can also be selected individually: `gb-eng`, `gb-nir`, `gb-sct`, and `gb-wls`
|
|
93
112
|
for the United Kingdom; `us-ca` for California; `ca-on` for Ontario; or `au-nsw` for New South
|
|
@@ -102,10 +121,30 @@ The 50 U.S. state assets come from [FlagCDN](https://flagcdn.com/), whose flag a
|
|
|
102
121
|
[Flagpedia's terms](https://flagpedia.net/terms). The source artwork is normalized to the same
|
|
103
122
|
rounded 36×36 canvas as the bundled Twemoji flags.
|
|
104
123
|
|
|
105
|
-
The 13 Canadian, 8 Australian,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
124
|
+
The 24 Argentinian, 9 Austrian, 13 Canadian, 8 Australian, 27 Brazilian, 26 Swiss, 33 Colombian,
|
|
125
|
+
16 German, 4 Greek, 19 Spanish, 20 Italian, 47 Japanese, 32 Mexican, 16 Polish, and 20 Portuguese
|
|
126
|
+
subdivision sets primarily come from the MIT-licensed
|
|
127
|
+
[iso3166-flags](https://github.com/amckenna41/iso3166-flags) dataset and use current ISO 3166-2
|
|
128
|
+
codes. The `ch-ar` asset instead uses the square, public-domain flag artwork from
|
|
129
|
+
[Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Flag_of_Canton_of_Appenzell_Ausserrhoden.svg);
|
|
130
|
+
this avoids stretching the shield-shaped upstream artwork. The `pt-02` asset likewise uses a
|
|
131
|
+
higher-detail, public-domain vector from
|
|
132
|
+
[Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Flag_of_Beja.svg), while `pt-12` and
|
|
133
|
+
`pt-17` use higher-resolution Commons artwork under CC BY-SA 3.0. Spain's set covers its 17
|
|
134
|
+
autonomous communities and 2 autonomous cities, not its 50 provinces; Italy's set covers its
|
|
135
|
+
regions, not its provinces or metropolitan cities; Argentina's set covers its 23 provinces and
|
|
136
|
+
autonomous city; Brazil's set covers its 26 states and Federal District; Colombia's set covers its
|
|
137
|
+
32 departments and capital district; Switzerland's set covers its 26 cantons; Japan's set covers
|
|
138
|
+
its 47 prefectures; Mexico's set covers its 31 states and Mexico City; and Portugal's set covers its
|
|
139
|
+
18 districts and 2 autonomous regions. Greece has 14 current ISO 3166-2 subdivisions, but the
|
|
140
|
+
source provides Mount Athos artwork and reuses the unofficial Greek Macedonia flag for `gr-a`,
|
|
141
|
+
`gr-b`, and `gr-c`; the other 10 administrative regions are not bundled. Some Mexican subdivision
|
|
142
|
+
designs are representative de facto banners rather than legally adopted state flags.
|
|
143
|
+
The Mexico City source and 16 Portuguese district assets are raster-backed. The `pt-12` and `pt-17`
|
|
144
|
+
assets use the higher-resolution Commons sources described above; the remaining raster-backed
|
|
145
|
+
Portuguese assets use source images from the ISO dataset. They are embedded in normalized SVG
|
|
146
|
+
wrappers. The non-rectangular official silhouettes of `pl-28` and `pl-30` intentionally retain
|
|
147
|
+
transparency around their fly edges. All source artwork is normalized to the rounded 36×36 canvas.
|
|
109
148
|
|
|
110
149
|
All sizes in one profile must use the same aspect ratio. Output paths are resolved relative to the
|
|
111
150
|
configuration file. A `publicPath` can be a root-relative path or an absolute CDN URL.
|
|
@@ -206,7 +245,13 @@ Each profile generates:
|
|
|
206
245
|
- `getFlagPath(code, size, format)`.
|
|
207
246
|
|
|
208
247
|
```ts
|
|
209
|
-
import {
|
|
248
|
+
import {
|
|
249
|
+
FLAGS,
|
|
250
|
+
FLAG_DIMENSIONS,
|
|
251
|
+
getFlagPath,
|
|
252
|
+
type CountryCode,
|
|
253
|
+
type FlagSize,
|
|
254
|
+
} from './generated/flags';
|
|
210
255
|
|
|
211
256
|
function flagImage(code: CountryCode, size: FlagSize) {
|
|
212
257
|
return {
|
|
@@ -216,19 +261,31 @@ function flagImage(code: CountryCode, size: FlagSize) {
|
|
|
216
261
|
}
|
|
217
262
|
```
|
|
218
263
|
|
|
219
|
-
An Angular
|
|
264
|
+
An Angular component can precompute the generated paths for a responsive picture, keeping
|
|
265
|
+
function calls out of the template:
|
|
266
|
+
|
|
267
|
+
```ts
|
|
268
|
+
function createFlagPicture(code: CountryCode) {
|
|
269
|
+
return {
|
|
270
|
+
webpSrcset: [
|
|
271
|
+
getFlagPath(code, '20x15', 'webp'),
|
|
272
|
+
`${getFlagPath(code, '40x30', 'webp')} 2x`,
|
|
273
|
+
`${getFlagPath(code, '60x45', 'webp')} 3x`,
|
|
274
|
+
].join(', '),
|
|
275
|
+
pngSrc: getFlagPath(code, '20x15', 'png'),
|
|
276
|
+
alt: FLAGS[code],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export class FlagComponent {
|
|
281
|
+
protected readonly flag = createFlagPicture('cz');
|
|
282
|
+
}
|
|
283
|
+
```
|
|
220
284
|
|
|
221
285
|
```html
|
|
222
286
|
<picture>
|
|
223
|
-
<source
|
|
224
|
-
|
|
225
|
-
[attr.srcset]="
|
|
226
|
-
getFlagPath(code, '20x15', 'webp') + ', ' +
|
|
227
|
-
getFlagPath(code, '40x30', 'webp') + ' 2x, ' +
|
|
228
|
-
getFlagPath(code, '60x45', 'webp') + ' 3x'
|
|
229
|
-
"
|
|
230
|
-
/>
|
|
231
|
-
<img [src]="getFlagPath(code, '20x15', 'png')" [width]="20" [height]="15" [alt]="FLAGS[code]" />
|
|
287
|
+
<source type="image/webp" [attr.srcset]="flag.webpSrcset" />
|
|
288
|
+
<img [src]="flag.pngSrc" [width]="20" [height]="15" [alt]="flag.alt" />
|
|
232
289
|
</picture>
|
|
233
290
|
```
|
|
234
291
|
|
|
@@ -334,7 +391,7 @@ Copyright © 2026 [Dominik Hladík](https://github.com/Celtian).
|
|
|
334
391
|
The package code is licensed under the [MIT License](LICENSE).
|
|
335
392
|
|
|
336
393
|
The bundled graphics use source-specific terms: Twemoji is licensed under CC-BY-4.0; the Northern
|
|
337
|
-
Ireland
|
|
338
|
-
|
|
339
|
-
notices
|
|
340
|
-
[
|
|
394
|
+
Ireland and ISO-sourced subdivision assets are MIT-licensed; and the FlagCDN U.S. state artwork is
|
|
395
|
+
public domain. Generated asset roots include attribution and license notices. Keep the required
|
|
396
|
+
notices when redistributing the graphics. See [ATTRIBUTION.txt](ATTRIBUTION.txt) and
|
|
397
|
+
[LICENSE-GRAPHICS](LICENSE-GRAPHICS).
|
package/dist/generator.js
CHANGED
|
@@ -19,8 +19,41 @@ const FLAGS = {
|
|
|
19
19
|
ao: "Angola",
|
|
20
20
|
aq: "Antarctica",
|
|
21
21
|
ar: "Argentina",
|
|
22
|
+
"ar-a": "Salta",
|
|
23
|
+
"ar-b": "Buenos Aires",
|
|
24
|
+
"ar-c": "Autonomous City of Buenos Aires",
|
|
25
|
+
"ar-d": "San Luis",
|
|
26
|
+
"ar-e": "Entre Ríos",
|
|
27
|
+
"ar-f": "La Rioja",
|
|
28
|
+
"ar-g": "Santiago del Estero",
|
|
29
|
+
"ar-h": "Chaco",
|
|
30
|
+
"ar-j": "San Juan",
|
|
31
|
+
"ar-k": "Catamarca",
|
|
32
|
+
"ar-l": "La Pampa",
|
|
33
|
+
"ar-m": "Mendoza",
|
|
34
|
+
"ar-n": "Misiones",
|
|
35
|
+
"ar-p": "Formosa",
|
|
36
|
+
"ar-q": "Neuquén",
|
|
37
|
+
"ar-r": "Río Negro",
|
|
38
|
+
"ar-s": "Santa Fe",
|
|
39
|
+
"ar-t": "Tucumán",
|
|
40
|
+
"ar-u": "Chubut",
|
|
41
|
+
"ar-v": "Tierra del Fuego",
|
|
42
|
+
"ar-w": "Corrientes",
|
|
43
|
+
"ar-x": "Córdoba",
|
|
44
|
+
"ar-y": "Jujuy",
|
|
45
|
+
"ar-z": "Santa Cruz",
|
|
22
46
|
as: "American Samoa",
|
|
23
47
|
at: "Austria",
|
|
48
|
+
"at-1": "Burgenland",
|
|
49
|
+
"at-2": "Carinthia",
|
|
50
|
+
"at-3": "Lower Austria",
|
|
51
|
+
"at-4": "Upper Austria",
|
|
52
|
+
"at-5": "Salzburg",
|
|
53
|
+
"at-6": "Styria",
|
|
54
|
+
"at-7": "Tyrol",
|
|
55
|
+
"at-8": "Vorarlberg",
|
|
56
|
+
"at-9": "Vienna",
|
|
24
57
|
au: "Australia",
|
|
25
58
|
"au-act": "Australian Capital Territory",
|
|
26
59
|
"au-nsw": "New South Wales",
|
|
@@ -48,6 +81,33 @@ const FLAGS = {
|
|
|
48
81
|
bo: "Bolivia",
|
|
49
82
|
bq: "Caribbean Netherlands",
|
|
50
83
|
br: "Brazil",
|
|
84
|
+
"br-ac": "Acre",
|
|
85
|
+
"br-al": "Alagoas",
|
|
86
|
+
"br-am": "Amazonas",
|
|
87
|
+
"br-ap": "Amapá",
|
|
88
|
+
"br-ba": "Bahia",
|
|
89
|
+
"br-ce": "Ceará",
|
|
90
|
+
"br-df": "Federal District",
|
|
91
|
+
"br-es": "Espírito Santo",
|
|
92
|
+
"br-go": "Goiás",
|
|
93
|
+
"br-ma": "Maranhão",
|
|
94
|
+
"br-mg": "Minas Gerais",
|
|
95
|
+
"br-ms": "Mato Grosso do Sul",
|
|
96
|
+
"br-mt": "Mato Grosso",
|
|
97
|
+
"br-pa": "Pará",
|
|
98
|
+
"br-pb": "Paraíba",
|
|
99
|
+
"br-pe": "Pernambuco",
|
|
100
|
+
"br-pi": "Piauí",
|
|
101
|
+
"br-pr": "Paraná",
|
|
102
|
+
"br-rj": "Rio de Janeiro",
|
|
103
|
+
"br-rn": "Rio Grande do Norte",
|
|
104
|
+
"br-ro": "Rondônia",
|
|
105
|
+
"br-rr": "Roraima",
|
|
106
|
+
"br-rs": "Rio Grande do Sul",
|
|
107
|
+
"br-sc": "Santa Catarina",
|
|
108
|
+
"br-se": "Sergipe",
|
|
109
|
+
"br-sp": "São Paulo",
|
|
110
|
+
"br-to": "Tocantins",
|
|
51
111
|
bs: "Bahamas",
|
|
52
112
|
bt: "Bhutan",
|
|
53
113
|
bv: "Bouvet Island",
|
|
@@ -73,12 +133,71 @@ const FLAGS = {
|
|
|
73
133
|
cf: "Central African Republic",
|
|
74
134
|
cg: "Republic of the Congo",
|
|
75
135
|
ch: "Switzerland",
|
|
136
|
+
"ch-ag": "Aargau",
|
|
137
|
+
"ch-ai": "Appenzell Innerrhoden",
|
|
138
|
+
"ch-ar": "Appenzell Ausserrhoden",
|
|
139
|
+
"ch-be": "Bern",
|
|
140
|
+
"ch-bl": "Basel-Landschaft",
|
|
141
|
+
"ch-bs": "Basel-Stadt",
|
|
142
|
+
"ch-fr": "Fribourg",
|
|
143
|
+
"ch-ge": "Genève",
|
|
144
|
+
"ch-gl": "Glarus",
|
|
145
|
+
"ch-gr": "Graubünden",
|
|
146
|
+
"ch-ju": "Jura",
|
|
147
|
+
"ch-lu": "Luzern",
|
|
148
|
+
"ch-ne": "Neuchâtel",
|
|
149
|
+
"ch-nw": "Nidwalden",
|
|
150
|
+
"ch-ow": "Obwalden",
|
|
151
|
+
"ch-sg": "Sankt Gallen",
|
|
152
|
+
"ch-sh": "Schaffhausen",
|
|
153
|
+
"ch-so": "Solothurn",
|
|
154
|
+
"ch-sz": "Schwyz",
|
|
155
|
+
"ch-tg": "Thurgau",
|
|
156
|
+
"ch-ti": "Ticino",
|
|
157
|
+
"ch-ur": "Uri",
|
|
158
|
+
"ch-vd": "Vaud",
|
|
159
|
+
"ch-vs": "Valais",
|
|
160
|
+
"ch-zg": "Zug",
|
|
161
|
+
"ch-zh": "Zürich",
|
|
76
162
|
ci: "Côte d'Ivoire (Ivory Coast)",
|
|
77
163
|
ck: "Cook Islands",
|
|
78
164
|
cl: "Chile",
|
|
79
165
|
cm: "Cameroon",
|
|
80
166
|
cn: "China",
|
|
81
167
|
co: "Colombia",
|
|
168
|
+
"co-ama": "Amazonas",
|
|
169
|
+
"co-ant": "Antioquia",
|
|
170
|
+
"co-ara": "Arauca",
|
|
171
|
+
"co-atl": "Atlántico",
|
|
172
|
+
"co-bol": "Bolívar",
|
|
173
|
+
"co-boy": "Boyacá",
|
|
174
|
+
"co-cal": "Caldas",
|
|
175
|
+
"co-caq": "Caquetá",
|
|
176
|
+
"co-cas": "Casanare",
|
|
177
|
+
"co-cau": "Cauca",
|
|
178
|
+
"co-ces": "Cesar",
|
|
179
|
+
"co-cho": "Chocó",
|
|
180
|
+
"co-cor": "Córdoba",
|
|
181
|
+
"co-cun": "Cundinamarca",
|
|
182
|
+
"co-dc": "Capital District of Bogotá",
|
|
183
|
+
"co-gua": "Guainía",
|
|
184
|
+
"co-guv": "Guaviare",
|
|
185
|
+
"co-hui": "Huila",
|
|
186
|
+
"co-lag": "La Guajira",
|
|
187
|
+
"co-mag": "Magdalena",
|
|
188
|
+
"co-met": "Meta",
|
|
189
|
+
"co-nar": "Nariño",
|
|
190
|
+
"co-nsa": "Norte de Santander",
|
|
191
|
+
"co-put": "Putumayo",
|
|
192
|
+
"co-qui": "Quindío",
|
|
193
|
+
"co-ris": "Risaralda",
|
|
194
|
+
"co-san": "Santander",
|
|
195
|
+
"co-sap": "San Andrés, Providencia and Santa Catalina",
|
|
196
|
+
"co-suc": "Sucre",
|
|
197
|
+
"co-tol": "Tolima",
|
|
198
|
+
"co-vac": "Valle del Cauca",
|
|
199
|
+
"co-vau": "Vaupés",
|
|
200
|
+
"co-vid": "Vichada",
|
|
82
201
|
cp: "Clipperton Island",
|
|
83
202
|
cq: "Sark",
|
|
84
203
|
cr: "Costa Rica",
|
|
@@ -163,6 +282,10 @@ const FLAGS = {
|
|
|
163
282
|
gp: "Guadeloupe",
|
|
164
283
|
gq: "Equatorial Guinea",
|
|
165
284
|
gr: "Greece",
|
|
285
|
+
"gr-69": "Mount Athos",
|
|
286
|
+
"gr-a": "Eastern Macedonia and Thrace",
|
|
287
|
+
"gr-b": "Central Macedonia",
|
|
288
|
+
"gr-c": "Western Macedonia",
|
|
166
289
|
gs: "South Georgia",
|
|
167
290
|
gt: "Guatemala",
|
|
168
291
|
gu: "Guam",
|
|
@@ -185,10 +308,77 @@ const FLAGS = {
|
|
|
185
308
|
ir: "Iran",
|
|
186
309
|
is: "Iceland",
|
|
187
310
|
it: "Italy",
|
|
311
|
+
"it-21": "Piedmont",
|
|
312
|
+
"it-23": "Aosta Valley",
|
|
313
|
+
"it-25": "Lombardy",
|
|
314
|
+
"it-32": "Trentino-South Tyrol",
|
|
315
|
+
"it-34": "Veneto",
|
|
316
|
+
"it-36": "Friuli–Venezia Giulia",
|
|
317
|
+
"it-42": "Liguria",
|
|
318
|
+
"it-45": "Emilia-Romagna",
|
|
319
|
+
"it-52": "Tuscany",
|
|
320
|
+
"it-55": "Umbria",
|
|
321
|
+
"it-57": "Marche",
|
|
322
|
+
"it-62": "Lazio",
|
|
323
|
+
"it-65": "Abruzzo",
|
|
324
|
+
"it-67": "Molise",
|
|
325
|
+
"it-72": "Campania",
|
|
326
|
+
"it-75": "Apulia",
|
|
327
|
+
"it-77": "Basilicata",
|
|
328
|
+
"it-78": "Calabria",
|
|
329
|
+
"it-82": "Sicily",
|
|
330
|
+
"it-88": "Sardinia",
|
|
188
331
|
je: "Jersey",
|
|
189
332
|
jm: "Jamaica",
|
|
190
333
|
jo: "Jordan",
|
|
191
334
|
jp: "Japan",
|
|
335
|
+
"jp-01": "Hokkaido",
|
|
336
|
+
"jp-02": "Aomori",
|
|
337
|
+
"jp-03": "Iwate",
|
|
338
|
+
"jp-04": "Miyagi",
|
|
339
|
+
"jp-05": "Akita",
|
|
340
|
+
"jp-06": "Yamagata",
|
|
341
|
+
"jp-07": "Fukushima",
|
|
342
|
+
"jp-08": "Ibaraki",
|
|
343
|
+
"jp-09": "Tochigi",
|
|
344
|
+
"jp-10": "Gunma",
|
|
345
|
+
"jp-11": "Saitama",
|
|
346
|
+
"jp-12": "Chiba",
|
|
347
|
+
"jp-13": "Tokyo",
|
|
348
|
+
"jp-14": "Kanagawa",
|
|
349
|
+
"jp-15": "Niigata",
|
|
350
|
+
"jp-16": "Toyama",
|
|
351
|
+
"jp-17": "Ishikawa",
|
|
352
|
+
"jp-18": "Fukui",
|
|
353
|
+
"jp-19": "Yamanashi",
|
|
354
|
+
"jp-20": "Nagano",
|
|
355
|
+
"jp-21": "Gifu",
|
|
356
|
+
"jp-22": "Shizuoka",
|
|
357
|
+
"jp-23": "Aichi",
|
|
358
|
+
"jp-24": "Mie",
|
|
359
|
+
"jp-25": "Shiga",
|
|
360
|
+
"jp-26": "Kyoto",
|
|
361
|
+
"jp-27": "Osaka",
|
|
362
|
+
"jp-28": "Hyogo",
|
|
363
|
+
"jp-29": "Nara",
|
|
364
|
+
"jp-30": "Wakayama",
|
|
365
|
+
"jp-31": "Tottori",
|
|
366
|
+
"jp-32": "Shimane",
|
|
367
|
+
"jp-33": "Okayama",
|
|
368
|
+
"jp-34": "Hiroshima",
|
|
369
|
+
"jp-35": "Yamaguchi",
|
|
370
|
+
"jp-36": "Tokushima",
|
|
371
|
+
"jp-37": "Kagawa",
|
|
372
|
+
"jp-38": "Ehime",
|
|
373
|
+
"jp-39": "Kochi",
|
|
374
|
+
"jp-40": "Fukuoka",
|
|
375
|
+
"jp-41": "Saga",
|
|
376
|
+
"jp-42": "Nagasaki",
|
|
377
|
+
"jp-43": "Kumamoto",
|
|
378
|
+
"jp-44": "Oita",
|
|
379
|
+
"jp-45": "Miyazaki",
|
|
380
|
+
"jp-46": "Kagoshima",
|
|
381
|
+
"jp-47": "Okinawa",
|
|
192
382
|
ke: "Kenya",
|
|
193
383
|
kg: "Kyrgyzstan",
|
|
194
384
|
kh: "Cambodia",
|
|
@@ -232,6 +422,38 @@ const FLAGS = {
|
|
|
232
422
|
mv: "Maldives",
|
|
233
423
|
mw: "Malawi",
|
|
234
424
|
mx: "Mexico",
|
|
425
|
+
"mx-agu": "Aguascalientes",
|
|
426
|
+
"mx-bcn": "Baja California",
|
|
427
|
+
"mx-bcs": "Baja California Sur",
|
|
428
|
+
"mx-cam": "Campeche",
|
|
429
|
+
"mx-chh": "Chihuahua",
|
|
430
|
+
"mx-chp": "Chiapas",
|
|
431
|
+
"mx-cmx": "Mexico City",
|
|
432
|
+
"mx-coa": "Coahuila",
|
|
433
|
+
"mx-col": "Colima",
|
|
434
|
+
"mx-dur": "Durango",
|
|
435
|
+
"mx-gro": "Guerrero",
|
|
436
|
+
"mx-gua": "Guanajuato",
|
|
437
|
+
"mx-hid": "Hidalgo",
|
|
438
|
+
"mx-jal": "Jalisco",
|
|
439
|
+
"mx-mex": "State of Mexico",
|
|
440
|
+
"mx-mic": "Michoacán",
|
|
441
|
+
"mx-mor": "Morelos",
|
|
442
|
+
"mx-nay": "Nayarit",
|
|
443
|
+
"mx-nle": "Nuevo León",
|
|
444
|
+
"mx-oax": "Oaxaca",
|
|
445
|
+
"mx-pue": "Puebla",
|
|
446
|
+
"mx-que": "Querétaro",
|
|
447
|
+
"mx-roo": "Quintana Roo",
|
|
448
|
+
"mx-sin": "Sinaloa",
|
|
449
|
+
"mx-slp": "San Luis Potosí",
|
|
450
|
+
"mx-son": "Sonora",
|
|
451
|
+
"mx-tab": "Tabasco",
|
|
452
|
+
"mx-tam": "Tamaulipas",
|
|
453
|
+
"mx-tla": "Tlaxcala",
|
|
454
|
+
"mx-ver": "Veracruz",
|
|
455
|
+
"mx-yuc": "Yucatán",
|
|
456
|
+
"mx-zac": "Zacatecas",
|
|
235
457
|
my: "Malaysia",
|
|
236
458
|
mz: "Mozambique",
|
|
237
459
|
na: "Namibia",
|
|
@@ -254,11 +476,47 @@ const FLAGS = {
|
|
|
254
476
|
ph: "Philippines",
|
|
255
477
|
pk: "Pakistan",
|
|
256
478
|
pl: "Poland",
|
|
479
|
+
"pl-02": "Lower Silesia",
|
|
480
|
+
"pl-04": "Kuyavia-Pomerania",
|
|
481
|
+
"pl-06": "Lublin",
|
|
482
|
+
"pl-08": "Lubusz",
|
|
483
|
+
"pl-10": "Łódź",
|
|
484
|
+
"pl-12": "Lesser Poland",
|
|
485
|
+
"pl-14": "Masovia",
|
|
486
|
+
"pl-16": "Opole",
|
|
487
|
+
"pl-18": "Subcarpathia",
|
|
488
|
+
"pl-20": "Podlaskie",
|
|
489
|
+
"pl-22": "Pomerania",
|
|
490
|
+
"pl-24": "Silesia",
|
|
491
|
+
"pl-26": "Holy Cross",
|
|
492
|
+
"pl-28": "Warmia-Masuria",
|
|
493
|
+
"pl-30": "Greater Poland",
|
|
494
|
+
"pl-32": "West Pomerania",
|
|
257
495
|
pm: "Saint Pierre and Miquelon",
|
|
258
496
|
pn: "Pitcairn Islands",
|
|
259
497
|
pr: "Puerto Rico",
|
|
260
498
|
ps: "Palestine",
|
|
261
499
|
pt: "Portugal",
|
|
500
|
+
"pt-01": "Aveiro",
|
|
501
|
+
"pt-02": "Beja",
|
|
502
|
+
"pt-03": "Braga",
|
|
503
|
+
"pt-04": "Bragança",
|
|
504
|
+
"pt-05": "Castelo Branco",
|
|
505
|
+
"pt-06": "Coimbra",
|
|
506
|
+
"pt-07": "Évora",
|
|
507
|
+
"pt-08": "Faro",
|
|
508
|
+
"pt-09": "Guarda",
|
|
509
|
+
"pt-10": "Leiria",
|
|
510
|
+
"pt-11": "Lisbon",
|
|
511
|
+
"pt-12": "Portalegre",
|
|
512
|
+
"pt-13": "Porto",
|
|
513
|
+
"pt-14": "Santarém",
|
|
514
|
+
"pt-15": "Setúbal",
|
|
515
|
+
"pt-16": "Viana do Castelo",
|
|
516
|
+
"pt-17": "Vila Real",
|
|
517
|
+
"pt-18": "Viseu",
|
|
518
|
+
"pt-20": "Azores",
|
|
519
|
+
"pt-30": "Madeira",
|
|
262
520
|
pw: "Palau",
|
|
263
521
|
py: "Paraguay",
|
|
264
522
|
qa: "Qatar",
|
|
@@ -599,7 +857,7 @@ export function getFlagPath(
|
|
|
599
857
|
size: FlagSize,
|
|
600
858
|
format: FlagFormat,
|
|
601
859
|
): string {
|
|
602
|
-
const publicPath = FLAG_PUBLIC_PATHS[format];
|
|
860
|
+
const publicPath: string = FLAG_PUBLIC_PATHS[format];
|
|
603
861
|
const basePath = publicPath === '/' ? '' : publicPath;
|
|
604
862
|
return \`\${basePath}/\${size}/\${code}.\${format}\`;
|
|
605
863
|
}
|
|
@@ -631,7 +889,7 @@ function assertSafeManagedFile(entry) {
|
|
|
631
889
|
const relative = path.relative(entry.root, target);
|
|
632
890
|
if (relative === "" || relative === ".." || relative.startsWith(`..${path.sep}`)) throw new FlagResizerError("The managed manifest contains a path outside its output root.");
|
|
633
891
|
const portable = entry.relativePath.split(path.sep).join("/");
|
|
634
|
-
if (!(entry.kind === "attribution" && portable === "ATTRIBUTION.txt" || entry.kind === "license" && portable === "LICENSE-GRAPHICS" || entry.kind === "typescript" && /^[^/]+\.ts$/u.test(portable) || entry.kind === "image" && /^[1-9]\d*x[1-9]\d*\/(?:[a-z]{2}|au-(?:act|nsw|nt|qld|sa|tas|vic|wa)|ca-(?:ab|bc|mb|nb|nl|ns|nt|nu|on|pe|qc|sk|yt)|de-(?:bb|be|bw|by|hb|he|hh|mv|ni|nw|rp|sh|sl|sn|st|th)|es-(?:an|ar|as|cb|ce|cl|cm|cn|ct|ex|ga|ib|mc|md|ml|nc|pv|ri|vc)|gb-(?:eng|nir|sct|wls)|us-(?:ak|al|ar|az|ca|co|ct|de|fl|ga|hi|ia|id|il|in|ks|ky|la|ma|md|me|mi|mn|mo|ms|mt|nc|nd|ne|nh|nj|nm|nv|ny|oh|ok|or|pa|ri|sc|sd|tn|tx|ut|va|vt|wa|wi|wv|wy))\.(?:png|webp)$/u.test(portable))) throw new FlagResizerError(`The managed manifest contains an invalid ${entry.kind} path: ${entry.relativePath}.`);
|
|
892
|
+
if (!(entry.kind === "attribution" && portable === "ATTRIBUTION.txt" || entry.kind === "license" && portable === "LICENSE-GRAPHICS" || entry.kind === "typescript" && /^[^/]+\.ts$/u.test(portable) || entry.kind === "image" && /^[1-9]\d*x[1-9]\d*\/(?:[a-z]{2}|ar-(?:[a-h]|[j-n]|[p-z])|at-[1-9]|au-(?:act|nsw|nt|qld|sa|tas|vic|wa)|br-(?:ac|al|am|ap|ba|ce|df|es|go|ma|mg|ms|mt|pa|pb|pe|pi|pr|rj|rn|ro|rr|rs|sc|se|sp|to)|ca-(?:ab|bc|mb|nb|nl|ns|nt|nu|on|pe|qc|sk|yt)|ch-(?:ag|ai|ar|be|bl|bs|fr|ge|gl|gr|ju|lu|ne|nw|ow|sg|sh|so|sz|tg|ti|ur|vd|vs|zg|zh)|co-(?:ama|ant|ara|atl|bol|boy|cal|caq|cas|cau|ces|cho|cor|cun|dc|gua|guv|hui|lag|mag|met|nar|nsa|put|qui|ris|san|sap|suc|tol|vac|vau|vid)|de-(?:bb|be|bw|by|hb|he|hh|mv|ni|nw|rp|sh|sl|sn|st|th)|es-(?:an|ar|as|cb|ce|cl|cm|cn|ct|ex|ga|ib|mc|md|ml|nc|pv|ri|vc)|gb-(?:eng|nir|sct|wls)|gr-(?:69|a|b|c)|it-(?:21|23|25|32|34|36|42|45|52|55|57|62|65|67|72|75|77|78|82|88)|jp-(?:0[1-9]|[1-3]\d|4[0-7])|mx-(?:agu|bcn|bcs|cam|chh|chp|cmx|coa|col|dur|gro|gua|hid|jal|mex|mic|mor|nay|nle|oax|pue|que|roo|sin|slp|son|tab|tam|tla|ver|yuc|zac)|pl-(?:02|04|06|08|10|12|14|16|18|20|22|24|26|28|30|32)|pt-(?:0[1-9]|1[0-8]|20|30)|us-(?:ak|al|ar|az|ca|co|ct|de|fl|ga|hi|ia|id|il|in|ks|ky|la|ma|md|me|mi|mn|mo|ms|mt|nc|nd|ne|nh|nj|nm|nv|ny|oh|ok|or|pa|ri|sc|sd|tn|tx|ut|va|vt|wa|wi|wv|wy))\.(?:png|webp)$/u.test(portable))) throw new FlagResizerError(`The managed manifest contains an invalid ${entry.kind} path: ${entry.relativePath}.`);
|
|
635
893
|
}
|
|
636
894
|
function managedFile(target, root, kind) {
|
|
637
895
|
const entry = {
|