Definitelytyped: blueimp-md5: blueimp.md5 is not a function

Created on 15 Apr 2016  ·  3Comments  ·  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I tried using the latest blueimp-md5.d.ts file in this repo and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I want to talk about xxxx/xxxx.d.ts.
    Error occurs when I try to use the definition file like this hashed = require("blueimg-md5").md5("my string").
    From npm page, we can see that the export of this module is simply a function.
    // Use the following version if you installed the package with npm: 
        var md5 = require("blueimp-md5"), 
        query = url.parse(req.url).query;
    // Calculate and print the MD5 hash of the url query: 
    res.end(md5(query));

The definition should be

declare module 'blueimp-md5' {
    function md5(value: string, key?: string, raw?: boolean): string;
    export = md5;
}

rather than

declare module 'blueimp-md5' {
    export function md5(value: string, key?: string, raw?: boolean): string;
}

All 3 comments

I have the same problem. ;| Definition is still the same.

me too.

please send a pull request. I'll review it.

Was this page helpful?
0 / 5 - 0 ratings