github elbywan/wretch 2.7.1

latest releases: 2.11.0, 2.10.0, 2.9.1...
12 months ago

2.7.1 (2023-11-19)

🐛 Bug fix(es)

  • Fix passing a HeadersInit (Header / array) argument to headers() (f32845a), closes #205
const headers1 = new Headers({ "hello": "world" });
const headers2 = new Headers({ "bonjour": "le monde" });
const headers3 = { "hola": "mundo " };
const headers4 = [["hallo", "welt"]]

let w = wretch().headers(headers1);
console.log(w._options.headers);
// Object { hello: "world" }
w = w.headers(headers2);
console.log(w._options.headers);
// Object { hello: "world", bonjour: "le monde" }
w = w.headers(headers3);
console.log(w._options.headers);
// Object { hello: "world", bonjour: "le monde", hola: "mundo " }
w = w.headers(headers4);
console.log(w._options.headers);
// Object { hello: "world", bonjour: "le monde", hola: "mundo ", hallo: "welt" }

⬆️ Version update(s)

  • Bump @babel/traverse from 7.19.4 to 7.23.2 (922005e)
  • Upgrade dependencies (d774826)

Don't miss a new wretch release

NewReleases is sending notifications on new releases.