rrweb
Version:
record and replay the web
31 lines (25 loc) • 735 B
JavaScript
var rrwebSequentialIdRecord = (function (exports) {
'use strict';
const defaultOptions = {
key: "_sid"
};
const PLUGIN_NAME = "rrweb/sequential-id@1";
const getRecordSequentialIdPlugin = (options) => {
const _options = options ? Object.assign({}, defaultOptions, options) : defaultOptions;
let id = 0;
return {
name: PLUGIN_NAME,
eventProcessor(event) {
Object.assign(event, {
[_options.key]: ++id
});
return event;
},
options: _options
};
};
exports.PLUGIN_NAME = PLUGIN_NAME;
exports.getRecordSequentialIdPlugin = getRecordSequentialIdPlugin;
Object.defineProperty(exports, '__esModule', { value: true });
return exports;
})({});