@agentshouse/mdmodel 0.1.0-alpha.9 → 0.1.0-c03f6cf931ca0
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 +424 -0
- package/README.md +41 -197
- package/dist/body.d.ts +85 -0
- package/dist/body.d.ts.map +1 -0
- package/dist/body.js +1083 -0
- package/dist/built-in.d.ts +4 -0
- package/dist/built-in.d.ts.map +1 -0
- package/dist/built-in.js +19 -0
- package/dist/definition.d.ts +87 -34
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +853 -144
- package/dist/divide.d.ts +3 -0
- package/dist/divide.d.ts.map +1 -0
- package/dist/divide.js +321 -0
- package/dist/document.d.ts +19 -3
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +1007 -188
- package/dist/event.d.ts +77 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +200 -0
- package/dist/facts.d.ts +15 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/facts.js +41 -0
- package/dist/fields.d.ts +6 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +10 -0
- package/dist/form.d.ts +4 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +153 -0
- package/dist/house-model.d.ts +836 -0
- package/dist/house-model.d.ts.map +1 -0
- package/dist/house-model.js +463 -0
- package/dist/house-references/crockford.d.ts +4 -0
- package/dist/house-references/crockford.d.ts.map +1 -0
- package/dist/house-references/crockford.js +3 -0
- package/dist/house-references/patterns.d.ts +9 -0
- package/dist/house-references/patterns.d.ts.map +1 -0
- package/dist/house-references/patterns.js +13 -0
- package/dist/index.d.ts +41 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -5
- package/dist/kinds.d.ts +18 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +150 -0
- package/dist/markdown.d.ts +75 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +265 -0
- package/dist/media-type.d.ts +72 -0
- package/dist/media-type.d.ts.map +1 -0
- package/dist/media-type.js +157 -0
- package/dist/not-ready.d.ts +2 -0
- package/dist/not-ready.d.ts.map +1 -0
- package/dist/not-ready.js +5 -0
- package/dist/paths.d.ts +25 -5
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +206 -35
- package/dist/pattern.d.ts +10 -0
- package/dist/pattern.d.ts.map +1 -0
- package/dist/pattern.js +356 -0
- package/dist/project.d.ts +20 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +80 -101
- package/dist/query/language.d.ts +254 -0
- package/dist/query/language.d.ts.map +1 -0
- package/dist/query/language.js +620 -0
- package/dist/query/match.d.ts +14 -0
- package/dist/query/match.d.ts.map +1 -0
- package/dist/query/match.js +150 -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 +285 -0
- package/dist/references.d.ts +4 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +30 -0
- package/dist/refuse.d.ts +1 -0
- package/dist/refuse.d.ts.map +1 -1
- package/dist/refuse.js +3 -10
- package/dist/reserved.d.ts +6 -0
- package/dist/reserved.d.ts.map +1 -0
- package/dist/reserved.js +21 -0
- package/dist/room-types.d.ts +7 -0
- package/dist/room-types.d.ts.map +1 -0
- package/dist/room-types.js +136 -0
- package/dist/schema.d.ts +6 -5
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +143 -41
- package/dist/types.d.ts +101 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/validate.d.ts +35 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +388 -158
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -3
- package/dist/yaml.d.ts +9 -3
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +326 -201
- package/fixtures/README.md +128 -56
- package/fixtures/cases/absent-link-dangles/library/item.md +8 -0
- package/fixtures/cases/absent-link-dangles/schema.yaml +5 -0
- package/fixtures/cases/absent-optional-field/expected.json +1 -0
- package/fixtures/cases/absent-optional-field/library/companies/acme.md +4 -0
- package/fixtures/cases/absent-optional-field/library/deals/lead.md +6 -0
- package/fixtures/cases/absent-optional-field/schema.yaml +55 -0
- package/fixtures/cases/absolute-link/expected.json +5 -0
- package/fixtures/cases/absolute-link/library/item.md +8 -0
- package/fixtures/cases/absolute-link/schema.yaml +5 -0
- package/fixtures/cases/attachment-reference-any-file/context.json +1 -0
- package/fixtures/cases/attachment-reference-any-file/expected.json +1 -0
- package/fixtures/cases/attachment-reference-any-file/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/deals/renewal.md +18 -0
- package/fixtures/cases/attachment-reference-any-file/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/schema.yaml +32 -0
- package/fixtures/cases/attachment-reference-dangles/context.json +1 -0
- package/fixtures/cases/attachment-reference-dangles/expected.json +1 -0
- package/fixtures/cases/attachment-reference-dangles/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/deals/renewal.md +18 -0
- package/fixtures/cases/attachment-reference-dangles/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/schema.yaml +32 -0
- package/fixtures/cases/attachment-reference-outside/context.json +1 -0
- package/fixtures/cases/attachment-reference-outside/expected.json +7 -0
- package/fixtures/cases/attachment-reference-outside/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/deals/renewal.md +18 -0
- package/fixtures/cases/attachment-reference-outside/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-outside/schema.yaml +32 -0
- package/fixtures/cases/binary-any-reference/expected.json +2 -2
- package/fixtures/cases/binary-any-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-any-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-document-collision/expected.json +1 -2
- package/fixtures/cases/binary-document-collision/schema.yaml +1 -0
- package/fixtures/cases/binary-image-dangles/expected.json +1 -0
- package/fixtures/cases/binary-image-dangles/schema.yaml +1 -0
- package/fixtures/cases/binary-link-dangles/expected.json +1 -0
- package/fixtures/cases/binary-link-dangles/schema.yaml +1 -0
- package/fixtures/cases/binary-link-outside-collection/expected.json +1 -2
- package/fixtures/cases/binary-link-outside-collection/schema.yaml +1 -0
- package/fixtures/cases/binary-prototype-reference/expected.json +2 -2
- package/fixtures/cases/binary-prototype-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-prototype-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-typed-reference/expected.json +2 -2
- package/fixtures/cases/binary-typed-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-typed-reference/schema.yaml +5 -0
- package/fixtures/cases/boolean-field/context.json +1 -0
- package/fixtures/cases/boolean-field/expected.json +7 -0
- package/fixtures/cases/boolean-field/library/companies/acme.md +4 -0
- package/fixtures/cases/boolean-field/library/deals/renewal.md +56 -0
- package/fixtures/cases/boolean-field/schema.yaml +55 -0
- package/fixtures/cases/bracketed-link-definition/library/item.md +1 -1
- package/fixtures/cases/bracketed-link-definition/schema.yaml +5 -0
- package/fixtures/cases/closed-nested-object/context.json +1 -0
- package/fixtures/cases/closed-nested-object/expected.json +7 -0
- package/fixtures/cases/closed-nested-object/library/companies/acme.md +4 -0
- package/fixtures/cases/closed-nested-object/library/deals/renewal.md +57 -0
- package/fixtures/cases/closed-nested-object/schema.yaml +55 -0
- package/fixtures/cases/composed-root-reference/context.json +1 -0
- package/fixtures/cases/composed-root-reference/expected.json +6 -0
- package/fixtures/cases/composed-root-reference/library/a.md +5 -0
- package/fixtures/cases/composed-root-reference/schema.yaml +13 -0
- package/fixtures/cases/conditional-long-text/context.json +1 -0
- package/fixtures/cases/conditional-long-text/expected.json +7 -0
- package/fixtures/cases/conditional-long-text/library/questions/hosting.md +9 -0
- package/fixtures/cases/conditional-long-text/library/questions/payments.md +12 -0
- package/fixtures/cases/conditional-long-text/schema.yaml +13 -0
- package/fixtures/cases/cross-room-link/context.json +1 -0
- package/fixtures/cases/cross-room-link/expected.json +1 -0
- package/fixtures/cases/cross-room-link/library/clients/acme.md +6 -0
- package/fixtures/cases/cross-room-link/schema.yaml +3 -0
- package/fixtures/cases/cross-room-reference/context.json +1 -0
- package/fixtures/cases/cross-room-reference/expected.json +1 -0
- package/fixtures/cases/cross-room-reference/library/clients/acme.md +9 -0
- package/fixtures/cases/cross-room-reference/schema.yaml +8 -0
- package/fixtures/cases/date-time-format/context.json +1 -0
- package/fixtures/cases/date-time-format/expected.json +7 -0
- package/fixtures/cases/date-time-format/library/companies/acme.md +4 -0
- package/fixtures/cases/date-time-format/library/deals/renewal.md +56 -0
- package/fixtures/cases/date-time-format/schema.yaml +55 -0
- package/fixtures/cases/declared-binary-links/schema.yaml +1 -0
- package/fixtures/cases/default-unfilled/context.json +1 -0
- package/fixtures/cases/default-unfilled/expected.json +6 -0
- package/fixtures/cases/default-unfilled/library/companies/acme.md +4 -0
- package/fixtures/cases/default-unfilled/library/deals/renewal.md +54 -0
- package/fixtures/cases/default-unfilled/schema.yaml +55 -0
- package/fixtures/cases/defs-pattern/context.json +1 -0
- package/fixtures/cases/defs-pattern/expected.json +7 -0
- package/fixtures/cases/defs-pattern/library/companies/acme.md +4 -0
- package/fixtures/cases/defs-pattern/library/deals/renewal.md +56 -0
- package/fixtures/cases/defs-pattern/schema.yaml +55 -0
- package/fixtures/cases/dependent-rule/context.json +1 -0
- package/fixtures/cases/dependent-rule/expected.json +6 -0
- package/fixtures/cases/dependent-rule/library/companies/acme.md +4 -0
- package/fixtures/cases/dependent-rule/library/deals/renewal.md +55 -0
- package/fixtures/cases/dependent-rule/schema.yaml +55 -0
- package/fixtures/cases/duplicate-link-definition/library/item.md +1 -1
- package/fixtures/cases/duplicate-link-definition/schema.yaml +5 -0
- package/fixtures/cases/email-format/context.json +1 -0
- package/fixtures/cases/email-format/expected.json +7 -0
- package/fixtures/cases/email-format/library/companies/acme.md +4 -0
- package/fixtures/cases/email-format/library/deals/renewal.md +56 -0
- package/fixtures/cases/email-format/schema.yaml +55 -0
- package/fixtures/cases/equal-labels/context.json +1 -0
- package/fixtures/cases/equal-labels/expected.json +5 -0
- package/fixtures/cases/equal-labels/schema.yaml +4 -0
- package/fixtures/cases/fenced-link-definition/library/item.md +1 -1
- package/fixtures/cases/fenced-link-definition/schema.yaml +5 -0
- package/fixtures/cases/field-enum/expected.json +3 -3
- package/fixtures/cases/field-enum/library/item.md +2 -2
- package/fixtures/cases/field-enum/schema.yaml +6 -0
- package/fixtures/cases/frontmatter-schema/context.json +1 -0
- package/fixtures/cases/frontmatter-schema/expected.json +5 -0
- package/fixtures/cases/frontmatter-schema/schema.yaml +5 -0
- package/fixtures/cases/integer-field/context.json +1 -0
- package/fixtures/cases/integer-field/expected.json +7 -0
- package/fixtures/cases/integer-field/library/companies/acme.md +4 -0
- package/fixtures/cases/integer-field/library/deals/renewal.md +56 -0
- package/fixtures/cases/integer-field/schema.yaml +55 -0
- package/fixtures/cases/interrupted-link-definition/schema.yaml +1 -0
- package/fixtures/cases/json-schema-constructs/context.json +1 -0
- package/fixtures/cases/json-schema-constructs/expected.json +1 -0
- package/fixtures/cases/json-schema-constructs/library/companies/acme.md +4 -0
- package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +56 -0
- package/fixtures/cases/json-schema-constructs/schema.yaml +55 -0
- package/fixtures/cases/labels-in-the-rooms-language/context.json +1 -0
- package/fixtures/cases/labels-in-the-rooms-language/expected.json +1 -0
- package/fixtures/cases/labels-in-the-rooms-language/library/deals/atlas.md +7 -0
- package/fixtures/cases/labels-in-the-rooms-language/schema.yaml +9 -0
- package/fixtures/cases/lazy-list-item/context.json +1 -0
- package/fixtures/cases/lazy-list-item/expected.json +3 -0
- package/fixtures/cases/lazy-list-item/library/item.md +10 -0
- package/fixtures/cases/lazy-list-item/schema.yaml +3 -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/list-item-enum/context.json +1 -0
- package/fixtures/cases/list-item-enum/expected.json +7 -0
- package/fixtures/cases/list-item-enum/library/task.md +7 -0
- package/fixtures/cases/list-item-enum/schema.yaml +3 -0
- package/fixtures/cases/list-item-kind/context.json +1 -0
- package/fixtures/cases/list-item-kind/expected.json +7 -0
- package/fixtures/cases/list-item-kind/library/task.md +6 -0
- package/fixtures/cases/list-item-kind/schema.yaml +3 -0
- package/fixtures/cases/list-items/context.json +1 -0
- package/fixtures/cases/list-items/expected.json +1 -0
- package/fixtures/cases/list-items/library/other.md +3 -0
- package/fixtures/cases/list-items/library/page.md +26 -0
- package/fixtures/cases/list-items/schema.yaml +10 -0
- package/fixtures/cases/list-of-objects-closed/context.json +1 -0
- package/fixtures/cases/list-of-objects-closed/expected.json +7 -0
- package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +56 -0
- package/fixtures/cases/list-of-objects-closed/schema.yaml +55 -0
- package/fixtures/cases/list-of-objects-item/context.json +1 -0
- package/fixtures/cases/list-of-objects-item/expected.json +7 -0
- package/fixtures/cases/list-of-objects-item/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +56 -0
- package/fixtures/cases/list-of-objects-item/schema.yaml +55 -0
- package/fixtures/cases/list-of-objects-reference/context.json +1 -0
- package/fixtures/cases/list-of-objects-reference/expected.json +7 -0
- package/fixtures/cases/list-of-objects-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/deals/renewal.md +17 -0
- package/fixtures/cases/list-of-objects-reference/library/places/depot.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/products/seats.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/products/support.md +4 -0
- package/fixtures/cases/list-of-objects-reference/schema.yaml +32 -0
- package/fixtures/cases/list-reference-path/context.json +1 -0
- package/fixtures/cases/list-reference-path/expected.json +7 -0
- package/fixtures/cases/list-reference-path/library/other.md +3 -0
- package/fixtures/cases/list-reference-path/library/page.md +5 -0
- package/fixtures/cases/list-reference-path/schema.yaml +3 -0
- package/fixtures/cases/list-reference-type/context.json +1 -0
- package/fixtures/cases/list-reference-type/expected.json +7 -0
- package/fixtures/cases/list-reference-type/library/note.md +1 -0
- package/fixtures/cases/list-reference-type/library/page.md +6 -0
- package/fixtures/cases/list-reference-type/schema.yaml +3 -0
- package/fixtures/cases/list-size/context.json +1 -0
- package/fixtures/cases/list-size/expected.json +7 -0
- package/fixtures/cases/list-size/library/companies/acme.md +4 -0
- package/fixtures/cases/list-size/library/deals/renewal.md +58 -0
- package/fixtures/cases/list-size/schema.yaml +55 -0
- package/fixtures/cases/long-fence-link-definition/schema.yaml +1 -0
- package/fixtures/cases/long-value-past-six-levels/context.json +1 -0
- package/fixtures/cases/long-value-past-six-levels/expected.json +5 -0
- package/fixtures/cases/long-value-past-six-levels/schema.yaml +15 -0
- package/fixtures/cases/malformed-definition/expected.json +2 -4
- package/fixtures/cases/malformed-definition/schema.yaml +3 -0
- package/fixtures/cases/malformed-list/context.json +1 -0
- package/fixtures/cases/malformed-list/expected.json +7 -0
- package/fixtures/cases/{structured-section → malformed-list}/library/item.md +1 -1
- package/fixtures/cases/malformed-list/schema.yaml +6 -0
- package/fixtures/cases/member-document/context.json +1 -0
- package/fixtures/cases/member-document/expected.json +1 -0
- package/fixtures/cases/member-document/library/people/ana.md +5 -0
- package/fixtures/cases/member-document/schema.yaml +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/missing-required-field/expected.json +2 -3
- package/fixtures/cases/missing-required-field/library/item.md +1 -1
- package/fixtures/cases/missing-required-field/schema.yaml +6 -0
- package/fixtures/cases/misspelled-key/context.json +1 -0
- package/fixtures/cases/misspelled-key/expected.json +7 -0
- package/fixtures/cases/misspelled-key/library/companies/acme.md +4 -0
- package/fixtures/cases/misspelled-key/library/deals/renewal.md +57 -0
- package/fixtures/cases/misspelled-key/schema.yaml +55 -0
- package/fixtures/cases/name-not-a-string/context.json +1 -0
- package/fixtures/cases/name-not-a-string/expected.json +5 -0
- package/fixtures/cases/name-not-a-string/schema.yaml +5 -0
- package/fixtures/cases/nested-defs/context.json +1 -0
- package/fixtures/cases/nested-defs/expected.json +7 -0
- package/fixtures/cases/nested-defs/library/deal.md +6 -0
- package/fixtures/cases/nested-defs/schema.yaml +11 -0
- package/fixtures/cases/nested-object-reference/context.json +1 -0
- package/fixtures/cases/nested-object-reference/expected.json +7 -0
- package/fixtures/cases/nested-object-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-object-reference/library/deals/renewal.md +17 -0
- package/fixtures/cases/nested-object-reference/library/places/depot.md +4 -0
- package/fixtures/cases/nested-object-reference/library/products/seats.md +4 -0
- package/fixtures/cases/nested-object-reference/library/products/support.md +4 -0
- package/fixtures/cases/nested-object-reference/schema.yaml +32 -0
- package/fixtures/cases/nested-reference/context.json +1 -0
- package/fixtures/cases/nested-reference/expected.json +1 -0
- package/fixtures/cases/nested-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-reference/library/deals/renewal.md +18 -0
- package/fixtures/cases/nested-reference/library/places/depot.md +4 -0
- package/fixtures/cases/nested-reference/library/products/seats.md +4 -0
- package/fixtures/cases/nested-reference/library/products/support.md +4 -0
- package/fixtures/cases/nested-reference/schema.yaml +32 -0
- package/fixtures/cases/nested-required-field/context.json +1 -0
- package/fixtures/cases/nested-required-field/expected.json +7 -0
- package/fixtures/cases/nested-required-field/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-required-field/library/deals/renewal.md +55 -0
- package/fixtures/cases/nested-required-field/schema.yaml +55 -0
- package/fixtures/cases/numeric-range/context.json +1 -0
- package/fixtures/cases/numeric-range/expected.json +7 -0
- package/fixtures/cases/numeric-range/library/companies/acme.md +4 -0
- package/fixtures/cases/numeric-range/library/deals/renewal.md +56 -0
- package/fixtures/cases/numeric-range/schema.yaml +55 -0
- package/fixtures/cases/one-key-two-labels/context.json +1 -0
- package/fixtures/cases/one-key-two-labels/expected.json +5 -0
- package/fixtures/cases/one-key-two-labels/schema.yaml +5 -0
- package/fixtures/cases/one-key-two-types/context.json +1 -0
- package/fixtures/cases/one-key-two-types/expected.json +5 -0
- package/fixtures/cases/one-key-two-types/schema.yaml +4 -0
- package/fixtures/cases/one-of-variant/context.json +1 -0
- package/fixtures/cases/one-of-variant/expected.json +7 -0
- package/fixtures/cases/one-of-variant/library/companies/acme.md +4 -0
- package/fixtures/cases/one-of-variant/library/deals/renewal.md +56 -0
- package/fixtures/cases/one-of-variant/schema.yaml +55 -0
- package/fixtures/cases/other-room-reference/context.json +1 -0
- package/fixtures/cases/other-room-reference/expected.json +7 -0
- package/fixtures/cases/other-room-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/other-room-reference/library/deals/renewal.md +17 -0
- package/fixtures/cases/other-room-reference/library/places/depot.md +4 -0
- package/fixtures/cases/other-room-reference/library/products/seats.md +4 -0
- package/fixtures/cases/other-room-reference/library/products/support.md +4 -0
- package/fixtures/cases/other-room-reference/schema.yaml +32 -0
- package/fixtures/cases/paragraph-link-definition/schema.yaml +1 -0
- package/fixtures/cases/prototype-field/expected.json +3 -3
- package/fixtures/cases/prototype-field/library/item.md +2 -2
- package/fixtures/cases/prototype-field/schema.yaml +5 -0
- package/fixtures/cases/quoted-link-definition/expected.json +1 -2
- package/fixtures/cases/quoted-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/quoted-link-definition/schema.yaml +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/context.json +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/expected.json +7 -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/referenced-missing-file/expected.json +0 -1
- package/fixtures/cases/referenced-missing-file/library/a.md +2 -2
- package/fixtures/cases/referenced-missing-file/library/b.md +2 -2
- package/fixtures/cases/referenced-missing-file/schema.yaml +10 -0
- package/fixtures/cases/remote-ref/context.json +1 -0
- package/fixtures/cases/remote-ref/expected.json +5 -0
- package/fixtures/cases/remote-ref/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/second-member-document/context.json +1 -0
- package/fixtures/cases/second-member-document/expected.json +5 -0
- package/fixtures/cases/second-member-document/schema.yaml +4 -0
- package/fixtures/cases/sections-keyword-refused/context.json +1 -0
- package/fixtures/cases/sections-keyword-refused/expected.json +5 -0
- package/fixtures/cases/sections-keyword-refused/schema.yaml +6 -0
- package/fixtures/cases/shortcut-reference-link/context.json +1 -0
- package/fixtures/cases/shortcut-reference-link/expected.json +5 -0
- package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
- package/fixtures/cases/shortcut-reference-link/schema.yaml +5 -0
- package/fixtures/cases/string-length/context.json +1 -0
- package/fixtures/cases/string-length/expected.json +7 -0
- package/fixtures/cases/string-length/library/companies/acme.md +4 -0
- package/fixtures/cases/string-length/library/deals/renewal.md +56 -0
- package/fixtures/cases/string-length/schema.yaml +55 -0
- package/fixtures/cases/submission-keys/context.json +1 -0
- package/fixtures/cases/submission-keys/expected.json +1 -0
- package/fixtures/cases/submission-keys/library/notes/visitor.md +8 -0
- package/fixtures/cases/submission-keys/schema.yaml +4 -0
- package/fixtures/cases/text-field-kind/context.json +1 -0
- package/fixtures/cases/text-field-kind/expected.json +3 -0
- package/fixtures/cases/text-field-kind/library/page.md +4 -0
- package/fixtures/cases/text-field-kind/schema.yaml +4 -0
- package/fixtures/cases/thematic-break-ends-the-values/context.json +1 -0
- package/fixtures/cases/thematic-break-ends-the-values/expected.json +1 -0
- package/fixtures/cases/thematic-break-ends-the-values/library/item.md +10 -0
- package/fixtures/cases/thematic-break-ends-the-values/schema.yaml +3 -0
- package/fixtures/cases/truncated-link-definition/expected.json +1 -2
- package/fixtures/cases/truncated-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/truncated-link-definition/schema.yaml +1 -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/types-folder-content/context.json +1 -0
- package/fixtures/cases/types-folder-content/expected.json +1 -0
- package/fixtures/cases/types-folder-content/library/types/task.md +4 -0
- package/fixtures/cases/types-folder-content/schema.yaml +4 -0
- package/fixtures/cases/unclosed-frontmatter/expected.json +1 -2
- package/fixtures/cases/undeclared-field/expected.json +3 -3
- package/fixtures/cases/undeclared-field/library/item.md +2 -2
- package/fixtures/cases/undeclared-field/schema.yaml +5 -0
- package/fixtures/cases/unevaluated-items-closed/context.json +1 -0
- package/fixtures/cases/unevaluated-items-closed/expected.json +7 -0
- package/fixtures/cases/unevaluated-items-closed/library/trip.md +16 -0
- package/fixtures/cases/unevaluated-items-closed/schema.yaml +10 -0
- package/fixtures/cases/unknown-type/context.json +1 -0
- package/fixtures/cases/unknown-type/expected.json +6 -0
- package/fixtures/cases/unknown-type/library/item.md +3 -0
- package/fixtures/cases/unknown-type/schema.yaml +3 -0
- package/fixtures/cases/unlisted-reference-type/context.json +1 -0
- package/fixtures/cases/unlisted-reference-type/expected.json +5 -0
- package/fixtures/cases/unlisted-reference-type/schema.yaml +3 -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 +5 -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 +7 -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 +6 -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/cases/unresolved-link/expected.json +1 -2
- package/fixtures/cases/unresolved-link/library/item.md +2 -2
- package/fixtures/cases/unresolved-link/schema.yaml +5 -0
- package/fixtures/cases/valid-typed-document/library/people/ada.md +1 -1
- package/fixtures/cases/valid-typed-document/library/tasks/one.md +11 -11
- package/fixtures/cases/valid-typed-document/schema.yaml +15 -0
- package/fixtures/cases/wide-item-fence-link/schema.yaml +1 -0
- package/fixtures/division.json +454 -0
- package/fixtures/forms.json +347 -0
- package/fixtures/preamble.json +26 -5
- package/fixtures/projection.json +204 -32
- package/fixtures/queries.json +964 -0
- package/package.json +20 -13
- package/dist/definition.js.map +0 -1
- package/dist/document.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/links.d.ts +0 -25
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -380
- package/dist/links.js.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/profile.d.ts +0 -6
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -7
- package/dist/profile.js.map +0 -1
- package/dist/project.js.map +0 -1
- package/dist/refuse.js.map +0 -1
- package/dist/schema.js.map +0 -1
- package/dist/sections.d.ts +0 -10
- package/dist/sections.d.ts.map +0 -1
- package/dist/sections.js +0 -79
- package/dist/sections.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validate.js.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/yaml.js.map +0 -1
- package/fixtures/cases/binary-any-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-document-collision/library/types/note.md +0 -3
- package/fixtures/cases/binary-link-outside-collection/library/types/note.md +0 -3
- package/fixtures/cases/binary-prototype-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/person.md +0 -3
- package/fixtures/cases/bracketed-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/declared-binary-links/library/types/note.md +0 -3
- package/fixtures/cases/duplicate-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/fenced-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/field-enum/library/types/task.md +0 -8
- package/fixtures/cases/interrupted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/long-fence-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/malformed-definition/library/types/task.md +0 -5
- package/fixtures/cases/missing-binary-image/expected.json +0 -6
- package/fixtures/cases/missing-binary-image/library/types/note.md +0 -3
- package/fixtures/cases/missing-binary-link/expected.json +0 -6
- package/fixtures/cases/missing-binary-link/library/types/note.md +0 -3
- package/fixtures/cases/missing-required-field/library/types/task.md +0 -8
- package/fixtures/cases/missing-section-item-kind/expected.json +0 -7
- package/fixtures/cases/missing-section-item-kind/library/types/task.md +0 -7
- package/fixtures/cases/paragraph-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/prd-definition/library/types/task.md +0 -16
- package/fixtures/cases/prototype-field/library/types/task.md +0 -7
- package/fixtures/cases/quoted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/referenced-missing-file/library/types/person.md +0 -5
- package/fixtures/cases/referenced-missing-file/library/types/task.md +0 -8
- package/fixtures/cases/structured-section/expected.json +0 -7
- package/fixtures/cases/structured-section/library/types/task.md +0 -8
- package/fixtures/cases/truncated-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/undeclared-field/library/types/task.md +0 -7
- package/fixtures/cases/unresolved-link/library/types/task.md +0 -7
- package/fixtures/cases/valid-typed-document/library/types/person.md +0 -5
- package/fixtures/cases/valid-typed-document/library/types/task.md +0 -13
- package/fixtures/cases/wide-item-fence-link/library/types/note.md +0 -3
- package/markdown-syntax-profile.md +0 -9
- /package/fixtures/cases/{missing-section-item-kind → absent-link-dangles}/context.json +0 -0
- /package/fixtures/cases/{prd-definition → absent-link-dangles}/expected.json +0 -0
- /package/fixtures/cases/{prd-definition → absent-optional-field}/context.json +0 -0
- /package/fixtures/cases/{structured-section → absolute-link}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/library/notes/draft.md +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/library/notes/draft.md +0 -0
package/dist/yaml.js
CHANGED
|
@@ -1,28 +1,47 @@
|
|
|
1
1
|
export class YamlError extends Error {
|
|
2
2
|
offset;
|
|
3
|
-
constructor(offset){
|
|
4
|
-
super(
|
|
3
|
+
constructor(offset) {
|
|
4
|
+
super();
|
|
5
|
+
this.offset = offset;
|
|
5
6
|
this.name = 'YamlError';
|
|
6
7
|
}
|
|
7
8
|
}
|
|
9
|
+
const YAML_DEPTH_MAX = 64;
|
|
10
|
+
function nested(c, parse) {
|
|
11
|
+
if (c.depth >= YAML_DEPTH_MAX)
|
|
12
|
+
throw new YamlError(c.i);
|
|
13
|
+
c.depth += 1;
|
|
14
|
+
try {
|
|
15
|
+
return parse();
|
|
16
|
+
}
|
|
17
|
+
finally {
|
|
18
|
+
c.depth -= 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
8
21
|
function peek(c) {
|
|
9
22
|
return c.i < c.end ? c.text[c.i] : '';
|
|
10
23
|
}
|
|
11
24
|
function skipEol(c) {
|
|
12
|
-
if (peek(c) === '\r')
|
|
13
|
-
|
|
25
|
+
if (peek(c) === '\r')
|
|
26
|
+
c.i += 1;
|
|
27
|
+
if (peek(c) === '\n')
|
|
28
|
+
c.i += 1;
|
|
14
29
|
}
|
|
15
30
|
function skipSpaces(c) {
|
|
16
|
-
while(peek(c) === ' ')
|
|
17
|
-
|
|
31
|
+
while (peek(c) === ' ')
|
|
32
|
+
c.i += 1;
|
|
33
|
+
if (peek(c) === '\t')
|
|
34
|
+
throw new YamlError(c.i);
|
|
18
35
|
}
|
|
19
36
|
function skipToEol(c) {
|
|
20
|
-
while(c.i < c.end && peek(c) !== '\n' && peek(c) !== '\r')
|
|
37
|
+
while (c.i < c.end && peek(c) !== '\n' && peek(c) !== '\r')
|
|
38
|
+
c.i += 1;
|
|
21
39
|
}
|
|
22
40
|
function skipBlankAndComments(c) {
|
|
23
|
-
while(c.i < c.end){
|
|
41
|
+
while (c.i < c.end) {
|
|
24
42
|
skipSpaces(c);
|
|
25
|
-
if (peek(c) === '#')
|
|
43
|
+
if (peek(c) === '#')
|
|
44
|
+
skipToEol(c);
|
|
26
45
|
if (peek(c) === '\r' || peek(c) === '\n') {
|
|
27
46
|
skipEol(c);
|
|
28
47
|
continue;
|
|
@@ -31,7 +50,7 @@ function skipBlankAndComments(c) {
|
|
|
31
50
|
}
|
|
32
51
|
}
|
|
33
52
|
function skipFlowSpace(c) {
|
|
34
|
-
while(c.i < c.end){
|
|
53
|
+
while (c.i < c.end) {
|
|
35
54
|
const ch = peek(c);
|
|
36
55
|
if (ch === ' ' || ch === '\n' || ch === '\r') {
|
|
37
56
|
c.i += 1;
|
|
@@ -41,64 +60,89 @@ function skipFlowSpace(c) {
|
|
|
41
60
|
skipToEol(c);
|
|
42
61
|
continue;
|
|
43
62
|
}
|
|
44
|
-
if (ch === '\t')
|
|
63
|
+
if (ch === '\t')
|
|
64
|
+
throw new YamlError(c.i);
|
|
45
65
|
break;
|
|
46
66
|
}
|
|
47
67
|
}
|
|
48
68
|
function indentAt(c) {
|
|
49
69
|
let j = c.i;
|
|
50
|
-
while(j > 0 && c.text[j - 1] !== '\n'
|
|
70
|
+
while (j > 0 && c.text[j - 1] !== '\n' && c.text[j - 1] !== '\r')
|
|
71
|
+
j -= 1;
|
|
51
72
|
let n = 0;
|
|
52
|
-
while(j < c.i){
|
|
73
|
+
while (j < c.i) {
|
|
53
74
|
const ch = c.text[j];
|
|
54
|
-
if (ch === ' ')
|
|
55
|
-
|
|
56
|
-
else
|
|
75
|
+
if (ch === ' ')
|
|
76
|
+
n += 1;
|
|
77
|
+
else if (ch === '\t')
|
|
78
|
+
throw new YamlError(j);
|
|
79
|
+
else
|
|
80
|
+
break;
|
|
57
81
|
j += 1;
|
|
58
82
|
}
|
|
59
83
|
return n;
|
|
60
84
|
}
|
|
85
|
+
const UNHELD_TEXT = /[\0\ud800-\udfff]/u;
|
|
61
86
|
function scalar(value, start, end) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (text === '
|
|
72
|
-
|
|
73
|
-
if (/^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?$/.test(text))
|
|
87
|
+
if (typeof value === 'string' && UNHELD_TEXT.test(value))
|
|
88
|
+
throw new YamlError(start);
|
|
89
|
+
return { kind: 'scalar', value, start, end };
|
|
90
|
+
}
|
|
91
|
+
export function interpretPlain(text) {
|
|
92
|
+
if (text === 'true')
|
|
93
|
+
return true;
|
|
94
|
+
if (text === 'false')
|
|
95
|
+
return false;
|
|
96
|
+
if (text === 'null' || text === '')
|
|
97
|
+
return null;
|
|
98
|
+
if (/^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?$/.test(text))
|
|
99
|
+
return Number(text);
|
|
74
100
|
return text;
|
|
75
101
|
}
|
|
102
|
+
const ESCAPES = {
|
|
103
|
+
b: '\b',
|
|
104
|
+
f: '\f',
|
|
105
|
+
n: '\n',
|
|
106
|
+
r: '\r',
|
|
107
|
+
t: '\t',
|
|
108
|
+
'"': '"',
|
|
109
|
+
'/': '/',
|
|
110
|
+
'\\': '\\',
|
|
111
|
+
};
|
|
112
|
+
function parseEscape(c) {
|
|
113
|
+
c.i += 1;
|
|
114
|
+
const escaped = peek(c);
|
|
115
|
+
const held = ESCAPES[escaped];
|
|
116
|
+
if (held !== undefined) {
|
|
117
|
+
c.i += 1;
|
|
118
|
+
return held;
|
|
119
|
+
}
|
|
120
|
+
const hex = c.text.slice(c.i + 1, c.i + 5);
|
|
121
|
+
if (escaped !== 'u' || c.i + 5 > c.end || !/^[0-9A-Fa-f]{4}$/.test(hex))
|
|
122
|
+
throw new YamlError(c.i);
|
|
123
|
+
c.i += 5;
|
|
124
|
+
return String.fromCharCode(Number.parseInt(hex, 16));
|
|
125
|
+
}
|
|
76
126
|
function parseQuoted(c) {
|
|
77
127
|
const quote = peek(c);
|
|
78
128
|
const start = c.i;
|
|
79
129
|
c.i += 1;
|
|
80
130
|
let out = '';
|
|
81
|
-
while(c.i < c.end){
|
|
131
|
+
while (c.i < c.end) {
|
|
82
132
|
const ch = peek(c);
|
|
83
|
-
if (ch ===
|
|
84
|
-
c.i += 1;
|
|
85
|
-
return scalar(out, start, c.i);
|
|
86
|
-
}
|
|
87
|
-
if (ch === '\n' || ch === '\r') throw new YamlError(c.i);
|
|
88
|
-
if (quote === "'" && ch === "'" && c.text[c.i + 1] === "'") {
|
|
133
|
+
if (quote === "'" && ch === "'" && c.i + 1 < c.end && c.text[c.i + 1] === "'") {
|
|
89
134
|
out += "'";
|
|
90
135
|
c.i += 2;
|
|
91
136
|
continue;
|
|
92
137
|
}
|
|
93
|
-
if (
|
|
94
|
-
c.i += 1;
|
|
95
|
-
const escaped = peek(c);
|
|
96
|
-
if (escaped === 'n') out += '\n';
|
|
97
|
-
else if (escaped === 't') out += '\t';
|
|
98
|
-
else if (escaped === '"') out += '"';
|
|
99
|
-
else if (escaped === '\\') out += '\\';
|
|
100
|
-
else throw new YamlError(c.i);
|
|
138
|
+
if (ch === quote) {
|
|
101
139
|
c.i += 1;
|
|
140
|
+
return scalar(out, start, c.i);
|
|
141
|
+
}
|
|
142
|
+
if (ch === '\n' || ch === '\r')
|
|
143
|
+
throw new YamlError(c.i);
|
|
144
|
+
if (quote === '"' && ch === '\\') {
|
|
145
|
+
out += parseEscape(c);
|
|
102
146
|
continue;
|
|
103
147
|
}
|
|
104
148
|
out += ch;
|
|
@@ -108,90 +152,96 @@ function parseQuoted(c) {
|
|
|
108
152
|
}
|
|
109
153
|
function parsePlain(c, flow) {
|
|
110
154
|
const start = c.i;
|
|
111
|
-
while(c.i < c.end){
|
|
155
|
+
while (c.i < c.end) {
|
|
112
156
|
const ch = peek(c);
|
|
113
|
-
if (flow && (ch === ',' || ch === ']' || ch === '}'))
|
|
114
|
-
|
|
115
|
-
if (ch === '
|
|
157
|
+
if (flow && (ch === ',' || ch === ']' || ch === '}'))
|
|
158
|
+
break;
|
|
159
|
+
if (ch === '\n' || ch === '\r')
|
|
160
|
+
break;
|
|
161
|
+
if (ch === '#' && (c.i === start || c.text[c.i - 1] === ' ' || c.text[c.i - 1] === '\t'))
|
|
162
|
+
break;
|
|
116
163
|
c.i += 1;
|
|
117
164
|
}
|
|
118
|
-
if (c.i === start)
|
|
165
|
+
if (c.i === start)
|
|
166
|
+
throw new YamlError(c.i);
|
|
119
167
|
const raw = c.text.slice(start, c.i);
|
|
120
168
|
const trimmed = raw.trimEnd();
|
|
121
169
|
return scalar(interpretPlain(trimmed), start, start + trimmed.length);
|
|
122
170
|
}
|
|
123
171
|
function parseScalar(c, flow) {
|
|
124
172
|
const ch = peek(c);
|
|
125
|
-
if (ch === '"' || ch === "'")
|
|
173
|
+
if (ch === '"' || ch === "'")
|
|
174
|
+
return parseQuoted(c);
|
|
126
175
|
return parsePlain(c, flow);
|
|
127
176
|
}
|
|
128
177
|
function parseKey(c) {
|
|
129
178
|
const start = c.i;
|
|
130
179
|
if (peek(c) === '"' || peek(c) === "'") {
|
|
131
180
|
const quoted = parseQuoted(c);
|
|
132
|
-
if (typeof quoted.value !== 'string')
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
start,
|
|
136
|
-
end: c.i
|
|
137
|
-
};
|
|
181
|
+
if (typeof quoted.value !== 'string')
|
|
182
|
+
throw new YamlError(start);
|
|
183
|
+
return { name: quoted.value, start, end: c.i };
|
|
138
184
|
}
|
|
139
185
|
let end = c.i;
|
|
140
|
-
while(c.i < c.end){
|
|
186
|
+
while (c.i < c.end) {
|
|
141
187
|
const ch = peek(c);
|
|
142
|
-
if (ch === ':' ||
|
|
188
|
+
if (ch === ':' ||
|
|
189
|
+
ch === '\n' ||
|
|
190
|
+
ch === '\r' ||
|
|
191
|
+
ch === ',' ||
|
|
192
|
+
ch === '}' ||
|
|
193
|
+
ch === ']' ||
|
|
194
|
+
ch === '#' ||
|
|
195
|
+
ch === '{' ||
|
|
196
|
+
ch === '[') {
|
|
143
197
|
break;
|
|
144
198
|
}
|
|
145
199
|
c.i += 1;
|
|
146
|
-
if (ch !== ' ' && ch !== '\t')
|
|
200
|
+
if (ch !== ' ' && ch !== '\t')
|
|
201
|
+
end = c.i;
|
|
147
202
|
}
|
|
148
|
-
if (end === start)
|
|
203
|
+
if (end === start)
|
|
204
|
+
throw new YamlError(c.i);
|
|
149
205
|
c.i = end;
|
|
150
|
-
return {
|
|
151
|
-
name: c.text.slice(start, end),
|
|
152
|
-
start,
|
|
153
|
-
end
|
|
154
|
-
};
|
|
206
|
+
return { name: c.text.slice(start, end), start, end };
|
|
155
207
|
}
|
|
156
208
|
function parseFlowValue(c) {
|
|
157
209
|
skipFlowSpace(c);
|
|
158
210
|
const ch = peek(c);
|
|
159
|
-
if (ch === '{')
|
|
160
|
-
|
|
161
|
-
if (ch === '
|
|
211
|
+
if (ch === '{')
|
|
212
|
+
return parseFlowMap(c);
|
|
213
|
+
if (ch === '[')
|
|
214
|
+
return parseFlowSeq(c);
|
|
215
|
+
if (ch === '|' || ch === '>')
|
|
216
|
+
throw new YamlError(c.i);
|
|
162
217
|
return parseScalar(c, true);
|
|
163
218
|
}
|
|
164
219
|
function parseFlowMap(c) {
|
|
220
|
+
return nested(c, () => flowMap(c));
|
|
221
|
+
}
|
|
222
|
+
function flowMap(c) {
|
|
165
223
|
const start = c.i;
|
|
166
|
-
if (peek(c) !== '{') throw new YamlError(c.i);
|
|
167
224
|
c.i += 1;
|
|
168
225
|
skipFlowSpace(c);
|
|
169
226
|
const entries = [];
|
|
170
227
|
const seen = new Set();
|
|
171
228
|
if (peek(c) === '}') {
|
|
172
229
|
c.i += 1;
|
|
173
|
-
return {
|
|
174
|
-
kind: 'map',
|
|
175
|
-
entries,
|
|
176
|
-
start,
|
|
177
|
-
end: c.i
|
|
178
|
-
};
|
|
230
|
+
return { kind: 'map', entries, start, end: c.i };
|
|
179
231
|
}
|
|
180
|
-
while(c.i < c.end){
|
|
232
|
+
while (c.i < c.end) {
|
|
181
233
|
skipFlowSpace(c);
|
|
182
234
|
const key = parseKey(c);
|
|
183
235
|
skipFlowSpace(c);
|
|
184
|
-
if (peek(c) !== ':')
|
|
236
|
+
if (peek(c) !== ':')
|
|
237
|
+
throw new YamlError(c.i);
|
|
185
238
|
c.i += 1;
|
|
239
|
+
const after = c.i;
|
|
186
240
|
const value = parseFlowValue(c);
|
|
187
|
-
if (seen.has(key.name))
|
|
241
|
+
if (seen.has(key.name))
|
|
242
|
+
throw new YamlError(key.start);
|
|
188
243
|
seen.add(key.name);
|
|
189
|
-
entries.push({
|
|
190
|
-
key: key.name,
|
|
191
|
-
keyStart: key.start,
|
|
192
|
-
keyEnd: key.end,
|
|
193
|
-
value
|
|
194
|
-
});
|
|
244
|
+
entries.push({ key: key.name, after, value });
|
|
195
245
|
skipFlowSpace(c);
|
|
196
246
|
if (peek(c) === ',') {
|
|
197
247
|
c.i += 1;
|
|
@@ -199,33 +249,25 @@ function parseFlowMap(c) {
|
|
|
199
249
|
}
|
|
200
250
|
if (peek(c) === '}') {
|
|
201
251
|
c.i += 1;
|
|
202
|
-
return {
|
|
203
|
-
kind: 'map',
|
|
204
|
-
entries,
|
|
205
|
-
start,
|
|
206
|
-
end: c.i
|
|
207
|
-
};
|
|
252
|
+
return { kind: 'map', entries, start, end: c.i };
|
|
208
253
|
}
|
|
209
254
|
throw new YamlError(c.i);
|
|
210
255
|
}
|
|
211
256
|
throw new YamlError(c.i);
|
|
212
257
|
}
|
|
213
258
|
function parseFlowSeq(c) {
|
|
259
|
+
return nested(c, () => flowSeq(c));
|
|
260
|
+
}
|
|
261
|
+
function flowSeq(c) {
|
|
214
262
|
const start = c.i;
|
|
215
|
-
if (peek(c) !== '[') throw new YamlError(c.i);
|
|
216
263
|
c.i += 1;
|
|
217
264
|
skipFlowSpace(c);
|
|
218
265
|
const items = [];
|
|
219
266
|
if (peek(c) === ']') {
|
|
220
267
|
c.i += 1;
|
|
221
|
-
return {
|
|
222
|
-
kind: 'seq',
|
|
223
|
-
items,
|
|
224
|
-
start,
|
|
225
|
-
end: c.i
|
|
226
|
-
};
|
|
268
|
+
return { kind: 'seq', items, start, end: c.i };
|
|
227
269
|
}
|
|
228
|
-
while(c.i < c.end){
|
|
270
|
+
while (c.i < c.end) {
|
|
229
271
|
items.push(parseFlowValue(c));
|
|
230
272
|
skipFlowSpace(c);
|
|
231
273
|
if (peek(c) === ',') {
|
|
@@ -235,138 +277,223 @@ function parseFlowSeq(c) {
|
|
|
235
277
|
}
|
|
236
278
|
if (peek(c) === ']') {
|
|
237
279
|
c.i += 1;
|
|
238
|
-
return {
|
|
239
|
-
kind: 'seq',
|
|
240
|
-
items,
|
|
241
|
-
start,
|
|
242
|
-
end: c.i
|
|
243
|
-
};
|
|
280
|
+
return { kind: 'seq', items, start, end: c.i };
|
|
244
281
|
}
|
|
245
282
|
throw new YamlError(c.i);
|
|
246
283
|
}
|
|
247
284
|
throw new YamlError(c.i);
|
|
248
285
|
}
|
|
249
286
|
function parseValue(c, parentKeyIndent) {
|
|
287
|
+
const at = c.i;
|
|
250
288
|
skipSpaces(c);
|
|
251
|
-
if (peek(c) === '#')
|
|
289
|
+
if (peek(c) === '#')
|
|
290
|
+
skipToEol(c);
|
|
252
291
|
const ch = peek(c);
|
|
253
292
|
if (ch === '' || ch === '\n' || ch === '\r') {
|
|
254
293
|
skipEol(c);
|
|
255
294
|
skipBlankAndComments(c);
|
|
256
|
-
if (c.i >= c.end)
|
|
295
|
+
if (c.i >= c.end)
|
|
296
|
+
return scalar(null, at, at);
|
|
257
297
|
const nextIndent = indentAt(c);
|
|
258
|
-
if (nextIndent
|
|
259
|
-
|
|
260
|
-
if (
|
|
261
|
-
|
|
298
|
+
if (nextIndent === parentKeyIndent && seqAhead(c))
|
|
299
|
+
return parseBlockSeq(c, nextIndent);
|
|
300
|
+
if (nextIndent <= parentKeyIndent)
|
|
301
|
+
return scalar(null, at, at);
|
|
302
|
+
if (peek(c) === '-')
|
|
303
|
+
return parseBlockSeq(c, nextIndent);
|
|
304
|
+
if (peek(c) === '[')
|
|
305
|
+
return parseFlowSeq(c);
|
|
306
|
+
if (peek(c) === '{')
|
|
307
|
+
return parseFlowMap(c);
|
|
262
308
|
return parseBlockMap(c, nextIndent);
|
|
263
309
|
}
|
|
264
|
-
if (ch === '{')
|
|
265
|
-
|
|
266
|
-
if (ch === '
|
|
310
|
+
if (ch === '{')
|
|
311
|
+
return parseFlowMap(c);
|
|
312
|
+
if (ch === '[')
|
|
313
|
+
return parseFlowSeq(c);
|
|
314
|
+
if (ch === '|' || ch === '>')
|
|
315
|
+
throw new YamlError(c.i);
|
|
267
316
|
return parseScalar(c, false);
|
|
268
317
|
}
|
|
318
|
+
function seqAhead(c) {
|
|
319
|
+
const next = c.text[c.i + 1];
|
|
320
|
+
return peek(c) === '-' && (next === ' ' || next === '\n' || next === '\r' || c.i + 1 >= c.end);
|
|
321
|
+
}
|
|
322
|
+
function mappingAhead(c) {
|
|
323
|
+
const start = c.i;
|
|
324
|
+
try {
|
|
325
|
+
if (peek(c) === '{' || peek(c) === '[')
|
|
326
|
+
return false;
|
|
327
|
+
parseKey(c);
|
|
328
|
+
skipSpaces(c);
|
|
329
|
+
if (peek(c) !== ':')
|
|
330
|
+
return false;
|
|
331
|
+
const next = c.text[c.i + 1];
|
|
332
|
+
return next === ' ' || next === '\n' || next === '\r' || c.i + 1 >= c.end;
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
c.i = start;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
function lineStartOf(c) {
|
|
342
|
+
let j = c.i;
|
|
343
|
+
while (j > 0 && c.text[j - 1] !== '\n' && c.text[j - 1] !== '\r')
|
|
344
|
+
j -= 1;
|
|
345
|
+
return j;
|
|
346
|
+
}
|
|
347
|
+
function parseSeqItem(c, indent) {
|
|
348
|
+
skipSpaces(c);
|
|
349
|
+
if (peek(c) !== '#' && peek(c) !== '\n' && peek(c) !== '\r' && c.i < c.end && mappingAhead(c))
|
|
350
|
+
return parseBlockMap(c, c.i - lineStartOf(c), true);
|
|
351
|
+
return parseValue(c, indent);
|
|
352
|
+
}
|
|
269
353
|
function parseBlockSeq(c, indent) {
|
|
354
|
+
return nested(c, () => blockSeq(c, indent));
|
|
355
|
+
}
|
|
356
|
+
function blockSeq(c, indent) {
|
|
270
357
|
const start = c.i;
|
|
271
358
|
const items = [];
|
|
272
359
|
let end = start;
|
|
273
|
-
while(c.i < c.end){
|
|
360
|
+
while (c.i < c.end) {
|
|
274
361
|
skipBlankAndComments(c);
|
|
275
|
-
if (c.i >= c.end)
|
|
276
|
-
|
|
277
|
-
if (
|
|
362
|
+
if (c.i >= c.end)
|
|
363
|
+
break;
|
|
364
|
+
if (indentAt(c) !== indent)
|
|
365
|
+
break;
|
|
366
|
+
if (peek(c) !== '-')
|
|
367
|
+
break;
|
|
278
368
|
c.i += 1;
|
|
279
|
-
|
|
280
|
-
|
|
369
|
+
const item = parseSeqItem(c, indent);
|
|
370
|
+
items.push(item);
|
|
371
|
+
end = item.end;
|
|
281
372
|
}
|
|
282
|
-
return {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
function parseBlockMap(c, indent) {
|
|
373
|
+
return { kind: 'seq', items, start, end };
|
|
374
|
+
}
|
|
375
|
+
function parseBlockMap(c, indent, inline = false) {
|
|
376
|
+
return nested(c, () => blockMap(c, indent, inline));
|
|
377
|
+
}
|
|
378
|
+
function blockMap(c, indent, inline) {
|
|
290
379
|
const start = c.i;
|
|
291
380
|
const entries = [];
|
|
292
381
|
const seen = new Set();
|
|
293
382
|
let end = start;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (
|
|
297
|
-
|
|
298
|
-
|
|
383
|
+
let first = inline;
|
|
384
|
+
while (c.i < c.end) {
|
|
385
|
+
if (!first) {
|
|
386
|
+
skipBlankAndComments(c);
|
|
387
|
+
if (c.i >= c.end)
|
|
388
|
+
break;
|
|
389
|
+
if (indentAt(c) < indent)
|
|
390
|
+
break;
|
|
391
|
+
if (indentAt(c) > indent)
|
|
392
|
+
throw new YamlError(c.i);
|
|
393
|
+
}
|
|
394
|
+
first = false;
|
|
299
395
|
const key = parseKey(c);
|
|
300
396
|
skipSpaces(c);
|
|
301
|
-
if (peek(c) !== ':')
|
|
397
|
+
if (peek(c) !== ':')
|
|
398
|
+
throw new YamlError(c.i);
|
|
302
399
|
c.i += 1;
|
|
400
|
+
const after = c.i;
|
|
303
401
|
const value = parseValue(c, indent);
|
|
304
|
-
if (seen.has(key.name))
|
|
402
|
+
if (seen.has(key.name))
|
|
403
|
+
throw new YamlError(key.start);
|
|
305
404
|
seen.add(key.name);
|
|
306
|
-
entries.push({
|
|
307
|
-
|
|
308
|
-
keyStart: key.start,
|
|
309
|
-
keyEnd: key.end,
|
|
310
|
-
value
|
|
311
|
-
});
|
|
312
|
-
end = c.i;
|
|
405
|
+
entries.push({ key: key.name, after, value });
|
|
406
|
+
end = value.end;
|
|
313
407
|
}
|
|
314
|
-
return {
|
|
315
|
-
kind: 'map',
|
|
316
|
-
entries,
|
|
317
|
-
start,
|
|
318
|
-
end
|
|
319
|
-
};
|
|
408
|
+
return { kind: 'map', entries, start, end };
|
|
320
409
|
}
|
|
321
410
|
export function parseYamlMapping(text, start, end) {
|
|
322
|
-
const c = {
|
|
323
|
-
text,
|
|
324
|
-
i: start,
|
|
325
|
-
end
|
|
326
|
-
};
|
|
411
|
+
const c = { text, i: start, end, depth: 0 };
|
|
327
412
|
skipBlankAndComments(c);
|
|
328
|
-
if (c.i >= end)
|
|
329
|
-
kind: 'map',
|
|
330
|
-
entries: [],
|
|
331
|
-
start,
|
|
332
|
-
end
|
|
333
|
-
};
|
|
413
|
+
if (c.i >= end)
|
|
414
|
+
return { kind: 'map', entries: [], start, end };
|
|
334
415
|
if (peek(c) === '{') {
|
|
335
416
|
const mapped = parseFlowMap(c);
|
|
336
417
|
skipBlankAndComments(c);
|
|
337
|
-
if (c.i < end)
|
|
418
|
+
if (c.i < end)
|
|
419
|
+
throw new YamlError(c.i);
|
|
338
420
|
return mapped;
|
|
339
421
|
}
|
|
340
422
|
const mapped = parseBlockMap(c, indentAt(c));
|
|
341
423
|
skipBlankAndComments(c);
|
|
342
|
-
if (c.i < end)
|
|
424
|
+
if (c.i < end)
|
|
425
|
+
throw new YamlError(c.i);
|
|
343
426
|
return mapped;
|
|
344
427
|
}
|
|
345
428
|
export function jsValue(node) {
|
|
346
|
-
if (node.kind === 'scalar')
|
|
347
|
-
|
|
429
|
+
if (node.kind === 'scalar')
|
|
430
|
+
return node.value;
|
|
431
|
+
if (node.kind === 'seq')
|
|
432
|
+
return node.items.map(jsValue);
|
|
348
433
|
const record = Object.create(null);
|
|
349
|
-
for (const entry of node.entries)
|
|
434
|
+
for (const entry of node.entries)
|
|
435
|
+
record[entry.key] = jsValue(entry.value);
|
|
350
436
|
return record;
|
|
351
437
|
}
|
|
352
438
|
export function mapEntry(map, key) {
|
|
353
|
-
return map.entries.find((entry)=>entry.key === key);
|
|
439
|
+
return map.entries.find((entry) => entry.key === key);
|
|
354
440
|
}
|
|
355
441
|
export function isPlainSafe(text) {
|
|
356
|
-
if (text === '' || text === 'true' || text === 'false' || text === 'null')
|
|
357
|
-
|
|
358
|
-
if (
|
|
359
|
-
|
|
442
|
+
if (text === '' || text === 'true' || text === 'false' || text === 'null')
|
|
443
|
+
return false;
|
|
444
|
+
if (/[\s#:{}[\],&*!|>'"%@`]/.test(text))
|
|
445
|
+
return false;
|
|
446
|
+
if (text.startsWith('-') || text.startsWith('?') || text.startsWith(':'))
|
|
447
|
+
return false;
|
|
448
|
+
if (/^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?$/.test(text))
|
|
449
|
+
return false;
|
|
360
450
|
return true;
|
|
361
451
|
}
|
|
452
|
+
export function plain(value) {
|
|
453
|
+
if (!isRecord(value))
|
|
454
|
+
return false;
|
|
455
|
+
const prototype = Object.getPrototypeOf(value);
|
|
456
|
+
return prototype === Object.prototype || prototype === null;
|
|
457
|
+
}
|
|
458
|
+
function listed(value) {
|
|
459
|
+
const keys = Object.keys(value);
|
|
460
|
+
return keys.length === value.length && keys.every((key, index) => key === String(index));
|
|
461
|
+
}
|
|
462
|
+
function heldWithin(value, within) {
|
|
463
|
+
if (typeof value === 'string')
|
|
464
|
+
return !UNHELD_TEXT.test(value);
|
|
465
|
+
if (value === null || typeof value === 'boolean')
|
|
466
|
+
return true;
|
|
467
|
+
if (typeof value === 'number')
|
|
468
|
+
return Number.isFinite(value);
|
|
469
|
+
if (typeof value !== 'object' || within.includes(value))
|
|
470
|
+
return false;
|
|
471
|
+
if (within.length + 1 >= YAML_DEPTH_MAX)
|
|
472
|
+
return false;
|
|
473
|
+
const path = [...within, value];
|
|
474
|
+
const held = (item) => heldWithin(item, path);
|
|
475
|
+
if (Array.isArray(value))
|
|
476
|
+
return listed(value) && value.every(held);
|
|
477
|
+
return (plain(value) &&
|
|
478
|
+
Object.keys(value).every((key) => !UNHELD_TEXT.test(key)) &&
|
|
479
|
+
Object.values(value).every(held));
|
|
480
|
+
}
|
|
481
|
+
export function documentValue(value) {
|
|
482
|
+
return heldWithin(value, []);
|
|
483
|
+
}
|
|
362
484
|
export function serializeJs(value) {
|
|
363
|
-
if (value ===
|
|
364
|
-
|
|
365
|
-
if (value ===
|
|
366
|
-
|
|
367
|
-
if (
|
|
368
|
-
|
|
369
|
-
|
|
485
|
+
if (typeof value === 'string')
|
|
486
|
+
return isPlainSafe(value) ? value : JSON.stringify(value);
|
|
487
|
+
if (value === null || typeof value !== 'object')
|
|
488
|
+
return JSON.stringify(value);
|
|
489
|
+
if (Array.isArray(value))
|
|
490
|
+
return `[${value.map(serializeJs).join(', ')}]`;
|
|
491
|
+
return `{${Object.entries(value)
|
|
492
|
+
.map(([key, held]) => `${serializeKey(key)}: ${serializeJs(held)}`)
|
|
493
|
+
.join(', ')}}`;
|
|
494
|
+
}
|
|
495
|
+
export function isRecord(value) {
|
|
496
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
370
497
|
}
|
|
371
498
|
export function serializeKey(name) {
|
|
372
499
|
return isPlainSafe(name) || /^[A-Za-z][A-Za-z0-9_-]*$/.test(name) ? name : JSON.stringify(name);
|
|
@@ -383,47 +510,45 @@ export function bodyAfterFrontmatter(content) {
|
|
|
383
510
|
return content.slice(bodyStartOf(content));
|
|
384
511
|
}
|
|
385
512
|
export function extractFrontmatter(content) {
|
|
386
|
-
if (!content.startsWith('---'))
|
|
387
|
-
kind: 'none'
|
|
388
|
-
};
|
|
513
|
+
if (!content.startsWith('---'))
|
|
514
|
+
return { kind: 'none' };
|
|
389
515
|
const firstNl = content.indexOf('\n');
|
|
390
|
-
const firstLine = firstNl === -1
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
516
|
+
const firstLine = firstNl === -1
|
|
517
|
+
? content
|
|
518
|
+
: content.slice(0, content[firstNl - 1] === '\r' ? firstNl - 1 : firstNl);
|
|
519
|
+
if (!/^---[ \t]*$/.test(firstLine))
|
|
520
|
+
return { kind: 'none' };
|
|
521
|
+
if (firstNl === -1)
|
|
522
|
+
return { kind: 'unclosed' };
|
|
397
523
|
const yamlStart = firstNl + 1;
|
|
398
524
|
let i = yamlStart;
|
|
399
|
-
|
|
525
|
+
for (;;) {
|
|
400
526
|
const nl = content.indexOf('\n', i);
|
|
401
527
|
const lineEnd = nl === -1 ? content.length : nl;
|
|
402
528
|
let line = content.slice(i, lineEnd);
|
|
403
|
-
if (line.endsWith('\r'))
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
yamlStart,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
if (nl === -1) return {
|
|
410
|
-
kind: 'unclosed'
|
|
411
|
-
};
|
|
529
|
+
if (line.endsWith('\r'))
|
|
530
|
+
line = line.slice(0, -1);
|
|
531
|
+
if (/^---[ \t]*$/.test(line))
|
|
532
|
+
return { kind: 'ok', yamlStart, yamlEnd: i };
|
|
533
|
+
if (nl === -1)
|
|
534
|
+
return { kind: 'unclosed' };
|
|
412
535
|
i = nl + 1;
|
|
413
536
|
}
|
|
414
|
-
return {
|
|
415
|
-
kind: 'unclosed'
|
|
416
|
-
};
|
|
417
537
|
}
|
|
418
538
|
export function equalValue(left, right) {
|
|
419
|
-
if (left === right)
|
|
539
|
+
if (left === right)
|
|
540
|
+
return true;
|
|
420
541
|
if (Array.isArray(left) && Array.isArray(right)) {
|
|
421
|
-
return left.length === right.length &&
|
|
542
|
+
return (left.length === right.length &&
|
|
543
|
+
Array.from(left).every((item, index) => equalValue(item, right[index])));
|
|
544
|
+
}
|
|
545
|
+
if (isRecord(left) && isRecord(right)) {
|
|
546
|
+
const keys = Object.keys(left);
|
|
547
|
+
return (keys.length === Object.keys(right).length &&
|
|
548
|
+
keys.every((key) => Object.hasOwn(right, key) && equalValue(left[key], right[key])));
|
|
422
549
|
}
|
|
423
550
|
return false;
|
|
424
551
|
}
|
|
425
552
|
export function lineEnding(content) {
|
|
426
553
|
return content.includes('\r\n') ? '\r\n' : '\n';
|
|
427
554
|
}
|
|
428
|
-
|
|
429
|
-
//# sourceMappingURL=yaml.js.map
|