Giter Club home page Giter Club logo

Comments (3)

dougwilson avatar dougwilson commented on July 21, 2024

Hi @andys8 yea, I can see what you mean, though the link to TypeScript doesn't really matter here in general, as this is a JavaScript library, not a TypeScript library.

Is there a specific reason the API is designed as it is?

I don't think anyone is around these days from when this API decision was made, and I don't know exactly, so I unfortunately cannot provide you insight into that. Looking at the git history, the API of returning false is there since the very first commit: 1da5f79

Is it possible to bump major version and fix the signature regarding the amount of users?

It's possible, though unless there is a really good reason and someone is going to volunteer to pick up the torch and make pull requests and inform the community of this change, it seems too large to do at this point. The API of this module is just meant to mimic [email protected] as a drop-in, especially now that mime released 2.x with a completely different API.

1,262 public npm modules depend on the existing behavior and the constant updates to the mime database. Releasing a new major will immediately cut all those users off from further database updates until every module gets updated. I'm not sure how easy it will be to update with this type of API change, since it's a subtle change in the return value vs something like a function being removed.

Perhaps if someone can estimate what the usage of this API is out there we can form a conversation around the impact of the change, as otherwise, like it or not (I don't like the API), it's just now "part of the ecosystem" and not an easy rock to move.

from mime-types.

dougwilson avatar dougwilson commented on July 21, 2024

Closing due to no follow up response to continue discussion.

from mime-types.

andys8 avatar andys8 commented on July 21, 2024

I think the current api is not the best it could be, but popular public apis are very hard to change. Comparing the benefit and the potential damage due to breaking the API, I'm fine with closing the issue.

from mime-types.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.