fase(1): shared domain building blocks
This commit is contained in:
14
dist/shared/domain/ValueObject.js
vendored
Normal file
14
dist/shared/domain/ValueObject.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ValueObject = void 0;
|
||||
class ValueObject {
|
||||
constructor(props) {
|
||||
this.props = Object.freeze(props);
|
||||
}
|
||||
equals(other) {
|
||||
if (!other)
|
||||
return false;
|
||||
return JSON.stringify(this.props) === JSON.stringify(other.props);
|
||||
}
|
||||
}
|
||||
exports.ValueObject = ValueObject;
|
||||
Reference in New Issue
Block a user