Skip to content

Commit

Permalink
feat: some clone methods
Browse files Browse the repository at this point in the history
  • Loading branch information
brigand committed Dec 25, 2019
1 parent 4a205ab commit 336c4e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cond/And.js
Expand Up @@ -18,6 +18,10 @@ class And extends Condition {
impl(...args) {
return (this.first.impl(...args) && this.second.impl(...args)) || null;
}

clone() {
return new And(this.first, this.second);
}
}

module.exports = And.factory;
4 changes: 4 additions & 0 deletions src/cond/AndThen.js
Expand Up @@ -22,6 +22,10 @@ class AndThen extends Condition {
return null;
}
}

clone() {
return new AndThen(this.first, this.second);
}
}

module.exports = AndThen.factory;

0 comments on commit 336c4e6

Please sign in to comment.