arb / celebrate

A joi validation middleware for Express.
MIT License
1.33k stars 66 forks source link

Last try to get types correct #151

Closed arb closed 4 years ago

arb commented 4 years ago

Possibly trumps #151

Fixes #149

arb commented 4 years ago

@kdankert can you try this and let me know what you get?

codecov-io commented 4 years ago

Codecov Report

Merging #151 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #151   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          68     68           
  Branches       11     11           
=====================================
  Hits           68     68

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d0a1b86...c7bbf8f. Read the comment docs.

lbevilacqua commented 4 years ago

Hi, since celebrate has multiple exports in its main module, an alternative and simpler solution to the errors reported by @kdankert would be to not use the namespace feature.

from:

declare namespace Celebrate {
    enum Segments { ... }
    function celebrate( ... )
    ...
}
export = Celebrate

to

export declare enum Segments { ... }
export declare function celebrate( ... )

See #152

arb commented 4 years ago

Closing in favor if #152