Skip to content

The WithContext type is invalid #98

Open
@jasongerbes

Description

@jasongerbes

The WithContext type accepts all Thing types:

/** Used at the top-level node to indicate the context for the JSON-LD objects used. The context provided in this type is compatible with the keys and URLs in the rest of this generated file. */
export declare type WithContext<T extends Thing> = T & {
    "@context": "https://schema.org";
};

However, Thing allows string values. For example:

export const thing: Thing = '';

It's not possible to intersect string and object, which makes the WithContext type invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions