koajs / joi-router

Configurable, input and output validated routing for koa
MIT License
450 stars 96 forks source link

`is-gen-fn` is has invalid package.json in Node 16 #131

Open shawncarr opened 3 years ago

shawncarr commented 3 years ago

The package is-gen-fn, which koa-joi-router has a dependency on, has an issue in its package.json resulting in a DeprecationWarning when koa-joi-router is used in node 16.

[DEP0128] DeprecationWarning: Invalid 'main' field in '/usr/src/app/node_modules/is-gen-fn/package.json' of 'yes'. Please either fix that or report it to the module author

As the is-gen-fn package has not been updated in 7 years nor is it public, and is a single line function I recommend that you implement the function in this package to avoid issues in the future.

Function from is-gen-fn

function isGeneratorFunction(obj) {
  return obj && obj.constructor && 'GeneratorFunction' == obj.constructor.name;
}
jiminikiz commented 2 years ago

Came here to post what @shawncarr posted, I too agree with his solution too.

3imed-jaberi commented 2 years ago

Hello guys, I solve it ago some time by this PR #128 . just I'm wait @aheckmann to merge it.

shawncarr commented 2 years ago

@3imed-jaberi can you update the PR description to reference this issue?

NourIM commented 11 months ago

Hi @3imed-jaberi! when are you planning to publish these fixes to the new version?