Skip to content

Broken TypeScript typings. #19

Closed
Closed
@wujekbogdan

Description

@wujekbogdan

When I import trucate-html using:

import * as truncate from "truncate-html";

Then I'm not able to call truncate("<p>my-html</p>") because TypeScript compiler complains that:

Cannot invoke an expression whose type lacks a call signature.

I'm also not able to call truncate.setup().

When I import trucate-html using:

import truncate from "truncate-html";

Then TypeScript compiler doesn't complain, but there are runtime errors after compilation because truncate is undefined when imported this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions