@palbase/backend 9.0.0 → 9.0.1

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 CHANGED
@@ -469,6 +469,11 @@ function recordThrows(target, fnName, throws) {
469
469
  // src/decorators/methods.ts
470
470
  function makeMethodDecorator(method) {
471
471
  return function(subpath, options = {}) {
472
+ if (typeof subpath !== "string") {
473
+ throw new Error(
474
+ `@${method[0]}${method.slice(1).toLowerCase()}(subpath) expects a string subpath, got ${typeof subpath}.` + (method === "QUERY" ? " If this is a zod schema on a method parameter: the query-string param decorator was renamed @QueryParams(schema) in @palbase/backend 9.0.0." : "")
475
+ );
476
+ }
472
477
  return function(target, propertyKey) {
473
478
  recordRoute(target, String(propertyKey), method, subpath, options);
474
479
  };