fase(6): fuzzing module complete
This commit is contained in:
20
dist/modules/fuzzing/domain/value-objects/FuzzStrategy.js
vendored
Normal file
20
dist/modules/fuzzing/domain/value-objects/FuzzStrategy.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FuzzStrategy = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class FuzzStrategy extends ValueObject_1.ValueObject {
|
||||
static empty() { return new FuzzStrategy({ value: 'empty' }); }
|
||||
static oversized() { return new FuzzStrategy({ value: 'oversized' }); }
|
||||
static specialChars() { return new FuzzStrategy({ value: 'special_chars' }); }
|
||||
static typeMismatch() { return new FuzzStrategy({ value: 'type_mismatch' }); }
|
||||
static boundary() { return new FuzzStrategy({ value: 'boundary' }); }
|
||||
static fromString(s) {
|
||||
if (!FuzzStrategy.ALL.includes(s)) {
|
||||
throw new Error(`Invalid fuzz strategy: ${s}`);
|
||||
}
|
||||
return new FuzzStrategy({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
}
|
||||
exports.FuzzStrategy = FuzzStrategy;
|
||||
FuzzStrategy.ALL = ['empty', 'oversized', 'special_chars', 'type_mismatch', 'boundary'];
|
||||
Reference in New Issue
Block a user