@posthog/convex 2.1.2 → 2.1.4
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.1.
|
|
1
|
+
export declare const version = "2.1.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '2.1.
|
|
1
|
+
export const version = '2.1.4';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://github.com/PostHog/posthog-js/issues"
|
|
12
12
|
},
|
|
13
13
|
"author": "PostHog Inc.",
|
|
14
|
-
"version": "2.1.
|
|
14
|
+
"version": "2.1.4",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"keywords": [
|
|
17
17
|
"convex",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"types": "./dist/client/index.d.ts",
|
|
49
49
|
"module": "./dist/client/index.js",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@posthog/core": "^1.
|
|
52
|
-
"posthog-node": "^5.51.
|
|
51
|
+
"@posthog/core": "^1.50.0",
|
|
52
|
+
"posthog-node": "^5.51.5"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@edge-runtime/vm": "^5.0.0",
|
|
@@ -200,7 +200,7 @@ describe('LocalFeatureFlagEvaluator', () => {
|
|
|
200
200
|
expect(await evaluator.getFeatureFlag('not-pro', 'user', {}, { plan: 'free' })).toBe(true)
|
|
201
201
|
})
|
|
202
202
|
|
|
203
|
-
test('is_not_set condition
|
|
203
|
+
test('is_not_set condition is inconclusive when the property is omitted', async () => {
|
|
204
204
|
const evaluator = new LocalFeatureFlagEvaluator(
|
|
205
205
|
definitions([
|
|
206
206
|
makeFlag('only-anon', {
|
|
@@ -215,9 +215,7 @@ describe('LocalFeatureFlagEvaluator', () => {
|
|
|
215
215
|
}),
|
|
216
216
|
])
|
|
217
217
|
)
|
|
218
|
-
|
|
219
|
-
expect(await evaluator.getFeatureFlag('only-anon', 'user', {}, {})).toBe(true)
|
|
220
|
-
// Key present → property IS set → flag does not match.
|
|
218
|
+
expect(await evaluator.getFeatureFlag('only-anon', 'user', {}, {})).toBeUndefined()
|
|
221
219
|
expect(await evaluator.getFeatureFlag('only-anon', 'user', {}, { email: 'a@b.com' })).toBe(false)
|
|
222
220
|
})
|
|
223
221
|
|
|
@@ -37,34 +37,22 @@ describe('matchProperty — numeric comparisons', () => {
|
|
|
37
37
|
})
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
describe('matchProperty —
|
|
41
|
-
test(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
expect(matchProperty({ key: '
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
describe('matchProperty — is_set', () => {
|
|
56
|
-
test('returns true when the property is present with a non-null value', () => {
|
|
57
|
-
expect(matchProperty({ key: 'plan', value: '', operator: 'is_set' }, { plan: 'pro' })).toBe(true)
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
test('returns true when the property is present with a null value', () => {
|
|
61
|
-
// `is_set` is about key presence, not value. Pre-fix, the null guard short-circuited and
|
|
62
|
-
// returned false here.
|
|
63
|
-
expect(matchProperty({ key: 'plan', value: '', operator: 'is_set' }, { plan: null })).toBe(true)
|
|
40
|
+
describe('matchProperty — presence operators', () => {
|
|
41
|
+
test.each([
|
|
42
|
+
['null', null],
|
|
43
|
+
['undefined', undefined],
|
|
44
|
+
['false', false],
|
|
45
|
+
['zero', 0],
|
|
46
|
+
['empty string', ''],
|
|
47
|
+
['empty array', []],
|
|
48
|
+
['empty object', {}],
|
|
49
|
+
])('treats present %s as set', (_, value) => {
|
|
50
|
+
expect(matchProperty({ key: 'key', value: '', operator: 'is_set' }, { key: value })).toBe(true)
|
|
51
|
+
expect(matchProperty({ key: 'key', value: '', operator: 'is_not_set' }, { key: value })).toBe(false)
|
|
64
52
|
})
|
|
65
53
|
|
|
66
|
-
test('
|
|
67
|
-
expect(() => matchProperty({ key: '
|
|
54
|
+
test.each(['is_set', 'is_not_set'])('%s is inconclusive when the property is omitted', (operator) => {
|
|
55
|
+
expect(() => matchProperty({ key: 'key', value: '', operator }, {})).toThrow(InconclusiveMatchError)
|
|
68
56
|
})
|
|
69
57
|
})
|
|
70
58
|
|
|
@@ -152,7 +140,7 @@ describe('matchProperty — SemVer compatibility policy', () => {
|
|
|
152
140
|
})
|
|
153
141
|
|
|
154
142
|
describe('matchProperty — error cases', () => {
|
|
155
|
-
test('throws InconclusiveMatchError when key is absent for
|
|
143
|
+
test('throws InconclusiveMatchError when key is absent for other operators', () => {
|
|
156
144
|
expect(() => matchProperty(prop('exact', 'x'), {})).toThrow(InconclusiveMatchError)
|
|
157
145
|
})
|
|
158
146
|
})
|
package/src/component/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.1.
|
|
1
|
+
export const version = '2.1.4'
|