fase(3): crawling module domain and application

This commit is contained in:
debian
2026-03-04 16:32:09 -05:00
parent 4a58749048
commit 39c5313ba5
40 changed files with 1117 additions and 13 deletions

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Url = void 0;
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
const Result_1 = require("../../../../shared/domain/Result");
class Url extends ValueObject_1.ValueObject {
constructor(props) {
super(props);
}
static create(raw) {
if (!raw || raw.trim().length === 0) {
return (0, Result_1.Err)('URL must not be empty');
}
const trimmed = raw.trim();
if (!trimmed.startsWith('http://') && !trimmed.startsWith('https://')) {
return (0, Result_1.Err)('URL must start with http:// or https://');
}
return (0, Result_1.Ok)(new Url({ value: trimmed }));
}
toString() {
return this.props.value;
}
}
exports.Url = Url;