@hg-ts/domain 0.0.15
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/.eslintcache +1 -0
- package/.eslintrc.json +3 -0
- package/README.md +1 -0
- package/dist/base.aggregate.d.ts +9 -0
- package/dist/base.aggregate.d.ts.map +1 -0
- package/dist/base.aggregate.js +19 -0
- package/dist/base.aggregate.js.map +1 -0
- package/dist/base.entity.d.ts +7 -0
- package/dist/base.entity.d.ts.map +1 -0
- package/dist/base.entity.js +15 -0
- package/dist/base.entity.js.map +1 -0
- package/dist/identifiable.d.ts +4 -0
- package/dist/identifiable.d.ts.map +1 -0
- package/dist/identifiable.js +3 -0
- package/dist/identifiable.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist-esm/base.aggregate.d.ts +9 -0
- package/dist-esm/base.aggregate.d.ts.map +1 -0
- package/dist-esm/base.aggregate.js +15 -0
- package/dist-esm/base.aggregate.js.map +1 -0
- package/dist-esm/base.entity.d.ts +7 -0
- package/dist-esm/base.entity.d.ts.map +1 -0
- package/dist-esm/base.entity.js +11 -0
- package/dist-esm/base.entity.js.map +1 -0
- package/dist-esm/identifiable.d.ts +4 -0
- package/dist-esm/identifiable.d.ts.map +1 -0
- package/dist-esm/identifiable.js +2 -0
- package/dist-esm/identifiable.js.map +1 -0
- package/dist-esm/index.d.ts +5 -0
- package/dist-esm/index.d.ts.map +1 -0
- package/dist-esm/index.js +5 -0
- package/dist-esm/index.js.map +1 -0
- package/package.json +33 -0
- package/src/base.aggregate.ts +19 -0
- package/src/base.entity.ts +14 -0
- package/src/identifiable.ts +3 -0
- package/src/index.ts +5 -0
- package/tsconfig.esm.json +9 -0
- package/tsconfig.json +10 -0
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"/Volumes/Work/ts/hg/framework/packages/domain/src/base.aggregate.ts":"1","/Volumes/Work/ts/hg/framework/packages/domain/src/base.entity.ts":"2","/Volumes/Work/ts/hg/framework/packages/domain/src/identifiable.ts":"3","/Volumes/Work/ts/hg/framework/packages/domain/src/index.ts":"4"},{"size":503,"mtime":1665306262551,"results":"5","hashOfConfig":"6"},{"size":447,"mtime":1658012259547,"results":"7","hashOfConfig":"6"},{"size":65,"mtime":1658011993469,"results":"8","hashOfConfig":"6"},{"size":121,"mtime":1665300013439,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","suppressedMessages":"12","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"g5wte0",{"filePath":"13","messages":"14","suppressedMessages":"15","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","suppressedMessages":"18","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"19","messages":"20","suppressedMessages":"21","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/Work/ts/hg/framework/packages/domain/src/base.aggregate.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/domain/src/base.entity.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/domain/src/identifiable.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/domain/src/index.ts",[],[]]
|
package/.eslintrc.json
ADDED
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @hg/exception
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import type { Identifiable } from './identifiable';
|
|
3
|
+
declare const AGGREGATE_SYMBOL: unique symbol;
|
|
4
|
+
export declare abstract class BaseAggregate<IdType = string> extends BaseEntity<IdType> {
|
|
5
|
+
protected readonly [AGGREGATE_SYMBOL]: IdType;
|
|
6
|
+
protected constructor(params: Identifiable<IdType>);
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=base.aggregate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.aggregate.d.ts","sourceRoot":"","sources":["../src/base.aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,QAAA,MAAM,gBAAgB,eAA6B,CAAC;AAEpD,8BAAsB,aAAa,CAAC,MAAM,GAAG,MAAM,CAAE,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC9E,SAAS,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE9C,SAAS,aAAa,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;CAUlD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseAggregate = void 0;
|
|
4
|
+
const base_entity_1 = require("./base.entity");
|
|
5
|
+
const AGGREGATE_SYMBOL = Symbol('AGGREGATE_SYMBOL');
|
|
6
|
+
class BaseAggregate extends base_entity_1.BaseEntity {
|
|
7
|
+
[AGGREGATE_SYMBOL];
|
|
8
|
+
constructor(params) {
|
|
9
|
+
super(params);
|
|
10
|
+
Object.defineProperty(this, AGGREGATE_SYMBOL, {
|
|
11
|
+
value: params.id,
|
|
12
|
+
configurable: false,
|
|
13
|
+
enumerable: false,
|
|
14
|
+
writable: false,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.BaseAggregate = BaseAggregate;
|
|
19
|
+
//# sourceMappingURL=base.aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.aggregate.js","sourceRoot":"","sources":["../src/base.aggregate.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAG3C,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAEpD,MAAsB,aAA+B,SAAQ,wBAAkB;IAC3D,CAAC,gBAAgB,CAAC,CAAS;IAE9C,YAAsB,MAA4B;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE;YAC7C,KAAK,EAAE,MAAM,CAAC,EAAE;YAChB,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC,CAAC;IACJ,CAAC;CACD;AAbD,sCAaC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Identifiable } from './identifiable';
|
|
2
|
+
export declare abstract class BaseEntity<IdType = string> implements Identifiable<IdType> {
|
|
3
|
+
readonly id: IdType;
|
|
4
|
+
protected constructor(params: Identifiable<IdType>);
|
|
5
|
+
equals<T extends BaseEntity<IdType>>(entity: T): boolean;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=base.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.entity.d.ts","sourceRoot":"","sources":["../src/base.entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,8BAAsB,UAAU,CAAC,MAAM,GAAG,MAAM,CAAE,YAAW,YAAY,CAAC,MAAM,CAAC;IAChF,SAAgB,EAAE,EAAE,MAAM,CAAC;IAE3B,SAAS,aAAa,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;IAI3C,MAAM,CAAC,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO;CAI/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseEntity = void 0;
|
|
4
|
+
class BaseEntity {
|
|
5
|
+
id;
|
|
6
|
+
constructor(params) {
|
|
7
|
+
this.id = params.id;
|
|
8
|
+
}
|
|
9
|
+
equals(entity) {
|
|
10
|
+
return Object.getPrototypeOf(this).constructor === Object.getPrototypeOf(entity).constructor
|
|
11
|
+
&& this.id === entity.id;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.BaseEntity = BaseEntity;
|
|
15
|
+
//# sourceMappingURL=base.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.entity.js","sourceRoot":"","sources":["../src/base.entity.ts"],"names":[],"mappings":";;;AAEA,MAAsB,UAAU;IACf,EAAE,CAAS;IAE3B,YAAsB,MAA4B;QACjD,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,CAAC;IAEM,MAAM,CAA+B,MAAS;QACpD,OAAO,MAAM,CAAC,cAAc,CAAC,IAAI,CAAE,CAAC,WAAW,KAAK,MAAM,CAAC,cAAc,CAAC,MAAM,CAAE,CAAC,WAAW;eAC1F,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC;IAC3B,CAAC;CACD;AAXD,gCAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiable.d.ts","sourceRoot":"","sources":["../src/identifiable.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,CAAC,MAAM,GAAG,MAAM,IAAI;IACxC,EAAE,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiable.js","sourceRoot":"","sources":["../src/identifiable.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
require("@hg-ts/types");
|
|
5
|
+
tslib_1.__exportStar(require("./identifiable"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./base.aggregate"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./base.entity"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wBAAsB;AAEtB,yDAA+B;AAC/B,2DAAiC;AACjC,wDAA8B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import type { Identifiable } from './identifiable';
|
|
3
|
+
declare const AGGREGATE_SYMBOL: unique symbol;
|
|
4
|
+
export declare abstract class BaseAggregate<IdType = string> extends BaseEntity<IdType> {
|
|
5
|
+
protected readonly [AGGREGATE_SYMBOL]: IdType;
|
|
6
|
+
protected constructor(params: Identifiable<IdType>);
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=base.aggregate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.aggregate.d.ts","sourceRoot":"","sources":["../src/base.aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,QAAA,MAAM,gBAAgB,eAA6B,CAAC;AAEpD,8BAAsB,aAAa,CAAC,MAAM,GAAG,MAAM,CAAE,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC9E,SAAS,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE9C,SAAS,aAAa,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;CAUlD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
const AGGREGATE_SYMBOL = Symbol('AGGREGATE_SYMBOL');
|
|
3
|
+
export class BaseAggregate extends BaseEntity {
|
|
4
|
+
[AGGREGATE_SYMBOL];
|
|
5
|
+
constructor(params) {
|
|
6
|
+
super(params);
|
|
7
|
+
Object.defineProperty(this, AGGREGATE_SYMBOL, {
|
|
8
|
+
value: params.id,
|
|
9
|
+
configurable: false,
|
|
10
|
+
enumerable: false,
|
|
11
|
+
writable: false,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=base.aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.aggregate.js","sourceRoot":"","sources":["../src/base.aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAEpD,MAAM,OAAgB,aAA+B,SAAQ,UAAkB;IAC3D,CAAC,gBAAgB,CAAC,CAAS;IAE9C,YAAsB,MAA4B;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE;YAC7C,KAAK,EAAE,MAAM,CAAC,EAAE;YAChB,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Identifiable } from './identifiable';
|
|
2
|
+
export declare abstract class BaseEntity<IdType = string> implements Identifiable<IdType> {
|
|
3
|
+
readonly id: IdType;
|
|
4
|
+
protected constructor(params: Identifiable<IdType>);
|
|
5
|
+
equals<T extends BaseEntity<IdType>>(entity: T): boolean;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=base.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.entity.d.ts","sourceRoot":"","sources":["../src/base.entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,8BAAsB,UAAU,CAAC,MAAM,GAAG,MAAM,CAAE,YAAW,YAAY,CAAC,MAAM,CAAC;IAChF,SAAgB,EAAE,EAAE,MAAM,CAAC;IAE3B,SAAS,aAAa,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;IAI3C,MAAM,CAAC,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO;CAI/D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class BaseEntity {
|
|
2
|
+
id;
|
|
3
|
+
constructor(params) {
|
|
4
|
+
this.id = params.id;
|
|
5
|
+
}
|
|
6
|
+
equals(entity) {
|
|
7
|
+
return Object.getPrototypeOf(this).constructor === Object.getPrototypeOf(entity).constructor
|
|
8
|
+
&& this.id === entity.id;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=base.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.entity.js","sourceRoot":"","sources":["../src/base.entity.ts"],"names":[],"mappings":"AAEA,MAAM,OAAgB,UAAU;IACf,EAAE,CAAS;IAE3B,YAAsB,MAA4B;QACjD,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,CAAC;IAEM,MAAM,CAA+B,MAAS;QACpD,OAAO,MAAM,CAAC,cAAc,CAAC,IAAI,CAAE,CAAC,WAAW,KAAK,MAAM,CAAC,cAAc,CAAC,MAAM,CAAE,CAAC,WAAW;eAC1F,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC;IAC3B,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiable.d.ts","sourceRoot":"","sources":["../src/identifiable.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,CAAC,MAAM,GAAG,MAAM,IAAI;IACxC,EAAE,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiable.js","sourceRoot":"","sources":["../src/identifiable.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hg-ts/domain",
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist-esm/index.js",
|
|
6
|
+
"repository": "git@gitlab.com:hyper-graph/framework.git",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepack": "yarn build && yarn lint",
|
|
9
|
+
"build": "hg build",
|
|
10
|
+
"build:dev": "hg build:dev",
|
|
11
|
+
"lint": "hg lint",
|
|
12
|
+
"lint:fix": "hg lint:fix"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@hg-ts-config/eslint-config": "0.0.15",
|
|
16
|
+
"@hg-ts-config/typescript": "0.0.15",
|
|
17
|
+
"@hg-ts/cli": "0.0.15",
|
|
18
|
+
"@hg-ts/types": "0.0.15",
|
|
19
|
+
"@types/node": "18.0.3",
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "5.33.1",
|
|
21
|
+
"@typescript-eslint/parser": "5.33.1",
|
|
22
|
+
"eslint": "8.24.0",
|
|
23
|
+
"eslint-formatter-codeframe": "7.32.1",
|
|
24
|
+
"reflect-metadata": "0.1.13",
|
|
25
|
+
"tsc-watch": "5.0.3",
|
|
26
|
+
"tslib": "2.4.0",
|
|
27
|
+
"typescript": "4.7.4"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"reflect-metadata": "*",
|
|
31
|
+
"tslib": "*"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import type { Identifiable } from './identifiable';
|
|
3
|
+
|
|
4
|
+
const AGGREGATE_SYMBOL = Symbol('AGGREGATE_SYMBOL');
|
|
5
|
+
|
|
6
|
+
export abstract class BaseAggregate<IdType = string> extends BaseEntity<IdType> {
|
|
7
|
+
protected readonly [AGGREGATE_SYMBOL]: IdType;
|
|
8
|
+
|
|
9
|
+
protected constructor(params: Identifiable<IdType>) {
|
|
10
|
+
super(params);
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(this, AGGREGATE_SYMBOL, {
|
|
13
|
+
value: params.id,
|
|
14
|
+
configurable: false,
|
|
15
|
+
enumerable: false,
|
|
16
|
+
writable: false,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Identifiable } from './identifiable';
|
|
2
|
+
|
|
3
|
+
export abstract class BaseEntity<IdType = string> implements Identifiable<IdType> {
|
|
4
|
+
public readonly id: IdType;
|
|
5
|
+
|
|
6
|
+
protected constructor(params: Identifiable<IdType>) {
|
|
7
|
+
this.id = params.id;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public equals<T extends BaseEntity<IdType>>(entity: T): boolean {
|
|
11
|
+
return Object.getPrototypeOf(this)!.constructor === Object.getPrototypeOf(entity)!.constructor
|
|
12
|
+
&& this.id === entity.id;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/index.ts
ADDED