Skip to content

Commit

Permalink
fix: copy getters when cloning
Browse files Browse the repository at this point in the history
鈥s well as non-enumerable properties
  • Loading branch information
aleclarson committed Sep 23, 2022
1 parent 298eb84 commit 79dbb88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/postgres/query.ts
Expand Up @@ -91,7 +91,7 @@ export abstract class Query<Props extends object | null = any> {

protected clone() {
const clone = Object.create(this.constructor.prototype)
Object.assign(clone, this)
Object.defineProperties(clone, Object.getOwnPropertyDescriptors(this))
clone.nodes = this.nodes.slice(0, this.position + 1)
clone.nodes[this.position] = {
...clone.nodes[this.position],
Expand Down

0 comments on commit 79dbb88

Please sign in to comment.