"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Result", {
    enumerable: true,
    get: function() {
        return Result;
    }
});
const RESULT = Symbol("result");
const ERR = Symbol("err");
(function(Result) {
    Result.unwrap = (result)=>{
        if (result[RESULT]) {
            return result.value;
        } else {
            throw result[ERR];
        }
    };
    Result.isOk = (result)=>{
        return result[RESULT] === true;
    };
    Result.isErr = (result)=>{
        return result[RESULT] === false;
    };
    Result.ok = (value)=>{
        return {
            [RESULT]: true,
            value
        };
    };
    Result.err = (error)=>{
        return {
            [RESULT]: false,
            [ERR]: error
        };
    };
})(Result || (Result = {}));
var Result;
