Giter Club home page Giter Club logo

Comments (3)

strikeentco avatar strikeentco commented on August 15, 2024 1

Hello!
It looks like, a file-type has changed a lot in the years since the last mime-kind update.. :D

I will update a multi-part later this week. And probably, a mime-kind will be deprecated.

Thanks!)

from mime-kind.

strikeentco avatar strikeentco commented on August 15, 2024 1

Hello, @pluma4345 !

Just released new 4.0.0 versions of mime-kind and multi-part.

There is only one breaking change: there are no more sync versions.

For arangojs it means, that you should change toForm function: https://github.com/arangodb/arangojs/blob/main/src/lib/multipart.ts#L38
to something like this:

export async function toForm(fields: Fields): Promise<MultipartRequest> {
  const form = new Multipart();
  for (const key of Object.keys(fields)) {
    let value = fields[key];
    if (value === undefined) continue;
    if (
      !(value instanceof Readable) &&
      !(value instanceof global.Buffer) &&
      (typeof value === "object" || typeof value === "function")
    ) {
      value = JSON.stringify(value);
    }
    form.append(key, value);
  }
  const body = await form.buffer();
  return { body, header: form.getHeaders(false) };
}

That's it! :)

Thank you.

from mime-kind.

pluma4345 avatar pluma4345 commented on August 15, 2024 1

Hi @strikeentco! Thanks for the prompt reaction and the detailed suggestion. I'll incorporate the changes in the next release.

from mime-kind.

Related Issues (2)

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.