Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@esmj/observable

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esmj/observable - npm Package Compare versions

Comparing version
0.3.0
to
0.4.0
+11
-3
dist/index.d.ts

@@ -11,3 +11,3 @@ interface IObserverFunction {

interface IExtendable {
pipe<T extends this>(...operations: ((operation: T) => T)[]): T;
pipe<T extends this>(...operations: ((operation: any) => any)[]): T;
}

@@ -30,3 +30,3 @@ type IObserver = IObserverObject | IObserverFunction;

#private;
pipe<Input extends this, Output extends IObservable>(...operations: any[]): Input | Output;
pipe(...operations: any[]): any;
next(...rest: any[]): void;

@@ -40,4 +40,12 @@ error(...rest: any[]): void;

}
declare function pipe<Input extends IObservable | unknown, Output = unknown>(...operations: ((operation: Input) => Input)[]): (any: Input) => Input | Output;
declare function pipe<A, B>(op1: (input: A) => B): (input: A) => B;
declare function pipe<A, B, C>(op1: (input: A) => B, op2: (input: B) => C): (input: A) => C;
declare function pipe<A, B, C, D>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D): (input: A) => D;
declare function pipe<A, B, C, D, E>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E): (input: A) => E;
declare function pipe<A, B, C, D, E, F>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F): (input: A) => F;
declare function pipe<A, B, C, D, E, F, G>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G): (input: A) => G;
declare function pipe<A, B, C, D, E, F, G, H>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G, op7: (input: G) => H): (input: A) => H;
declare function pipe<A, B, C, D, E, F, G, H, I>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G, op7: (input: G) => H, op8: (input: H) => I): (input: A) => I;
declare function pipe<A, B, C, D, E, F, G, H, I, J>(op1: (input: A) => B, op2: (input: B) => C, op3: (input: C) => D, op4: (input: D) => E, op5: (input: E) => F, op6: (input: F) => G, op7: (input: G) => H, op8: (input: H) => I, op9: (input: I) => J): (input: A) => J;
export { IExtendable, IObservable, IObserver, IObserverFunction, IObserverObject, Observable, Observer, Subscription, pipe };

@@ -41,3 +41,3 @@ var __defProp = Object.defineProperty;

pipe(...operations) {
return pipe(...operations)(this);
return operations.reduce((result, operation) => operation(result), this);
}

@@ -74,7 +74,4 @@ next(...rest) {

function pipe(...operations) {
return (any) => {
return Array.from(operations).reduce(
(any2, operation) => operation(any2),
any
);
return (input) => {
return operations.reduce((result, operation) => operation(result), input);
};

@@ -81,0 +78,0 @@ }

@@ -16,3 +16,3 @@ // src/index.ts

pipe(...operations) {
return pipe(...operations)(this);
return operations.reduce((result, operation) => operation(result), this);
}

@@ -49,7 +49,4 @@ next(...rest) {

function pipe(...operations) {
return (any) => {
return Array.from(operations).reduce(
(any2, operation) => operation(any2),
any
);
return (input) => {
return operations.reduce((result, operation) => operation(result), input);
};

@@ -56,0 +53,0 @@ }

{
"name": "@esmj/observable",
"version": "0.3.0",
"version": "0.4.0",
"description": "Tiny observable library for other extensibility",

@@ -5,0 +5,0 @@ "keywords": [