Initial commit
This commit is contained in:
commit
b3a51a4115
10336 changed files with 2381973 additions and 0 deletions
39
node_modules/fast-check/lib/check/model/commands/CommandWrapper.js
generated
vendored
Normal file
39
node_modules/fast-check/lib/check/model/commands/CommandWrapper.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CommandWrapper = void 0;
|
||||
const stringify_1 = require("../../../utils/stringify");
|
||||
const symbols_1 = require("../../symbols");
|
||||
class CommandWrapper {
|
||||
constructor(cmd) {
|
||||
this.cmd = cmd;
|
||||
this.hasRan = false;
|
||||
if ((0, stringify_1.hasToStringMethod)(cmd)) {
|
||||
const method = cmd[stringify_1.toStringMethod];
|
||||
this[stringify_1.toStringMethod] = function toStringMethod() {
|
||||
return method.call(cmd);
|
||||
};
|
||||
}
|
||||
if ((0, stringify_1.hasAsyncToStringMethod)(cmd)) {
|
||||
const method = cmd[stringify_1.asyncToStringMethod];
|
||||
this[stringify_1.asyncToStringMethod] = function asyncToStringMethod() {
|
||||
return method.call(cmd);
|
||||
};
|
||||
}
|
||||
}
|
||||
check(m) {
|
||||
return this.cmd.check(m);
|
||||
}
|
||||
run(m, r) {
|
||||
this.hasRan = true;
|
||||
return this.cmd.run(m, r);
|
||||
}
|
||||
clone() {
|
||||
if ((0, symbols_1.hasCloneMethod)(this.cmd))
|
||||
return new CommandWrapper(this.cmd[symbols_1.cloneMethod]());
|
||||
return new CommandWrapper(this.cmd);
|
||||
}
|
||||
toString() {
|
||||
return this.cmd.toString();
|
||||
}
|
||||
}
|
||||
exports.CommandWrapper = CommandWrapper;
|
||||
Loading…
Add table
Add a link
Reference in a new issue