fase(3): crawling module domain and application
This commit is contained in:
20
dist/modules/crawling/domain/value-objects/Selector.js
vendored
Normal file
20
dist/modules/crawling/domain/value-objects/Selector.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Selector = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
const Result_1 = require("../../../../shared/domain/Result");
|
||||
class Selector extends ValueObject_1.ValueObject {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
static create(raw) {
|
||||
if (!raw || raw.trim().length === 0) {
|
||||
return (0, Result_1.Err)('Selector must not be empty');
|
||||
}
|
||||
return (0, Result_1.Ok)(new Selector({ value: raw.trim() }));
|
||||
}
|
||||
toString() {
|
||||
return this.props.value;
|
||||
}
|
||||
}
|
||||
exports.Selector = Selector;
|
||||
Reference in New Issue
Block a user