@finbheara/domain 0.53.0 → 0.54.0
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/README.md +18 -0
- package/dist/event.js +231 -0
- package/dist/types/event.d.ts +13 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ person names.
|
|
|
7
7
|
|
|
8
8
|
- **Places**: a print in, the set of place-tree nodes it may mean out. A country, a state or
|
|
9
9
|
province, a county, a city, or a CLRG region, with a relation between any two readings.
|
|
10
|
+
- **CLRG events**: the Worlds, the nationals and the regional Oireachtais by event code, with
|
|
11
|
+
tier, canonical name, jurisdiction and North American eligibility.
|
|
10
12
|
- **CLRG regions**: the CLRG's dance regions and their Oireachtas codes, and the region a
|
|
11
13
|
location phrase falls in.
|
|
12
14
|
- **School names**: a printed school name in, a `SchoolName` out, with a display form, a
|
|
@@ -40,6 +42,7 @@ ESM, Node ≥ 22 or Bun ≥ 1.4.2. MIT. Not affiliated with or endorsed by any d
|
|
|
40
42
|
| `@finbheara/domain/place` | `place()`, `createPlaceReader`, `placeRelation`, the `Place` types |
|
|
41
43
|
| `@finbheara/domain/geocode` | `geocode()`: a location field read by the place store, then by every GeoNames town of AU, CA, GB, IE, NZ and US; `townCell` |
|
|
42
44
|
| `@finbheara/domain/clrg-regions` | `REGIONS`, `regionOf`, `resolvePhrase` |
|
|
45
|
+
| `@finbheara/domain/event` | `EVENT_REGISTER`, `EVENT_REGISTER_BY_CODE`, `EVENT_TIER`, `eventTier`, `isMajorEvent`, `eventCodeOfSlug`, the `EventRegisterRow` type: the CLRG championships of tier 1 to 3 (below) |
|
|
43
46
|
| `@finbheara/domain/school` | `createSchoolNameReader`, `DEFAULT_SCHOOL_NAME_READER`, `compareSchoolNames`, `foldSchoolName`, `schoolEncoder`, `schoolColumns` |
|
|
44
47
|
| `@finbheara/domain/tune` | `tune()`, `tuneRelation`, `tempoLegal`, `settingAt`, `TUNE_NODES`: the CLRG set dance list, each tune with its time, speeds and bars |
|
|
45
48
|
| `@finbheara/domain/ceili` | `ceili()`, `ceiliRelation`, `CEILI_NODES`: the céilí handbook dances |
|
|
@@ -181,6 +184,21 @@ A region is always the CLRG council that runs a place, and never its province or
|
|
|
181
184
|
the two differ. County Louth lies in the province of Leinster and is run by the Ulster council,
|
|
182
185
|
so it reads `ULSTER`, as Northern Ireland reads `ULSTER` and Wales `ENG_MIDLANDS`.
|
|
183
186
|
|
|
187
|
+
## Look up a CLRG event
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
import { EVENT_REGISTER_BY_CODE, eventCodeOfSlug, eventTier, isMajorEvent } from "@finbheara/domain/event";
|
|
191
|
+
|
|
192
|
+
EVENT_REGISTER_BY_CODE.get("sro")?.canonicalName; // "Southern Region Oireachtas"
|
|
193
|
+
eventTier("naidc"); // 2
|
|
194
|
+
isMajorEvent("bucharest"); // false: a local feis has no row
|
|
195
|
+
eventCodeOfSlug("naidc2024.514tsb"); // "naidc"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The register carries the Worlds (tier 1), the nationals (2) and the regional Oireachtais (3),
|
|
199
|
+
in that order. It is complete for those tiers and silent below: a code it does not carry is a
|
|
200
|
+
local event or no event code, and `eventTier` answers `null` for both rather than a guess.
|
|
201
|
+
|
|
184
202
|
## Read a school name
|
|
185
203
|
|
|
186
204
|
```ts
|
package/dist/event.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
var EVENT_REGISTER = [
|
|
2
|
+
{
|
|
3
|
+
code: "ornc",
|
|
4
|
+
canonicalName: "Oireachtas Rince na Cruinne — Worlds",
|
|
5
|
+
tier: 1,
|
|
6
|
+
jurisdiction: "Global (target)",
|
|
7
|
+
naEligible: null
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
code: "ornh",
|
|
11
|
+
canonicalName: "Oireachtas Rince na hÉireann — All-Irelands",
|
|
12
|
+
tier: 2,
|
|
13
|
+
jurisdiction: "Ireland",
|
|
14
|
+
naEligible: false
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
code: "crn",
|
|
18
|
+
canonicalName: "Craobhacha Rince Náisiúnta — Irish Nationals",
|
|
19
|
+
tier: 2,
|
|
20
|
+
jurisdiction: "Ireland",
|
|
21
|
+
naEligible: false
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
code: "naidc",
|
|
25
|
+
canonicalName: "North American Nationals",
|
|
26
|
+
tier: 2,
|
|
27
|
+
jurisdiction: "IDTANA",
|
|
28
|
+
naEligible: true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
code: "cnidc",
|
|
32
|
+
canonicalName: "Canadian National Irish Dance Championships",
|
|
33
|
+
tier: 2,
|
|
34
|
+
jurisdiction: "IDTANA (Can)",
|
|
35
|
+
naEligible: false
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
code: "gbc",
|
|
39
|
+
canonicalName: "Great Britain Championships",
|
|
40
|
+
tier: 2,
|
|
41
|
+
jurisdiction: "GB",
|
|
42
|
+
naEligible: false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
code: "asc",
|
|
46
|
+
canonicalName: "All-Scotland Championships",
|
|
47
|
+
tier: 2,
|
|
48
|
+
jurisdiction: "Scotland",
|
|
49
|
+
naEligible: false
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
code: "brnat",
|
|
53
|
+
canonicalName: "British National Championships",
|
|
54
|
+
tier: 2,
|
|
55
|
+
jurisdiction: "GB",
|
|
56
|
+
naEligible: false
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
code: "nero",
|
|
60
|
+
canonicalName: "New England Region Oireachtas",
|
|
61
|
+
tier: 3,
|
|
62
|
+
jurisdiction: "IDTANA (US)",
|
|
63
|
+
naEligible: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
code: "maro",
|
|
67
|
+
canonicalName: "Mid-Atlantic Region Oireachtas",
|
|
68
|
+
tier: 3,
|
|
69
|
+
jurisdiction: "IDTANA (US)",
|
|
70
|
+
naEligible: true
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
code: "sro",
|
|
74
|
+
canonicalName: "Southern Region Oireachtas",
|
|
75
|
+
tier: 3,
|
|
76
|
+
jurisdiction: "IDTANA (US)",
|
|
77
|
+
naEligible: true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
code: "mao",
|
|
81
|
+
canonicalName: "Mid-America Oireachtas",
|
|
82
|
+
tier: 3,
|
|
83
|
+
jurisdiction: "IDTANA (US)",
|
|
84
|
+
naEligible: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
code: "wusro",
|
|
88
|
+
canonicalName: "Western US Region Oireachtas",
|
|
89
|
+
tier: 3,
|
|
90
|
+
jurisdiction: "IDTANA (US)",
|
|
91
|
+
naEligible: true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
code: "ecro",
|
|
95
|
+
canonicalName: "Eastern Canadian Oireachtas",
|
|
96
|
+
tier: 3,
|
|
97
|
+
jurisdiction: "IDTANA (Can)",
|
|
98
|
+
naEligible: true
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
code: "wcro",
|
|
102
|
+
canonicalName: "Western Canadian Region Oireachtas",
|
|
103
|
+
tier: 3,
|
|
104
|
+
jurisdiction: "IDTANA (Can)",
|
|
105
|
+
naEligible: true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
code: "orl",
|
|
109
|
+
canonicalName: "Oir. Rince Laighean — Leinster",
|
|
110
|
+
tier: 3,
|
|
111
|
+
jurisdiction: "Ireland",
|
|
112
|
+
naEligible: false
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
code: "orm",
|
|
116
|
+
canonicalName: "Oir. Rince na Mumhan — Munster",
|
|
117
|
+
tier: 3,
|
|
118
|
+
jurisdiction: "Ireland",
|
|
119
|
+
naEligible: false
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
code: "oru",
|
|
123
|
+
canonicalName: "Oir. Rince Uladh — Ulster",
|
|
124
|
+
tier: 3,
|
|
125
|
+
jurisdiction: "Ireland",
|
|
126
|
+
naEligible: false
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
code: "orc",
|
|
130
|
+
canonicalName: "Oir. Rince Chonnacht — Connacht",
|
|
131
|
+
tier: 3,
|
|
132
|
+
jurisdiction: "Ireland",
|
|
133
|
+
naEligible: false
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
code: "sno",
|
|
137
|
+
canonicalName: "Scottish National Oireachtas",
|
|
138
|
+
tier: 3,
|
|
139
|
+
jurisdiction: "GB",
|
|
140
|
+
naEligible: false
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
code: "emid",
|
|
144
|
+
canonicalName: "England-Midlands (Lár na Breataine)",
|
|
145
|
+
tier: 3,
|
|
146
|
+
jurisdiction: "GB",
|
|
147
|
+
naEligible: false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
code: "enw",
|
|
151
|
+
canonicalName: "England-North-West Oireachtas (NWRC)",
|
|
152
|
+
tier: 3,
|
|
153
|
+
jurisdiction: "GB",
|
|
154
|
+
naEligible: false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
code: "ene",
|
|
158
|
+
canonicalName: "North East England Regional Oireachtas",
|
|
159
|
+
tier: 3,
|
|
160
|
+
jurisdiction: "GB",
|
|
161
|
+
naEligible: false
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
code: "seo",
|
|
165
|
+
canonicalName: "Southern England Oireachtas",
|
|
166
|
+
tier: 3,
|
|
167
|
+
jurisdiction: "GB",
|
|
168
|
+
naEligible: false
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
code: "rccea",
|
|
172
|
+
canonicalName: "Continental Europe & Asia Oireachtas",
|
|
173
|
+
tier: 3,
|
|
174
|
+
jurisdiction: "RCCEA",
|
|
175
|
+
naEligible: false
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
code: "tida",
|
|
179
|
+
canonicalName: "New Zealand National Championships",
|
|
180
|
+
tier: 2,
|
|
181
|
+
jurisdiction: "NZ",
|
|
182
|
+
naEligible: false
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
code: "aidc",
|
|
186
|
+
canonicalName: "Australian National Championships",
|
|
187
|
+
tier: 2,
|
|
188
|
+
jurisdiction: "Australia",
|
|
189
|
+
naEligible: false
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
code: "aio",
|
|
193
|
+
canonicalName: "Australian International Oireachtas",
|
|
194
|
+
tier: 2,
|
|
195
|
+
jurisdiction: "Australia",
|
|
196
|
+
naEligible: false
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
code: "rsa",
|
|
200
|
+
canonicalName: "South Africa Oireachtas",
|
|
201
|
+
tier: 3,
|
|
202
|
+
jurisdiction: "South Africa",
|
|
203
|
+
naEligible: false
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
code: "orsam",
|
|
207
|
+
canonicalName: "Oir. Rince An Meiriceá Theas — S. America",
|
|
208
|
+
tier: 3,
|
|
209
|
+
jurisdiction: "South America",
|
|
210
|
+
naEligible: false
|
|
211
|
+
}
|
|
212
|
+
];
|
|
213
|
+
var EVENT_REGISTER_BY_CODE = new Map(EVENT_REGISTER.map((r) => [r.code, r]));
|
|
214
|
+
var EVENT_TIER = new Map(EVENT_REGISTER.map((r) => [r.code, r.tier]));
|
|
215
|
+
function eventTier(code) {
|
|
216
|
+
return EVENT_TIER.get(code) ?? null;
|
|
217
|
+
}
|
|
218
|
+
function isMajorEvent(code) {
|
|
219
|
+
return EVENT_TIER.has(code);
|
|
220
|
+
}
|
|
221
|
+
function eventCodeOfSlug(slug) {
|
|
222
|
+
return /^([a-z]+)\d{4}(?:[.\-]|$)/.exec(slug)?.[1] ?? null;
|
|
223
|
+
}
|
|
224
|
+
export {
|
|
225
|
+
EVENT_REGISTER,
|
|
226
|
+
EVENT_REGISTER_BY_CODE,
|
|
227
|
+
EVENT_TIER,
|
|
228
|
+
eventCodeOfSlug,
|
|
229
|
+
eventTier,
|
|
230
|
+
isMajorEvent
|
|
231
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface EventRegisterRow {
|
|
2
|
+
code: string;
|
|
3
|
+
canonicalName: string;
|
|
4
|
+
tier: 1 | 2 | 3;
|
|
5
|
+
jurisdiction: string;
|
|
6
|
+
naEligible: boolean | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const EVENT_REGISTER: readonly EventRegisterRow[];
|
|
9
|
+
export declare const EVENT_REGISTER_BY_CODE: ReadonlyMap<string, EventRegisterRow>;
|
|
10
|
+
export declare const EVENT_TIER: ReadonlyMap<string, 1 | 2 | 3>;
|
|
11
|
+
export declare function eventTier(code: string): 1 | 2 | 3 | null;
|
|
12
|
+
export declare function isMajorEvent(code: string): boolean;
|
|
13
|
+
export declare function eventCodeOfSlug(slug: string): string | null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finbheara/domain",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Places, CLRG regions, school names, ages, dances, competition titles, codes and schedules, and a person's print in its role, as they are printed: read, compared and told apart",
|
|
3
|
+
"version": "0.54.0",
|
|
4
|
+
"description": "Places, CLRG regions and events, school names, ages, dances, competition titles, codes and schedules, and a person's print in its role, as they are printed: read, compared and told apart",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"places",
|
|
7
7
|
"regions",
|
|
@@ -77,6 +77,10 @@
|
|
|
77
77
|
"types": "./dist/types/code.d.ts",
|
|
78
78
|
"default": "./dist/code.js"
|
|
79
79
|
},
|
|
80
|
+
"./event": {
|
|
81
|
+
"types": "./dist/types/event.d.ts",
|
|
82
|
+
"default": "./dist/event.js"
|
|
83
|
+
},
|
|
80
84
|
"./package.json": "./package.json"
|
|
81
85
|
},
|
|
82
86
|
"files": ["dist/*.js", "dist/chunks/*.js", "dist/types/**/*.d.ts", "README.md", "LICENSE"],
|
|
@@ -93,7 +97,7 @@
|
|
|
93
97
|
"prepublishOnly": "bun scripts/build.ts && bun scripts/guard-tarball.ts"
|
|
94
98
|
},
|
|
95
99
|
"dependencies": {
|
|
96
|
-
"@finbheara/names": "0.
|
|
100
|
+
"@finbheara/names": "0.26.0"
|
|
97
101
|
},
|
|
98
102
|
"devDependencies": {
|
|
99
103
|
"typescript": "7.0.2"
|