@thisisagile/easy
Version:
Straightforward library for building domain-driven microservice architectures
39 lines (37 loc) • 837 B
JavaScript
import {
Enum
} from "./chunk-JVDKV5HE.mjs";
import {
text
} from "./chunk-MCCIBDEH.mjs";
import {
toList
} from "./chunk-A7C3XND3.mjs";
import {
kebab
} from "./chunk-BDA5LB4S.mjs";
import {
isString
} from "./chunk-DEJ7A5PY.mjs";
// src/process/Scope.ts
var Scope = class _Scope extends Enum {
constructor(name, id = text(name).kebab, subs = toList()) {
super(name, id.toString());
this.name = name;
this.subs = subs;
}
for(item) {
return new _Scope(`${this.name} ${isString(item) ? text(item).title : item.name}`, kebab(`${this.id} ${isString(item) ? item : item.id}`));
}
combines(...scopes) {
this.subs.add(scopes);
return this;
}
expand() {
return this.subs.flatMap((s) => s.expand()).add(this).distinct();
}
};
export {
Scope
};
//# sourceMappingURL=chunk-RUCRIIYX.mjs.map