Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@posthog/plugin-unduplicates

Package Overview
Dependencies
Maintainers
8
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@posthog/plugin-unduplicates - npm Package Compare versions

Comparing version
0.0.1
to
0.0.2
logo.png

Sorry, the diff of this file is not supported yet

+0
-5
import { createHash, randomUUID } from 'crypto';
// From UUID Namespace RFC (https://datatracker.ietf.org/doc/html/rfc4122)
const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';

@@ -13,4 +12,2 @@ const stringifyEvent = (event) => {

function stringifyUUID(arr) {
// Forked from https://github.com/uuidjs/uuid (MIT)
// Copyright (c) 2010-2020 Robert Kieffer and other contributors
return (byteToHex[arr[0]] +

@@ -44,3 +41,2 @@ byteToHex[arr[1]] +

}
// Create a hash of the relevant properties of the event
const stringifiedProps = config.dedupMode === 'All Properties' ? `_${JSON.stringify(event.properties)}` : '';

@@ -51,3 +47,2 @@ const hash = createHash('sha1');

.digest();
// Convert to UUID v5 spec
eventKeyBuffer[6] = (eventKeyBuffer[6] & 0x0f) | 0x50;

@@ -54,0 +49,0 @@ eventKeyBuffer[8] = (eventKeyBuffer[8] & 0x3f) | 0x80;

+1
-1
{
"name": "@posthog/plugin-unduplicates",
"version": "0.0.1",
"version": "0.0.2",
"description": "Prevent duplicates in your data by rejecting duplicate events at ingestion.",

@@ -5,0 +5,0 @@ "main": "index.ts",