"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    byteCount: function() {
        return byteCount;
    },
    formatKB: function() {
        return formatKB;
    },
    sizeKB: function() {
        return sizeKB;
    }
});
function byteCount(s) {
    return encodeURI(s).split(/%..|./).length - 1;
}
function sizeKB(object) {
    const serializedObject = JSON.stringify(object);
    const bytesCount = byteCount(serializedObject);
    return bytesCount / 1024;
}
function formatKB(object) {
    const size = sizeKB(object);
    return `${size.toFixed(2)} KB`;
}

//# sourceMappingURL=metric.utils.js.map