"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get assert () {
        return assert;
    },
    get assertNonNull () {
        return assertNonNull;
    },
    get unwrap () {
        return unwrap;
    }
});
const assert = (condition, message, ...data)=>{
    if (!condition) {
        if (data.length > 0) {
            console.trace(data);
        }
        if (message instanceof Error) throw message;
        throw new Error(message || "Assertion failed");
    }
};
const assertNonNull = (value, message, ...data)=>{
    if (value == null) {
        if (data.length > 0) {
            console.trace(data);
        }
        if (message instanceof Error) throw message;
        throw new Error(message || "Assertion failed");
    }
    return value != null;
};
const unwrap = (val, message, ...data)=>{
    if (val == null) {
        if (data.length > 0) {
            console.trace(data);
        }
        if (message instanceof Error) throw message;
        throw new Error(message || "Value is empty");
    }
    return val;
};
