posthog-js 1.81.3 → 1.82.0
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/README.md +1 -1
- package/dist/array.full.js +2 -2
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +2 -2
- package/dist/array.js.map +1 -1
- package/dist/es.js +2 -2
- package/dist/es.js.map +1 -1
- package/dist/module.d.ts +11 -7
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/posthog-core.js +7 -1
- package/lib/src/posthog-core.js.map +1 -1
- package/lib/src/posthog-surveys-types.d.ts +2 -0
- package/lib/src/posthog-surveys-types.js.map +1 -1
- package/lib/src/posthog-surveys.d.ts +2 -1
- package/lib/src/posthog-surveys.js +10 -3
- package/lib/src/posthog-surveys.js.map +1 -1
- package/lib/src/utils.d.ts +2 -0
- package/lib/src/utils.js +14 -0
- package/lib/src/utils.js.map +1 -1
- package/package.json +1 -1
package/lib/package.json
CHANGED
package/lib/src/posthog-core.js
CHANGED
|
@@ -35,7 +35,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
35
35
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
36
|
};
|
|
37
37
|
import Config from './config';
|
|
38
|
-
import { _copyAndTruncateStrings, _each, _eachArray, _extend, _info, _isArray, _isBlockedUA, _isObject, _isUndefined, _register_event, _safewrap_class, document, logger, userAgent, window, } from './utils';
|
|
38
|
+
import { _copyAndTruncateStrings, _each, _eachArray, _extend, _info, _isArray, _isBlockedUA, _isEmptyObject, _isObject, _isUndefined, _register_event, _safewrap_class, document, logger, userAgent, window, } from './utils';
|
|
39
39
|
import { autocapture } from './autocapture';
|
|
40
40
|
import { PostHogFeatureFlags } from './posthog-featureflags';
|
|
41
41
|
import { PostHogPersistence } from './posthog-persistence';
|
|
@@ -752,6 +752,12 @@ var PostHog = /** @class */ (function () {
|
|
|
752
752
|
}
|
|
753
753
|
data = _copyAndTruncateStrings(data, options._noTruncate ? null : this.config.properties_string_max_length);
|
|
754
754
|
data.timestamp = options.timestamp || new Date();
|
|
755
|
+
// Top-level $set overriding values from the one from properties is taken from the plugin-server normalizeEvent
|
|
756
|
+
// This doesn't handle $set_once, because posthog-people doesn't either
|
|
757
|
+
var finalSet = __assign(__assign({}, data.properties['$set']), data['$set']);
|
|
758
|
+
if (!_isEmptyObject(finalSet)) {
|
|
759
|
+
this.setPersonPropertiesForFlags(finalSet);
|
|
760
|
+
}
|
|
755
761
|
if (this.config.debug) {
|
|
756
762
|
logger.log('PostHog.js send', data);
|
|
757
763
|
}
|