@finbheara/domain 0.4.0 → 0.6.2
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 +102 -7
- package/dist/age.js +150 -31
- package/dist/ceili.js +1 -1
- package/dist/chunks/{place-qbp3xfb4.js → place-h7tvdfyp.js} +553 -30
- package/dist/chunks/{place-0ehc2q69.js → place-kk48pfja.js} +4 -0
- package/dist/chunks/place-q9kwsmzd.js +11 -0
- package/dist/chunks/{place-2ja9yx08.js → place-yndzaae5.js} +51 -43
- package/dist/dance.js +9 -2
- package/dist/place.js +1 -1
- package/dist/promotion.js +22 -2
- package/dist/school.js +16 -129
- package/dist/tune.js +1 -1
- package/dist/types/age-title.d.ts +12 -0
- package/dist/types/age-types.d.ts +5 -3
- package/dist/types/age.d.ts +13 -5
- package/dist/types/ceili.d.ts +3 -1
- package/dist/types/dance.d.ts +4 -1
- package/dist/types/place-types.d.ts +5 -2
- package/dist/types/place.d.ts +3 -3
- package/dist/types/promotion.d.ts +2 -0
- package/dist/types/school-location.d.ts +1 -0
- package/dist/types/school-name.d.ts +2 -2
- package/dist/types/school.d.ts +1 -0
- package/dist/types/tune.d.ts +8 -1
- package/dist/types/validated.d.ts +6 -2
- package/package.json +2 -2
|
@@ -8,13 +8,16 @@ export interface PlaceNode {
|
|
|
8
8
|
readonly prints: readonly string[];
|
|
9
9
|
readonly codes: readonly string[];
|
|
10
10
|
readonly truncations?: readonly string[];
|
|
11
|
+
readonly headings?: readonly string[];
|
|
12
|
+
readonly runPrints?: readonly string[];
|
|
13
|
+
readonly listedCutsOnly?: true;
|
|
11
14
|
readonly iso2?: string;
|
|
12
15
|
readonly iso3?: string;
|
|
13
16
|
readonly isoNumeric?: string;
|
|
14
17
|
readonly oireachtas?: string;
|
|
15
18
|
}
|
|
16
|
-
export type PlaceMatch = "id" | "code" | "print" | "phrase" | "iso" | "county" | "truncation";
|
|
17
|
-
export type PlaceRefusal = "school" | "organization" | "placeholder" | "damaged";
|
|
19
|
+
export type PlaceMatch = "id" | "code" | "print" | "phrase" | "iso" | "county" | "truncation" | "desmushed";
|
|
20
|
+
export type PlaceRefusal = "school" | "organization" | "placeholder" | "damaged" | "web" | "online" | "notice";
|
|
18
21
|
export type PlaceRelation = "same" | "contains" | "overlaps" | "conflict" | "silent";
|
|
19
22
|
export interface PlaceContext {
|
|
20
23
|
readonly region?: string;
|
package/dist/types/place.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PlaceContext, PlaceKind, PlaceMatch, PlaceNode, PlaceRefusal, PlaceRelation } from "./place-types.ts";
|
|
2
|
-
|
|
2
|
+
import { type EmptyReason, type Validated } from "./validated.ts";
|
|
3
|
+
export type { EmptyReason, PlaceContext, PlaceKind, PlaceMatch, PlaceNode, PlaceRefusal, PlaceRelation, Validated, };
|
|
3
4
|
export type PlaceArm = "resolved" | "plural" | "ambiguous" | "unread";
|
|
4
|
-
export interface AbstractPlace {
|
|
5
|
+
export interface AbstractPlace extends Validated<PlaceRefusal> {
|
|
5
6
|
readonly [Symbol.toStringTag]: "Place";
|
|
6
7
|
toString(): string;
|
|
7
8
|
readonly arm: PlaceArm;
|
|
@@ -18,7 +19,6 @@ export interface AbstractPlace {
|
|
|
18
19
|
readonly refusal: PlaceRefusal | null;
|
|
19
20
|
readonly misses: readonly string[];
|
|
20
21
|
readonly length: number;
|
|
21
|
-
isEmpty(): boolean;
|
|
22
22
|
isPlace(): boolean;
|
|
23
23
|
isSingular(): this is ResolvedPlace;
|
|
24
24
|
isPlural(): this is PluralPlaces;
|
|
@@ -12,5 +12,7 @@ export declare const collapse: (s: string) => string;
|
|
|
12
12
|
export declare function samePromotedSchool(was: string, now: string): boolean;
|
|
13
13
|
export declare function samePromotedRow(was: PromotedPrint, now: PromotedPrint): boolean;
|
|
14
14
|
export declare function questionMarksRead(was: string, now: string): string | null;
|
|
15
|
+
export declare function mojibakeRead(print: string): string;
|
|
15
16
|
export declare function samePromotedName(was: string, now: string): boolean;
|
|
16
17
|
export declare function samePromotedHeir(was: PromotedPrint, now: PromotedPrint): boolean;
|
|
18
|
+
export declare function samePromotedPair(was: PromotedPrint, now: PromotedPrint): boolean;
|
|
@@ -12,5 +12,6 @@ export interface PrintZones {
|
|
|
12
12
|
readonly only: boolean;
|
|
13
13
|
} | null;
|
|
14
14
|
}
|
|
15
|
+
export declare function printsWeb(raw: string): boolean;
|
|
15
16
|
export declare function printZones(raw: string): PrintZones;
|
|
16
17
|
export declare function opensLocation(folded: string, at: PrintZones, index?: number): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Place } from "./place.ts";
|
|
2
2
|
import { type NotASchool, type RefusalReason, type SchoolNameException } from "./school-exception-vocabulary.ts";
|
|
3
3
|
import { type InstitutionType } from "./school-institution-vocabulary.ts";
|
|
4
|
+
import { type Validated } from "./validated.ts";
|
|
4
5
|
export interface LexiconFlags {
|
|
5
6
|
surname: boolean;
|
|
6
7
|
given: boolean;
|
|
@@ -26,7 +27,7 @@ export declare const SCHOOL_REFUSED = "!!!NOTASCHOOL";
|
|
|
26
27
|
export type SchoolConcern = "institution-inside-name" | "promoted-name" | "no-name-part" | "truncated-tail" | "lexicon-absent" | "ambiguous-part" | "place-from-lexicon";
|
|
27
28
|
export type Refusal = SchoolRefusal;
|
|
28
29
|
export type Concern = SchoolConcern;
|
|
29
|
-
export interface SchoolName {
|
|
30
|
+
export interface SchoolName extends Validated<RefusalReason> {
|
|
30
31
|
readonly [Symbol.toStringTag]: "SchoolName";
|
|
31
32
|
toString(): string;
|
|
32
33
|
readonly sn0: string;
|
|
@@ -38,7 +39,6 @@ export interface SchoolName {
|
|
|
38
39
|
readonly institution: InstitutionType | null;
|
|
39
40
|
readonly location: Place | null;
|
|
40
41
|
readonly refusal: SchoolRefusal | null;
|
|
41
|
-
isEmpty(): boolean;
|
|
42
42
|
isSchool(): boolean;
|
|
43
43
|
surnames(): readonly string[];
|
|
44
44
|
readonly concerns: readonly SchoolConcern[];
|
package/dist/types/school.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { compareSchoolNames, compareSchools } from "./school-identity.ts";
|
|
|
8
8
|
export type { IdentityResult, IdentityVerdict } from "./school-identity.ts";
|
|
9
9
|
export { foldSchoolName, hasSpecificToken, schoolKeyTokens } from "./school-match-key.ts";
|
|
10
10
|
export { NOT_A_SCHOOL, SCHOOL_NAME_EXCEPTIONS, } from "./school-exception-vocabulary.ts";
|
|
11
|
+
export type { EmptyReason, Validated } from "./validated.ts";
|
|
11
12
|
export type { NotASchool, RefusalReason, SchoolNameException, } from "./school-exception-vocabulary.ts";
|
package/dist/types/tune.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type DanceMatch, type DanceRelation } from "./dance-match.ts";
|
|
2
2
|
import { type SetRhythm, type TimeSignature } from "./dance-types.ts";
|
|
3
|
+
import { type Validated } from "./validated.ts";
|
|
4
|
+
export type { EmptyReason, Validated } from "./validated.ts";
|
|
3
5
|
export type TuneSetting = "traditional" | "contemporary";
|
|
4
6
|
export interface SpeedRange {
|
|
5
7
|
readonly min: number;
|
|
@@ -16,7 +18,10 @@ export interface TuneNode {
|
|
|
16
18
|
readonly time: TimeSignature;
|
|
17
19
|
readonly traditionalSpeed: number | null;
|
|
18
20
|
readonly maxSpeed: number | null;
|
|
21
|
+
readonly stepBars: number;
|
|
22
|
+
readonly setBars: number;
|
|
19
23
|
}
|
|
24
|
+
export type TuneBars = readonly [step: number, set: number];
|
|
20
25
|
export declare const TUNE_NODES: readonly TuneNode[];
|
|
21
26
|
export interface Tune {
|
|
22
27
|
readonly [Symbol.toStringTag]: "Tune";
|
|
@@ -30,6 +35,8 @@ export interface Tune {
|
|
|
30
35
|
time(): TimeSignature;
|
|
31
36
|
rhythm(): SetRhythm;
|
|
32
37
|
speed(setting?: TuneSetting): number | SpeedRange | null;
|
|
38
|
+
stepBars(): number;
|
|
39
|
+
setBars(): number;
|
|
33
40
|
}
|
|
34
41
|
export declare function allTunes(): readonly Tune[];
|
|
35
42
|
export declare function tuneById(id: string): Tune | undefined;
|
|
@@ -42,7 +49,7 @@ export interface TuneContext {
|
|
|
42
49
|
readonly time?: TimeSignature;
|
|
43
50
|
}
|
|
44
51
|
export type TuneRefusal = "empty" | "dance-type" | "unmatched";
|
|
45
|
-
export interface TuneReading {
|
|
52
|
+
export interface TuneReading extends Validated<Exclude<TuneRefusal, "empty">> {
|
|
46
53
|
readonly [Symbol.toStringTag]: "TuneReading";
|
|
47
54
|
readonly print: string;
|
|
48
55
|
readonly folded: string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EmptyReason = "empty";
|
|
2
|
+
export interface Validated<Refusal extends string> {
|
|
3
|
+
isEmpty(): boolean;
|
|
4
|
+
isRefused(): boolean;
|
|
2
5
|
isValid(): boolean;
|
|
3
|
-
invalidReason():
|
|
6
|
+
invalidReason(): EmptyReason | Refusal | null;
|
|
4
7
|
}
|
|
8
|
+
export declare function validity<Refusal extends string>(empty: boolean, refusal: Refusal | null): Validated<Refusal>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finbheara/domain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Places, CLRG regions, school names, ages and dances as they are printed: read, compared and told apart",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"places",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"prepublishOnly": "bun scripts/build.ts && bun scripts/guard-tarball.ts"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@finbheara/names": "0.
|
|
76
|
+
"@finbheara/names": "0.18.0"
|
|
77
77
|
}
|
|
78
78
|
}
|