"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.warning = warning;
exports.note = note;
exports.resetWarned = resetWarned;
exports.call = call;
exports.warningOnce = warningOnce;
exports.noteOnce = noteOnce;
let warned = {};
function warning(valid, message) {
    // Support uglify
    if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
        // eslint-disable-next-line no-console
        console.error(`Warning: ${message}`);
    }
}
function note(valid, message) {
    // Support uglify
    if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
        // eslint-disable-next-line no-console
        console.warn(`Note: ${message}`);
    }
}
function resetWarned() {
    warned = {};
}
function call(method, valid, message) {
    if (!valid && !warned[message]) {
        method(false, message);
        warned[message] = true;
    }
}
function warningOnce(valid, message) {
    call(warning, valid, message);
}
function noteOnce(valid, message) {
    call(note, valid, message);
}
exports.default = warningOnce;
//# sourceMappingURL=warning.js.map