Skip to content

Commit

Permalink
feat: add module utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhtuan0409 committed Jan 30, 2024
1 parent d3db21e commit 7b9c214
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anduintransaction/rivendell",
"version": "0.5.1",
"version": "0.5.2",
"repository": {
"type": "git",
"url": "git+https://github.com/anduintransaction/rivendell.git"
Expand Down
15 changes: 15 additions & 0 deletions js/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,19 @@ export class Module {
this.generator = opts?.generator || ((_) => Promise.resolve([]));
this.waits = opts?.waits || [];
}

clone(newOpts: ModuleOpts) {
return new Module(this.name, {
deps: newOpts.deps || this.deps,
generator: newOpts.generator || this.generator,
waits: newOpts.waits || this.waits,
});
}

cloneGeneratorOnly() {
return this.clone({
deps: [],
waits: [],
});
}
}

0 comments on commit 7b9c214

Please sign in to comment.