ddd-node 29.8.0 → 30.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/base/domain.d.ts CHANGED
@@ -9,15 +9,13 @@ export declare class Domain {
9
9
  export declare class DomainMap extends Map<DomainName, Domain> {
10
10
  }
11
11
  export declare class DomainManager {
12
- static _instance: DomainManager;
12
+ private static _instance;
13
13
  static instance(): DomainManager;
14
14
  private constructor();
15
15
  private _domains;
16
16
  isDefaultDomain(domain: Domain): boolean;
17
17
  hasDomain(domainName: DomainName): boolean;
18
- getDomain(): Domain;
19
- getDomain(domainName: typeof DEFAULT_DOMAIN): Domain;
20
- getDomain(domainName: DomainName): Domain | undefined;
18
+ getDomain(domainName?: DomainName): Domain;
21
19
  addDomain(domain: Domain): void;
22
20
  deleteDomain(domainName: DomainName): void;
23
21
  }
package/base/domain.js CHANGED
@@ -31,10 +31,12 @@ class DomainManager {
31
31
  return this._domains.has(domainName);
32
32
  }
33
33
  getDomain(domainName) {
34
- if (domainName)
34
+ if (domainName) {
35
+ if (!this.hasDomain(domainName))
36
+ this.addDomain(new Domain(domainName));
35
37
  return this._domains.get(domainName);
36
- if (!domainName)
37
- return this._domains.get(exports.DEFAULT_DOMAIN);
38
+ }
39
+ return this.getDomain(exports.DEFAULT_DOMAIN);
38
40
  }
39
41
  addDomain(domain) {
40
42
  if (this.hasDomain(domain.name))
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"ddd-node","version":"29.8.0","description":"Domain Driven Design base for NodeJs","type":"commonjs","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"https://github.com/nqd881/ddd-node"},"keywords":["ddd","ddd-node","ddd-base","ddd-ts","ddd-js"],"author":"Quoc Dai","license":"ISC","devDependencies":{"@types/chai":"^4.3.16","@types/lodash":"^4.14.200","@types/mocha":"^10.0.6","@types/uuid":"^9.0.6","chai":"^5.1.1","chai-deep-match":"^1.2.1","ddd-node":"file:dist","mocha":"^10.4.0","tsconfig-paths":"^4.2.0","typescript":"^5.2.2"},"dependencies":{"lodash":"^4.17.21","reflect-metadata":"^0.1.13","ts-node":"^10.9.2","tsc-alias":"^1.8.8","type-fest":"^4.20.1","uuid":"^9.0.1"}}
1
+ {"name":"ddd-node","version":"30.1.0","description":"Domain Driven Design base for NodeJs","type":"commonjs","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"https://github.com/nqd881/ddd-node"},"keywords":["ddd","ddd-node","ddd-base","ddd-ts","ddd-js"],"author":"Quoc Dai","license":"ISC","devDependencies":{"@types/chai":"^4.3.16","@types/lodash":"^4.14.200","@types/mocha":"^10.0.6","@types/uuid":"^9.0.6","chai":"^5.1.1","chai-deep-match":"^1.2.1","ddd-node":"file:dist","mocha":"^10.4.0","tsconfig-paths":"^4.2.0","typescript":"^5.2.2"},"dependencies":{"lodash":"^4.17.21","reflect-metadata":"^0.1.13","ts-node":"^10.9.2","tsc-alias":"^1.8.8","type-fest":"^4.20.1","uuid":"^9.0.1"}}