@tahanabavi/typefetch 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4231,9 +4231,13 @@ var ApiClient = class {
|
|
|
4231
4231
|
url = url.replace(token, encodeURIComponent(String(value)));
|
|
4232
4232
|
}
|
|
4233
4233
|
}
|
|
4234
|
-
const
|
|
4235
|
-
(
|
|
4236
|
-
);
|
|
4234
|
+
const templatePlaceholders = Array.from(
|
|
4235
|
+
endpoint.path.matchAll(/:([A-Za-z0-9_]+)/g)
|
|
4236
|
+
).map((m) => m[1]);
|
|
4237
|
+
const missingTokens = templatePlaceholders.filter((name) => {
|
|
4238
|
+
const v = path ? path[name] : void 0;
|
|
4239
|
+
return v === void 0 || v === null;
|
|
4240
|
+
});
|
|
4237
4241
|
if (missingTokens.length > 0) {
|
|
4238
4242
|
throw this.createError({
|
|
4239
4243
|
message: `Missing path params for placeholders: ${missingTokens.join(
|