Skip to content

[types] Incorrect types for Writer class #530

@opl-

Description

@opl-

In the DefinitelyTyped, the Writer.list types claim it returns an array of quads, and Writer.addQuad types claim it accepts an array of quads, but in reality the first returns a SerializedTerm, and the second serializes a passed in array of named nodes as _:undefined.

Writer.blank also returns a SerializedTerm while being typed as returning a BlankNode.

Writer.end types seem to erroneously claim that it accepts a result: string argument - I imagine this one was supposed to be a type of the ErrorCallback's result argument instead.

N3: https://github.com/rdfjs/N3.js/blob/5a58e93196a5048b6a4c09a1826847a7b811d283/src/N3Writer.js

DefinitelyTyped: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/96890be4669c6d5f25aa2ee1fddf5e9e8a073e36/types/n3/index.d.ts

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