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/lib/index.esm.js
CHANGED
|
@@ -154,7 +154,7 @@ function __spreadArray(to, from, pack) {
|
|
|
154
154
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
var version = "3.6.
|
|
157
|
+
var version = "3.6.1";
|
|
158
158
|
|
|
159
159
|
var PostHogPersistedProperty;
|
|
160
160
|
(function (PostHogPersistedProperty) {
|
|
@@ -2446,14 +2446,10 @@ function matchProperty(property, propertyValues) {
|
|
|
2446
2446
|
|
|
2447
2447
|
case 'is_date_after':
|
|
2448
2448
|
case 'is_date_before':
|
|
2449
|
-
case 'is_relative_date_before':
|
|
2450
|
-
case 'is_relative_date_after':
|
|
2451
2449
|
{
|
|
2452
|
-
var parsedDate =
|
|
2450
|
+
var parsedDate = relativeDateParseForFeatureFlagMatching(String(value));
|
|
2453
2451
|
|
|
2454
|
-
if (
|
|
2455
|
-
parsedDate = relativeDateParseForFeatureFlagMatching(String(value));
|
|
2456
|
-
} else {
|
|
2452
|
+
if (parsedDate == null) {
|
|
2457
2453
|
parsedDate = convertToDateTime(value);
|
|
2458
2454
|
}
|
|
2459
2455
|
|
|
@@ -2463,7 +2459,7 @@ function matchProperty(property, propertyValues) {
|
|
|
2463
2459
|
|
|
2464
2460
|
var overrideDate = convertToDateTime(overrideValue);
|
|
2465
2461
|
|
|
2466
|
-
if (['is_date_before'
|
|
2462
|
+
if (['is_date_before'].includes(operator)) {
|
|
2467
2463
|
return overrideDate < parsedDate;
|
|
2468
2464
|
}
|
|
2469
2465
|
|
|
@@ -2614,7 +2610,7 @@ function convertToDateTime(value) {
|
|
|
2614
2610
|
}
|
|
2615
2611
|
|
|
2616
2612
|
function relativeDateParseForFeatureFlagMatching(value) {
|
|
2617
|
-
var regex =
|
|
2613
|
+
var regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
|
|
2618
2614
|
var match = value.match(regex);
|
|
2619
2615
|
var parsedDt = new Date(new Date().toISOString());
|
|
2620
2616
|
|
|
@@ -3185,7 +3181,7 @@ function (_super) {
|
|
|
3185
3181
|
|
|
3186
3182
|
PostHog.prototype.addLocalPersonAndGroupProperties = function (distinctId, groups, personProperties, groupProperties) {
|
|
3187
3183
|
var allPersonProperties = __assign({
|
|
3188
|
-
|
|
3184
|
+
distinct_id: distinctId
|
|
3189
3185
|
}, personProperties || {});
|
|
3190
3186
|
|
|
3191
3187
|
var allGroupProperties = {};
|