posthog-node 3.6.0 → 3.6.1
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/CHANGELOG.md +4 -0
- package/lib/index.cjs.js +6 -10
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +6 -10
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/feature-flags.ts +5 -9
- package/src/posthog-node.ts +1 -1
- package/test/feature-flags.spec.ts +14 -19
- package/test/posthog-node.spec.ts +7 -7
package/CHANGELOG.md
CHANGED
package/lib/index.cjs.js
CHANGED
|
@@ -158,7 +158,7 @@ function __spreadArray(to, from, pack) {
|
|
|
158
158
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
var version = "3.6.
|
|
161
|
+
var version = "3.6.1";
|
|
162
162
|
|
|
163
163
|
var PostHogPersistedProperty;
|
|
164
164
|
(function (PostHogPersistedProperty) {
|
|
@@ -2450,14 +2450,10 @@ function matchProperty(property, propertyValues) {
|
|
|
2450
2450
|
|
|
2451
2451
|
case 'is_date_after':
|
|
2452
2452
|
case 'is_date_before':
|
|
2453
|
-
case 'is_relative_date_before':
|
|
2454
|
-
case 'is_relative_date_after':
|
|
2455
2453
|
{
|
|
2456
|
-
var parsedDate =
|
|
2454
|
+
var parsedDate = relativeDateParseForFeatureFlagMatching(String(value));
|
|
2457
2455
|
|
|
2458
|
-
if (
|
|
2459
|
-
parsedDate = relativeDateParseForFeatureFlagMatching(String(value));
|
|
2460
|
-
} else {
|
|
2456
|
+
if (parsedDate == null) {
|
|
2461
2457
|
parsedDate = convertToDateTime(value);
|
|
2462
2458
|
}
|
|
2463
2459
|
|
|
@@ -2467,7 +2463,7 @@ function matchProperty(property, propertyValues) {
|
|
|
2467
2463
|
|
|
2468
2464
|
var overrideDate = convertToDateTime(overrideValue);
|
|
2469
2465
|
|
|
2470
|
-
if (['is_date_before'
|
|
2466
|
+
if (['is_date_before'].includes(operator)) {
|
|
2471
2467
|
return overrideDate < parsedDate;
|
|
2472
2468
|
}
|
|
2473
2469
|
|
|
@@ -2618,7 +2614,7 @@ function convertToDateTime(value) {
|
|
|
2618
2614
|
}
|
|
2619
2615
|
|
|
2620
2616
|
function relativeDateParseForFeatureFlagMatching(value) {
|
|
2621
|
-
var regex =
|
|
2617
|
+
var regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
|
|
2622
2618
|
var match = value.match(regex);
|
|
2623
2619
|
var parsedDt = new Date(new Date().toISOString());
|
|
2624
2620
|
|
|
@@ -3189,7 +3185,7 @@ function (_super) {
|
|
|
3189
3185
|
|
|
3190
3186
|
PostHog.prototype.addLocalPersonAndGroupProperties = function (distinctId, groups, personProperties, groupProperties) {
|
|
3191
3187
|
var allPersonProperties = __assign({
|
|
3192
|
-
|
|
3188
|
+
distinct_id: distinctId
|
|
3193
3189
|
}, personProperties || {});
|
|
3194
3190
|
|
|
3195
3191
|
var allGroupProperties = {};
|