Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

posthog-node

Package Overview
Dependencies
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthog-node - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

3

CHANGELOG.md
# Next
# 4.1.1 - 2024-08-20
1. Local evaluation returns correct results on `undefined/null` values
# 4.1.0 - 2024-08-14

@@ -4,0 +7,0 @@

2

lib/posthog-node/src/feature-flags.d.ts

@@ -63,4 +63,4 @@ /// <reference types="node" />

}
declare function matchProperty(property: FeatureFlagCondition['properties'][number], propertyValues: Record<string, any>): boolean;
declare function matchProperty(property: FeatureFlagCondition['properties'][number], propertyValues: Record<string, any>, warnFunction?: (msg: string) => void): boolean;
declare function relativeDateParseForFeatureFlagMatching(value: string): Date | null;
export { FeatureFlagsPoller, matchProperty, relativeDateParseForFeatureFlagMatching, InconclusiveMatchError, ClientError, };
{
"name": "posthog-node",
"version": "4.1.0",
"version": "4.1.1",
"description": "PostHog Node.js integration",

@@ -5,0 +5,0 @@ "repository": {

@@ -10,2 +10,3 @@ import { createHash } from 'rusha'

const NULL_VALUES_ALLOWED_OPERATORS = ['is_not']
class ClientError extends Error {

@@ -309,3 +310,7 @@ constructor(message: string) {

const rolloutPercentage = condition.rollout_percentage
const warnFunction = (msg: string): void => {
if (this.debugMode) {
console.warn(msg)
}
}
if ((condition.properties || []).length > 0) {

@@ -319,3 +324,3 @@ for (const prop of condition.properties) {

} else {
matches = matchProperty(prop, properties)
matches = matchProperty(prop, properties, warnFunction)
}

@@ -467,3 +472,4 @@

property: FeatureFlagCondition['properties'][number],
propertyValues: Record<string, any>
propertyValues: Record<string, any>,
warnFunction?: (msg: string) => void
): boolean {

@@ -481,3 +487,12 @@ const key = property.key

const overrideValue = propertyValues[key]
if (overrideValue == null && !NULL_VALUES_ALLOWED_OPERATORS.includes(operator)) {
// if the value is null, just fail the feature flag comparison
// this isn't an InconclusiveMatchError because the property value was provided.
if (warnFunction) {
warnFunction(`Property ${key} cannot have a value of null/undefined with the ${operator} operator`)
}
return false
}
function computeExactMatch(value: any, overrideValue: any): boolean {

@@ -484,0 +499,0 @@ if (Array.isArray(value)) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc