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

@dialectlabs/monitor

Package Overview
Dependencies
Maintainers
5
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dialectlabs/monitor - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

.idea/compiler.xml

5

lib/cjs/transformation-pipelines.d.ts

@@ -35,2 +35,6 @@ import { SubscriberEvent, SubscriberState } from './data-model';

}
export interface Diff<E> {
added: E[];
removed: E[];
}
/**

@@ -40,2 +44,3 @@ * A set of commonly-used pipelines

export declare class Pipelines {
static diff<T extends object, E extends object>(compareBy: (e1: E, e2: E) => boolean, rateLimit?: RateLimit): TransformationPipeline<E[], T, Diff<E>>;
static threshold<T extends object>(trigger: Trigger, rateLimit?: RateLimit): TransformationPipeline<number, T, number>;

@@ -42,0 +47,0 @@ static averageInFixedSizeWindowThreshold<T extends object>(window: FixedSizeWindow, trigger: Trigger, rateLimit?: RateLimit): TransformationPipeline<number, T, number>;

@@ -22,2 +22,24 @@ "use strict";

class Pipelines {
static diff(compareBy, rateLimit) {
return Pipelines.createNew((upstream) => upstream
.pipe(transformation_pipeline_operators_1.Operators.Window.fixedSizeSliding(2))
.pipe(transformation_pipeline_operators_1.Operators.Transform.filter((it) => it.length == 2))
.pipe(transformation_pipeline_operators_1.Operators.Transform.map(([d1, d2]) => {
const added = d2.value.filter((e2) => !d1.value.find((e1) => compareBy(e1, e2)));
const removed = d1.value.filter((e1) => !d2.value.find((e2) => compareBy(e1, e2)));
const diff = {
added,
removed,
};
const data = {
value: diff,
context: d2.context,
};
return data;
}))
.pipe(transformation_pipeline_operators_1.Operators.Transform.filter(({ value: { added, removed } }) => added.length + removed.length > 0))
.pipe(rateLimit
? transformation_pipeline_operators_1.Operators.FlowControl.rateLimit(rateLimit.timeSpan)
: transformation_pipeline_operators_1.Operators.Transform.identity()));
}
static threshold(trigger, rateLimit) {

@@ -24,0 +46,0 @@ const triggerOperator = createTriggerOperator(trigger);

2

package.json
{
"name": "@dialectlabs/monitor",
"version": "1.2.3",
"version": "1.2.4",
"repository": "git@github.com:dialectlabs/monitor.git",

@@ -5,0 +5,0 @@ "author": "dialectlabs",

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