@nanotime/http-please
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -7,3 +7,3 @@ var p = Object.defineProperty; | ||
}; | ||
var l = (r, t, e) => (m(r, t, "read from private field"), e ? e.call(r) : t.get(r)), f = (r, t, e) => { | ||
var h = (r, t, e) => (m(r, t, "read from private field"), e ? e.call(r) : t.get(r)), f = (r, t, e) => { | ||
if (t.has(r)) | ||
@@ -13,3 +13,3 @@ throw TypeError("Cannot add the same private member more than once"); | ||
}; | ||
var u; | ||
var a; | ||
class w { | ||
@@ -20,3 +20,3 @@ constructor({ url: t, options: e, resolver: s = "json", plugins: n }) { | ||
c(this, "resolver"); | ||
f(this, u, ["get", "post", "put", "delete", "fetch", "formatUrl"]); | ||
f(this, a, ["get", "post", "put", "delete", "fetch", "formatUrl"]); | ||
this.url = new URL(t), this.options = e, this.resolver = s, this.registerPlugins(n); | ||
@@ -33,9 +33,12 @@ } | ||
let s; | ||
if (Object.keys(e()).some((i) => (s = i, l(this, u).find((a) => a === i)))) | ||
if (Object.keys(e()).some((i) => (s = i, h(this, a).find((u) => u === i)))) | ||
throw new Error(`${s} is already registered`); | ||
l(this, u).push(s); | ||
h(this, a).push(s); | ||
}); | ||
} | ||
get plugins() { | ||
return h(this, a); | ||
} | ||
} | ||
u = new WeakMap(); | ||
a = new WeakMap(); | ||
class d { | ||
@@ -84,4 +87,4 @@ constructor() { | ||
for (; i.length; ) { | ||
const [a, h] = i.shift(); | ||
e = o.then(a, h); | ||
const [u, l] = i.shift(); | ||
e = o.then(u, l); | ||
} | ||
@@ -202,3 +205,3 @@ return e; | ||
}) { | ||
const n = new w({ url: t, options: r, resolver: e, plugins: s }), o = s.reduce((a, h) => ({ ...a, ...h() }), {}); | ||
const n = new w({ url: t, options: r, resolver: e, plugins: s }), o = s.reduce((u, l) => ({ ...u, ...l() }), {}); | ||
return { | ||
@@ -205,0 +208,0 @@ ...n, |
{ | ||
"name": "@nanotime/http-please", | ||
"private": false, | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"type": "module", | ||
@@ -21,3 +21,3 @@ "main": "./dist/index.js", | ||
"preview": "vite preview", | ||
"test": "vitest run", | ||
"test": "vitest run --coverage", | ||
"test-watch": "vitest", | ||
@@ -35,2 +35,4 @@ "prepare": "husky install", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"@vitest/coverage-istanbul": "^0.34.2", | ||
"@vitest/ui": "^0.34.2", | ||
"better-commits": "^1.5.1", | ||
@@ -37,0 +39,0 @@ "eslint": "^8.45.0", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
10058
20
4
214