Skip to content

Commit ba7951c

Browse files
committed
CR: avoiding mutation of the argument in nest() method.
1 parent ec2af16 commit ba7951c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

express-zod-api/src/endpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export type Handler<IN, OUT, OPT> = (params: {
4444
export abstract class AbstractEndpoint {
4545
/** @desc Enables nested routes within the path assigned to the subject */
4646
public nest(routing: Routing): Routing {
47-
return Object.assign(routing, { "": this });
47+
return { ...routing, "": this };
4848
}
4949
/** @desc Marks the route as deprecated (makes a copy of the endpoint) */
5050
public abstract deprecated(): this;

0 commit comments

Comments
 (0)