@agentshouse/mdmodel 0.1.0-c679f403bf3fb → 0.1.0-c69a8c1d0563b
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/API.md +115 -101
- package/README.md +7 -5
- package/dist/blocks.d.ts.map +1 -1
- package/dist/blocks.js +29 -7
- package/dist/definition.d.ts +2 -1
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +80 -26
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +15 -13
- package/dist/event.d.ts +78 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +230 -0
- package/dist/facts.d.ts +15 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/facts.js +38 -0
- package/dist/index.d.ts +19 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/kinds.d.ts +19 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +161 -0
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +42 -11
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -1
- package/dist/pattern.d.ts +10 -0
- package/dist/pattern.d.ts.map +1 -0
- package/dist/pattern.js +355 -0
- package/dist/query/language.d.ts +223 -0
- package/dist/query/language.d.ts.map +1 -0
- package/dist/query/language.js +565 -0
- package/dist/query/match.d.ts +14 -0
- package/dist/query/match.d.ts.map +1 -0
- package/dist/query/match.js +121 -0
- package/dist/query/rows.d.ts +32 -0
- package/dist/query/rows.d.ts.map +1 -0
- package/dist/query/rows.js +161 -0
- package/dist/query/sql.d.ts +39 -0
- package/dist/query/sql.d.ts.map +1 -0
- package/dist/query/sql.js +279 -0
- package/dist/reserved.d.ts +5 -0
- package/dist/reserved.d.ts.map +1 -0
- package/dist/reserved.js +20 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +55 -4
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +7 -5
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +230 -87
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +36 -3
- package/fixtures/README.md +21 -2
- package/fixtures/cases/conditional-section/context.json +1 -0
- package/fixtures/cases/conditional-section/expected.json +6 -0
- package/fixtures/cases/conditional-section/library/questions/hosting.md +9 -0
- package/fixtures/cases/conditional-section/library/questions/payments.md +12 -0
- package/fixtures/cases/conditional-section/schema.yaml +14 -0
- package/fixtures/cases/link-into-a-reserved-name/context.json +1 -0
- package/fixtures/cases/link-into-a-reserved-name/expected.json +5 -0
- package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +6 -0
- package/fixtures/cases/link-into-a-reserved-name/schema.yaml +3 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/context.json +1 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/expected.json +5 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/library/notes/b.md +5 -0
- package/fixtures/cases/member-on-an-untyped-document/context.json +1 -0
- package/fixtures/cases/member-on-an-untyped-document/expected.json +6 -0
- package/fixtures/cases/member-on-an-untyped-document/library/note.md +4 -0
- package/fixtures/cases/member-on-another-type/context.json +1 -0
- package/fixtures/cases/member-on-another-type/expected.json +6 -0
- package/fixtures/cases/member-on-another-type/library/note.md +4 -0
- package/fixtures/cases/member-on-another-type/schema.yaml +7 -0
- package/fixtures/cases/reference-into-a-reserved-name/context.json +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/expected.json +6 -0
- package/fixtures/cases/reference-into-a-reserved-name/library/notes/a.md +4 -0
- package/fixtures/cases/reference-into-a-reserved-name/library/settings/brief.md +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/schema.yaml +3 -0
- package/fixtures/cases/room-md-declares-a-type/context.json +1 -0
- package/fixtures/cases/room-md-declares-a-type/expected.json +6 -0
- package/fixtures/cases/room-md-declares-a-type/library/ROOM.md +5 -0
- package/fixtures/cases/typed-path-names-another-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-another-type/expected.json +6 -0
- package/fixtures/cases/typed-path-names-another-type/library/settings/prefs/one.md +3 -0
- package/fixtures/cases/typed-path-names-another-type/schema.yaml +6 -0
- package/fixtures/cases/typed-path-names-its-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-its-type/expected.json +3 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/deeper/two.md +1 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +4 -0
- package/fixtures/cases/typed-path-names-its-type/schema.yaml +6 -0
- package/fixtures/cases/typed-path-names-no-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-no-type/expected.json +6 -0
- package/fixtures/cases/typed-path-names-no-type/library/settings/prefs/one.md +1 -0
- package/fixtures/cases/typed-path-names-no-type/schema.yaml +6 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/expected.json +6 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +4 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/expected.json +6 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +6 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/expected.json +3 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/plan.md +1 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +5 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/expected.json +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/schema.yaml +5 -0
- package/fixtures/queries.json +913 -0
- package/package.json +7 -2
- package/dist/condition.d.ts +0 -162
- package/dist/condition.d.ts.map +0 -1
- package/dist/condition.js +0 -616
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { Actor,
|
|
1
|
+
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
|
+
export type { Actor, DocumentEvent, DocumentFacts, Fact, FactKind, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
|
|
3
|
+
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, KINDS, kindOf, kindWords, } from './kinds.js';
|
|
4
|
+
export type { Kind, Ordering } from './kinds.js';
|
|
5
|
+
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
6
|
+
export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupQuery, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
|
|
7
|
+
export { heldAt, matches } from './query/match.js';
|
|
8
|
+
export type { Candidate } from './query/match.js';
|
|
9
|
+
export { heldKind, indexed } from './query/rows.js';
|
|
10
|
+
export type { HeldKind, HeldLink, HeldValue, Indexed, Reach } from './query/rows.js';
|
|
11
|
+
export * as sql from './query/sql.js';
|
|
3
12
|
export { headingLines } from './blocks.js';
|
|
4
13
|
export type { HeadingLine } from './blocks.js';
|
|
5
14
|
export { divide } from './divide.js';
|
|
6
15
|
export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, } from './document.js';
|
|
16
|
+
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
17
|
+
export type { ReferenceTarget, SavedFacts } from './facts.js';
|
|
7
18
|
export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
|
|
8
19
|
export { relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
20
|
+
export { openPatternBudget } from './pattern.js';
|
|
9
21
|
export type { RoomTarget } from './paths.js';
|
|
10
22
|
export { MARKDOWN_SYNTAX_PROFILE } from './profile.js';
|
|
11
23
|
export { project } from './project.js';
|
|
12
24
|
export { references } from './references.js';
|
|
13
|
-
export {
|
|
25
|
+
export { isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION } from './reserved.js';
|
|
26
|
+
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
14
27
|
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, SectionSpec, Shape, Transition, ValueFacts, } from './definition.js';
|
|
15
|
-
export type { ApplyResult, BodyResult, Change, Division, DivisionContext, Document, DocumentCheck, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
16
|
-
export { assess, bodyRoomLinks, checkDocument, resolves, roomReferences,
|
|
28
|
+
export type { ApplyResult, BodyResult, Change, Division, DivisionContext, Document, DocumentCheck, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
29
|
+
export { assess, assessReferences, bodyRoomLinks, checkDocument, readTypes, resolves, roomReferences, validate, validating, verdicts, verify, } from './validate.js';
|
|
17
30
|
export type { Assessment, Verdicts } from './validate.js';
|
|
18
31
|
export { VERSION } from './version.js';
|
|
19
|
-
export { bodyAfterFrontmatter, equalValue, frontmatterValue } from './yaml.js';
|
|
32
|
+
export { bodyAfterFrontmatter, equalValue, frontmatterValue, plain } from './yaml.js';
|
|
20
33
|
export type { FrontmatterValue } from './yaml.js';
|
|
21
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,MAAM,EACN,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,MAAM,EACN,UAAU,EACV,UAA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AY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
|
+
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, KINDS, kindOf, kindWords, } from './kinds.js';
|
|
3
|
+
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
4
|
+
export { heldAt, matches } from './query/match.js';
|
|
5
|
+
export { heldKind, indexed } from './query/rows.js';
|
|
6
|
+
export * as sql from './query/sql.js';
|
|
2
7
|
export { headingLines } from './blocks.js';
|
|
3
8
|
export { divide } from './divide.js';
|
|
4
9
|
export { apply, bodyLinks, links, parse, parseFrontmatter, relativize, relativizeBody, relinkBody, serialize, } from './document.js';
|
|
10
|
+
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
5
11
|
export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
|
|
6
12
|
export { relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
13
|
+
export { openPatternBudget } from './pattern.js';
|
|
7
14
|
export { MARKDOWN_SYNTAX_PROFILE } from './profile.js';
|
|
8
15
|
export { project } from './project.js';
|
|
9
16
|
export { references } from './references.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
17
|
+
export { isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION } from './reserved.js';
|
|
18
|
+
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
19
|
+
export { assess, assessReferences, bodyRoomLinks, checkDocument, readTypes, resolves, roomReferences, validate, validating, verdicts, verify, } from './validate.js';
|
|
12
20
|
export { VERSION } from './version.js';
|
|
13
|
-
export { bodyAfterFrontmatter, equalValue, frontmatterValue } from './yaml.js';
|
|
21
|
+
export { bodyAfterFrontmatter, equalValue, frontmatterValue, plain } from './yaml.js';
|
package/dist/kinds.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ValueFacts } from './definition.js';
|
|
2
|
+
export declare const KINDS: readonly ['string', 'number', 'integer', 'boolean', 'date', 'date-time', 'time', 'enum', 'reference'];
|
|
3
|
+
export type Kind = (typeof KINDS)[number];
|
|
4
|
+
export type Ordering = {
|
|
5
|
+
readonly direction: 'asc' | 'desc';
|
|
6
|
+
readonly nulls: 'first' | 'last';
|
|
7
|
+
readonly stringSort: 'lexical' | 'locale';
|
|
8
|
+
readonly locale: string | undefined;
|
|
9
|
+
readonly localeOptions: Intl.CollatorOptions | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function kindOf(facts: ValueFacts): Kind | null;
|
|
12
|
+
export declare function fitsKind(kind: Kind, facts: ValueFacts, value: unknown): boolean;
|
|
13
|
+
export declare function kindWords(facts: ValueFacts | undefined): readonly string[];
|
|
14
|
+
export declare function dated(value: unknown): value is string;
|
|
15
|
+
export declare function instant(value: unknown): bigint | undefined;
|
|
16
|
+
export declare function instantKey(value: unknown): string | null;
|
|
17
|
+
export declare function byCodePoint(left: string, right: string): number;
|
|
18
|
+
export declare function compared(left: unknown, right: unknown, ordering: Ordering): number;
|
|
19
|
+
//# sourceMappingURL=kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,eAAO,MAAM,KAAK,YAChB,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,MAAM,EACN,WAAW,CACH,CAAC;AAEX,MAAM,M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S = [
|
|
4
|
+
'string',
|
|
5
|
+
'number',
|
|
6
|
+
'integer',
|
|
7
|
+
'boolean',
|
|
8
|
+
'date',
|
|
9
|
+
'date-time',
|
|
10
|
+
'time',
|
|
11
|
+
'enum',
|
|
12
|
+
'reference',
|
|
13
|
+
];
|
|
14
|
+
const DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[Tt\s](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:[Zz]|([+-])(\d{2})(?::?(\d{2}))?)$/u;
|
|
15
|
+
const BEFORE_YEAR_ZERO = 62200000000000000000n;
|
|
16
|
+
const INSTANT_DIGITS = 21;
|
|
17
|
+
export function kindOf(facts) {
|
|
18
|
+
if (facts.reference !== undefined)
|
|
19
|
+
return 'reference';
|
|
20
|
+
if (facts.values !== undefined)
|
|
21
|
+
return 'enum';
|
|
22
|
+
if (facts.type === 'number')
|
|
23
|
+
return 'number';
|
|
24
|
+
if (facts.type === 'integer')
|
|
25
|
+
return 'integer';
|
|
26
|
+
if (facts.type === 'boolean')
|
|
27
|
+
return 'boolean';
|
|
28
|
+
if (facts.type !== 'string')
|
|
29
|
+
return null;
|
|
30
|
+
if (facts.format === 'date')
|
|
31
|
+
return 'date';
|
|
32
|
+
if (facts.format === 'date-time')
|
|
33
|
+
return 'date-time';
|
|
34
|
+
if (facts.format === 'time')
|
|
35
|
+
return 'time';
|
|
36
|
+
return 'string';
|
|
37
|
+
}
|
|
38
|
+
export function fitsKind(kind, facts, value) {
|
|
39
|
+
if (kind === 'enum')
|
|
40
|
+
return (facts.values ?? []).includes(value);
|
|
41
|
+
if (kind === 'number')
|
|
42
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
43
|
+
if (kind === 'integer')
|
|
44
|
+
return Number.isSafeInteger(value);
|
|
45
|
+
if (kind === 'boolean')
|
|
46
|
+
return typeof value === 'boolean';
|
|
47
|
+
if (typeof value !== 'string')
|
|
48
|
+
return false;
|
|
49
|
+
if (kind === 'reference')
|
|
50
|
+
return value !== '' && normalize(value) === value;
|
|
51
|
+
if (kind === 'date')
|
|
52
|
+
return dated(value);
|
|
53
|
+
if (kind === 'date-time')
|
|
54
|
+
return instant(value) !== undefined;
|
|
55
|
+
if (kind === 'time')
|
|
56
|
+
return format.time(value);
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
export function kindWords(facts) {
|
|
60
|
+
const kind = facts === undefined ? null : kindOf(facts);
|
|
61
|
+
if (kind === 'enum')
|
|
62
|
+
return (facts.values ?? []).map((value) => typeof value === 'string' ? value : JSON.stringify(value));
|
|
63
|
+
if (kind === 'number')
|
|
64
|
+
return ['a number'];
|
|
65
|
+
if (kind === 'integer')
|
|
66
|
+
return ['an integer'];
|
|
67
|
+
if (kind === 'boolean')
|
|
68
|
+
return ['true', 'false'];
|
|
69
|
+
if (kind === 'date')
|
|
70
|
+
return ['a date as YYYY-MM-DD'];
|
|
71
|
+
if (kind === 'date-time')
|
|
72
|
+
return ['a date-time with its offset, such as 2026-10-10T09:30:00Z'];
|
|
73
|
+
if (kind === 'time')
|
|
74
|
+
return ['a time as HH:MM:SS'];
|
|
75
|
+
if (kind === 'reference')
|
|
76
|
+
return [`the Room Path of a ${facts.reference.join(' or ')} document, such as notes/a.md`];
|
|
77
|
+
return kind === 'string' ? ['a string'] : [];
|
|
78
|
+
}
|
|
79
|
+
export function dated(value) {
|
|
80
|
+
return typeof value === 'string' && format.date(value);
|
|
81
|
+
}
|
|
82
|
+
export function instant(value) {
|
|
83
|
+
if (typeof value !== 'string' || !format['date-time'](value))
|
|
84
|
+
return undefined;
|
|
85
|
+
const parts = DATE_TIME.exec(value);
|
|
86
|
+
const [year, month, day, hour, minute, second, offsetHours, offsetMinutes] = [
|
|
87
|
+
1, 2, 3, 4, 5, 6, 9, 10,
|
|
88
|
+
].map((at) => Number(parts[at] ?? 0));
|
|
89
|
+
const at = new Date(0);
|
|
90
|
+
at.setUTCFullYear(year, month - 1, day);
|
|
91
|
+
at.setUTCHours(hour, minute, second);
|
|
92
|
+
const offset = (parts[8] === '-' ? -1 : 1) * (offsetHours * 60 + offsetMinutes);
|
|
93
|
+
const fraction = (parts[7] ?? '').padEnd(9, '0').slice(0, 9);
|
|
94
|
+
return (BigInt(at.getTime()) - BigInt(offset) * 60000n) * 1000000n + BigInt(fraction);
|
|
95
|
+
}
|
|
96
|
+
export function instantKey(value) {
|
|
97
|
+
const at = instant(value);
|
|
98
|
+
return at === undefined ? null : (at + BEFORE_YEAR_ZERO).toString().padStart(INSTANT_DIGITS, '0');
|
|
99
|
+
}
|
|
100
|
+
function rank(value) {
|
|
101
|
+
if (typeof value === 'boolean' || typeof value === 'number')
|
|
102
|
+
return 1;
|
|
103
|
+
if (typeof value === 'string')
|
|
104
|
+
return 2;
|
|
105
|
+
return Array.isArray(value) ? 3 : 4;
|
|
106
|
+
}
|
|
107
|
+
function unit(code) {
|
|
108
|
+
if (code >= 0xd800 && code < 0xe000)
|
|
109
|
+
return code + 0x2000;
|
|
110
|
+
return code >= 0xe000 ? code - 0x800 : code;
|
|
111
|
+
}
|
|
112
|
+
export function byCodePoint(left, right) {
|
|
113
|
+
for (let at = 0; at < Math.min(left.length, right.length); at += 1) {
|
|
114
|
+
const ours = left.charCodeAt(at);
|
|
115
|
+
const theirs = right.charCodeAt(at);
|
|
116
|
+
if (ours !== theirs)
|
|
117
|
+
return unit(ours) - unit(theirs);
|
|
118
|
+
}
|
|
119
|
+
return left.length - right.length;
|
|
120
|
+
}
|
|
121
|
+
function ascending(left, right, ordering) {
|
|
122
|
+
if (left == null && right == null)
|
|
123
|
+
return 0;
|
|
124
|
+
if (left == null)
|
|
125
|
+
return ordering.nulls === 'first' ? -1 : 1;
|
|
126
|
+
if (right == null)
|
|
127
|
+
return ordering.nulls === 'first' ? 1 : -1;
|
|
128
|
+
const ranked = rank(left) - rank(right);
|
|
129
|
+
if (ranked !== 0)
|
|
130
|
+
return ranked;
|
|
131
|
+
if (typeof left === 'string' && typeof right === 'string') {
|
|
132
|
+
return ordering.stringSort === 'locale'
|
|
133
|
+
? left.localeCompare(right, ordering.locale, ordering.localeOptions)
|
|
134
|
+
: byCodePoint(left, right);
|
|
135
|
+
}
|
|
136
|
+
if (Array.isArray(left) && Array.isArray(right)) {
|
|
137
|
+
for (let at = 0; at < Math.min(left.length, right.length); at += 1) {
|
|
138
|
+
const result = ascending(left[at], right[at], ordering);
|
|
139
|
+
if (result !== 0)
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
return left.length - right.length;
|
|
143
|
+
}
|
|
144
|
+
if (typeof left === 'object')
|
|
145
|
+
return 0;
|
|
146
|
+
const held = left;
|
|
147
|
+
const other = right;
|
|
148
|
+
if (held < other)
|
|
149
|
+
return -1;
|
|
150
|
+
if (held > other)
|
|
151
|
+
return 1;
|
|
152
|
+
return 0;
|
|
153
|
+
}
|
|
154
|
+
export function compared(left, right, ordering) {
|
|
155
|
+
if (ordering.direction === 'asc')
|
|
156
|
+
return ascending(left, right, ordering);
|
|
157
|
+
return ascending(right, left, {
|
|
158
|
+
...ordering,
|
|
159
|
+
nulls: ordering.nulls === 'first' ? 'last' : 'first',
|
|
160
|
+
});
|
|
161
|
+
}
|
package/dist/links.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAgiBA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAE5D;AAyLD,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,GAC5C,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAOvC;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA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})[.)]/;
|
|
18
18
|
const LABEL_LENGTH = 999;
|
|
19
19
|
const PUNCTUATION = /^[!-/:-@[-`{-~]$/;
|
|
20
|
-
const
|
|
20
|
+
const INLINE_TAG = new RegExp([
|
|
21
21
|
'<[A-Za-z][A-Za-z0-9-]*(?:[ \\t\\n\\v\\f\\r]+[A-Za-z_:][A-Za-z0-9_.:-]*(?:[ \\t\\n\\v\\f\\r]*=[ \\t\\n\\v\\f\\r]*(?:[^ \\t\\n\\v\\f\\r"\'=<>`]+|\'[^\']*\'|"[^"]*"))?)*[ \\t\\n\\v\\f\\r]*\\/?>',
|
|
22
22
|
'<\\/[A-Za-z][A-Za-z0-9-]*[ \\t\\n\\v\\f\\r]*>',
|
|
23
23
|
'<!--(?!-?>)(?:-?[^-])*-->',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'<!\\[CDATA\\[[\\s\\S]*?\\]\\]>',
|
|
24
|
+
].join('|'), 'y');
|
|
25
|
+
const AUTOLINK = new RegExp([
|
|
27
26
|
'<[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\\x00-\\x20<>]*>',
|
|
28
27
|
"<[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>",
|
|
29
28
|
].join('|'), 'y');
|
|
29
|
+
const DECLARATION = /<![A-Z]+[ \t\n\v\f\r]/y;
|
|
30
|
+
const INSTRUCTION = '<?';
|
|
31
|
+
const CDATA = '<![CDATA[';
|
|
30
32
|
const BACKSLASH = 0x5c;
|
|
31
33
|
const BACKTICK = 0x60;
|
|
32
34
|
const LINE_FEED = 0x0a;
|
|
@@ -36,7 +38,7 @@ const OPEN_BRACKET = 0x5b;
|
|
|
36
38
|
const CLOSE_BRACKET = 0x5d;
|
|
37
39
|
const EXCLAMATION = 0x21;
|
|
38
40
|
const OPEN_PAREN = 0x28;
|
|
39
|
-
const DELIMITER_ROW = /^\|?[ \t]*:?-+:?[ \t]
|
|
41
|
+
const DELIMITER_ROW = /^\|?[ \t]*:?-+:?(?:[ \t]*\|[ \t]*:?-+:?)*(?:[ \t]*\|)?[ \t]*$/;
|
|
40
42
|
const GAP = /^[ \t\v\f]+/;
|
|
41
43
|
function endOfLine(text, from) {
|
|
42
44
|
const nl = text.indexOf('\n', from);
|
|
@@ -720,6 +722,36 @@ function paragraphEnd(text, from, joins) {
|
|
|
720
722
|
}
|
|
721
723
|
return i;
|
|
722
724
|
}
|
|
725
|
+
function closerAt(text, closer, from, closers) {
|
|
726
|
+
const held = closers.get(closer);
|
|
727
|
+
if (held !== undefined && from >= held[0] && (held[1] === -1 || from <= held[1]))
|
|
728
|
+
return held[1];
|
|
729
|
+
const at = text.indexOf(closer, from);
|
|
730
|
+
closers.set(closer, [from, at]);
|
|
731
|
+
return at;
|
|
732
|
+
}
|
|
733
|
+
function closedAfter(text, closer, from, closers) {
|
|
734
|
+
const at = closerAt(text, closer, from, closers);
|
|
735
|
+
return at === -1 ? -1 : at + closer.length;
|
|
736
|
+
}
|
|
737
|
+
function stuck(pattern, text, at) {
|
|
738
|
+
pattern.lastIndex = at;
|
|
739
|
+
return pattern.test(text) ? pattern.lastIndex : -1;
|
|
740
|
+
}
|
|
741
|
+
function markupEnd(text, at, closers) {
|
|
742
|
+
if (text.startsWith(INSTRUCTION, at))
|
|
743
|
+
return closedAfter(text, '?>', at + INSTRUCTION.length, closers);
|
|
744
|
+
if (text.startsWith(CDATA, at))
|
|
745
|
+
return closedAfter(text, ']]>', at + CDATA.length, closers);
|
|
746
|
+
const declared = stuck(DECLARATION, text, at);
|
|
747
|
+
if (declared !== -1)
|
|
748
|
+
return closedAfter(text, '>', declared, closers);
|
|
749
|
+
return stuck(INLINE_TAG, text, at);
|
|
750
|
+
}
|
|
751
|
+
function inlineRawEnd(text, at, closers) {
|
|
752
|
+
const end = markupEnd(text, at, closers);
|
|
753
|
+
return end === -1 ? stuck(AUTOLINK, text, at) : end;
|
|
754
|
+
}
|
|
723
755
|
export function linkInventory(body) {
|
|
724
756
|
const { raw, definitions, blocks, joins } = scanBlocks(body);
|
|
725
757
|
const rawEnd = spanCursor(raw);
|
|
@@ -727,7 +759,7 @@ export function linkInventory(body) {
|
|
|
727
759
|
const uses = [];
|
|
728
760
|
const openers = [];
|
|
729
761
|
const unclosed = { stop: 0, runs: new Map() };
|
|
730
|
-
let paragraph = { start: 0, end: -1, text: '' };
|
|
762
|
+
let paragraph = { start: 0, end: -1, text: '', closers: new Map() };
|
|
731
763
|
let i = 0;
|
|
732
764
|
while (i < body.length) {
|
|
733
765
|
const skipEnd = rawEnd(i) ?? blockEnd(i);
|
|
@@ -748,12 +780,11 @@ export function linkInventory(body) {
|
|
|
748
780
|
if (code === LESS_THAN) {
|
|
749
781
|
if (i >= paragraph.end) {
|
|
750
782
|
const end = paragraphEnd(body, i, joins);
|
|
751
|
-
paragraph = { start: i, end, text: body.slice(i, end) };
|
|
783
|
+
paragraph = { start: i, end, text: body.slice(i, end), closers: new Map() };
|
|
752
784
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
i += raw[0].length;
|
|
785
|
+
const raw = inlineRawEnd(paragraph.text, i - paragraph.start, paragraph.closers);
|
|
786
|
+
if (raw !== -1) {
|
|
787
|
+
i = paragraph.start + raw;
|
|
757
788
|
continue;
|
|
758
789
|
}
|
|
759
790
|
}
|
package/dist/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM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AAM,GAAG,MAAM,CAW7D;AAED,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMvE"}
|
package/dist/paths.js
CHANGED
|
@@ -61,7 +61,10 @@ function located(href) {
|
|
|
61
61
|
const written = href.trim();
|
|
62
62
|
const { base, suffix } = unescaped(written);
|
|
63
63
|
const url = base.replace(/[\t\n\r]/g, '').replace(/^[\u0000-\u0020]+/, '');
|
|
64
|
-
return {
|
|
64
|
+
return {
|
|
65
|
+
base: suffix === written.length ? url.replace(/(?<![\u0000-\u0020])[\u0000-\u0020]+$/, '') : url,
|
|
66
|
+
suffix,
|
|
67
|
+
};
|
|
65
68
|
}
|
|
66
69
|
const ENCODED = /(?:%[0-9a-fA-F]{2})+/g;
|
|
67
70
|
function decodedRun(run) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const PATTERN_STATES = 1000;
|
|
2
|
+
export declare class PatternTooCostly extends Error {
|
|
3
|
+
}
|
|
4
|
+
export type Pattern = {
|
|
5
|
+
readonly test: (text: string) => boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function linearPattern(source: string): Pattern | null;
|
|
8
|
+
export declare function withLinearRegExp<T>(run: () => T): T;
|
|
9
|
+
export declare function openPatternBudget(): () => void;
|
|
10
|
+
//# sourceMappingURL=pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../src/pattern.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,OAAQ,CAAC;AAMpC,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AAQ9C,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;CAAE,CAAC;AAiUnE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAM5D;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAkBnD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,IAAI,CAM9C"}
|