@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.mjs
CHANGED
|
@@ -4208,9 +4208,13 @@ var ApiClient = class {
|
|
|
4208
4208
|
url = url.replace(token, encodeURIComponent(String(value)));
|
|
4209
4209
|
}
|
|
4210
4210
|
}
|
|
4211
|
-
const
|
|
4212
|
-
(
|
|
4213
|
-
);
|
|
4211
|
+
const templatePlaceholders = Array.from(
|
|
4212
|
+
endpoint.path.matchAll(/:([A-Za-z0-9_]+)/g)
|
|
4213
|
+
).map((m) => m[1]);
|
|
4214
|
+
const missingTokens = templatePlaceholders.filter((name) => {
|
|
4215
|
+
const v = path ? path[name] : void 0;
|
|
4216
|
+
return v === void 0 || v === null;
|
|
4217
|
+
});
|
|
4214
4218
|
if (missingTokens.length > 0) {
|
|
4215
4219
|
throw this.createError({
|
|
4216
4220
|
message: `Missing path params for placeholders: ${missingTokens.join(
|