@posthog/rrweb-record 0.0.41 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,11 @@
1
1
  import { record } from '@posthog/rrweb';
2
+ import { resetMaxDepthState } from '@posthog/rrweb';
3
+ import { wasMaxDepthReached } from '@posthog/rrweb';
2
4
 
3
5
  export { record }
4
6
 
7
+ export { resetMaxDepthState }
8
+
9
+ export { wasMaxDepthReached }
10
+
5
11
  export { }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  import { record } from '@posthog/rrweb';
2
+ import { resetMaxDepthState } from '@posthog/rrweb';
3
+ import { wasMaxDepthReached } from '@posthog/rrweb';
2
4
 
3
5
  export { record }
4
6
 
7
+ export { resetMaxDepthState }
8
+
9
+ export { wasMaxDepthReached }
10
+
5
11
  export { }
@@ -1138,6 +1138,14 @@ function slimDOMExcluded(sn, slimDOMOptions) {
1138
1138
  }
1139
1139
  const DEFAULT_MAX_DEPTH = 50;
1140
1140
  let _maxDepthWarned = false;
1141
+ let _maxDepthReached = false;
1142
+ function wasMaxDepthReached() {
1143
+ return _maxDepthReached;
1144
+ }
1145
+ function resetMaxDepthState() {
1146
+ _maxDepthReached = false;
1147
+ _maxDepthWarned = false;
1148
+ }
1141
1149
  function serializeNodeWithId(n2, options) {
1142
1150
  const {
1143
1151
  doc,
@@ -1168,6 +1176,7 @@ function serializeNodeWithId(n2, options) {
1168
1176
  let { needsMask } = options;
1169
1177
  let { preserveWhiteSpace = true } = options;
1170
1178
  if (depth >= maxDepth) {
1179
+ _maxDepthReached = true;
1171
1180
  if (!_maxDepthWarned) {
1172
1181
  _maxDepthWarned = true;
1173
1182
  console.warn(
@@ -13195,4 +13204,6 @@ const { addCustomEvent } = record;
13195
13204
  const { freezePage } = record;
13196
13205
  const { takeFullSnapshot } = record;
13197
13206
  exports.record = record;
13207
+ exports.resetMaxDepthState = resetMaxDepthState;
13208
+ exports.wasMaxDepthReached = wasMaxDepthReached;
13198
13209
  //# sourceMappingURL=rrweb-record.cjs.map