first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
(function() {
var Reply;
Reply = (function() {
Reply.ERROR = 'ERROR';
Reply.OK = 'OK';
function Reply(type, value) {
this.type = type;
this.value = value;
}
Reply.prototype.isError = function() {
return this.type === Reply.ERROR;
};
Reply.prototype.toError = function() {
if (!this.isError()) {
throw new Error('toError() cannot be called for non-errors');
}
return new Error(this.value);
};
return Reply;
})();
module.exports = Reply;
}).call(this);