schema/schemaErrors
@hashml/hashml › Globals › "schema/schemaErrors"
Index
Functions
- duplicatePropAssignmentErrors
- duplicatePropNameErrors
- illegalPropNameErrors
- illegalTagNameErrors
- schemaErrors
- undefinedBlockTagErrors
- undefinedInlineTagErrors
Functions
duplicatePropAssignmentErrors
▸ duplicatePropAssignmentErrors(tag
: string, props
: Array‹object›): DuplicatePropAssignmentError[]
Defined in schema/schemaErrors.ts:106
Parameters:
Name | Type |
---|---|
tag | string |
props | Array‹object› |
Returns: DuplicatePropAssignmentError[]
duplicatePropNameErrors
▸ duplicatePropNameErrors(tag
: string, propNames
: string[]): DuplicatePropNameError[]
Defined in schema/schemaErrors.ts:97
Parameters:
Name | Type |
---|---|
tag | string |
propNames | string[] |
Returns: DuplicatePropNameError[]
illegalPropNameErrors
▸ illegalPropNameErrors(tag
: string, propNames
: string[]): IllegalPropNameError[]
Defined in schema/schemaErrors.ts:124
Parameters:
Name | Type |
---|---|
tag | string |
propNames | string[] |
Returns: IllegalPropNameError[]
illegalTagNameErrors
▸ illegalTagNameErrors(tag
: string): IllegalTagNameError[]
Defined in schema/schemaErrors.ts:154
Parameters:
Name | Type |
---|---|
tag | string |
Returns: IllegalTagNameError[]
schemaErrors
▸ schemaErrors(schema
: SchemaDefinition): SchemaDefinitionError[]
Defined in schema/schemaErrors.ts:36
Check a schema definition for errors. The rules of a schema definition are:
- All prop names within an element must be different
- The pairwise intersection of block prop contents must be empty.
- Prop names may not start with "$"
- Body props must reference block tags that exist in the schema
- Head props and args must reference inline tags that exist in the schema
- Tag names must be "legal": no spaces, no hashtags, no opening brackets
There is an error for each of these rules:
- DuplicatePropNameError
- DuplicatePropAssignmentError
- IllegalPropNameError
- UndefinedBlockTagError
- UndefinedInlineTagError
- IllegalTagNameError
Parameters:
Name | Type | Description |
---|---|---|
schema | SchemaDefinition | Schema definition object. |
Returns: SchemaDefinitionError[]
Array of schema definition errors, or an empty array if no errors were found.
undefinedBlockTagErrors
▸ undefinedBlockTagErrors(blockTags
: Set‹string›, tag
: string, props
: Array‹object›): UndefinedBlockTagError[]
Defined in schema/schemaErrors.ts:142
Parameters:
Name | Type |
---|---|
blockTags | Set‹string› |
tag | string |
props | Array‹object› |
Returns: UndefinedBlockTagError[]
undefinedInlineTagErrors
▸ undefinedInlineTagErrors(inlineTags
: Set‹string›, tag
: string, props
: Array‹object›): UndefinedInlineTagError[]
Defined in schema/schemaErrors.ts:130
Parameters:
Name | Type |
---|---|
inlineTags | Set‹string› |
tag | string |
props | Array‹object› |
Returns: UndefinedInlineTagError[]