jshttp / type-is

Infer the content-type of a request.
MIT License
228 stars 32 forks source link

Update JSDoc #42

Closed zavr-1 closed 4 years ago

zavr-1 commented 5 years ago

Hi I've noticed you can make a few changes.

zavr-1 commented 5 years ago

I thought you could remove

// remove the parameters    
  type.parameters = undefined

because the MediaType does not have them https://github.com/jshttp/media-typer/blob/master/index.js#L139 ... but I didn't notice you have fixed dependency on media-typer. is there any particular reason for that?

dougwilson commented 5 years ago

Hi @zavr-1 this is because I rewrite the media-typer modules to actually correspond to the RFC it references, which has no parameter syntax. I am in the process of making all the necessary changes to this module in order to upgrade it to the newest media-typer, but I have not completed the work yet. You can see a preview of the work on the develop branch here: https://github.com/jshttp/type-is/tree/develop

zavr-1 commented 5 years ago

@dougwilson OK thanks so if I do

function normalizeType (value) {
  // parse the type
  var type = contentType.parse(value).type

  if (!typer.test(type)) {
    return null
  }

  return type
}

would that be a thorough enough substitute? ty

dougwilson commented 5 years ago

I already made the changes on the develop branch. You do not need to make any changes there for your jsdoc fix.

zavr-1 commented 5 years ago

Yeah I just meant if I wanted to use it, not for the PR. thanks I think you could close this.

helio-frota commented 4 years ago

Yeah I just meant if I wanted to use it, not for the PR. thanks I think you could close this.

Hi, Closing this pull request as part of triage process. Thank you.