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

@equinor/fusion-framework-module-http

Package Overview
Dependencies
Maintainers
3
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/fusion-framework-module-http - npm Package Compare versions

Comparing version 0.1.0-beta.3 to 0.1.0-beta.4

10

dist/esm/process-operators.js

@@ -1,3 +0,3 @@

import { BehaviorSubject, from } from 'rxjs';
import { withLatestFrom, concatMap, last } from 'rxjs/operators';
import { from } from 'rxjs';
import { last, mergeScan } from 'rxjs/operators';
export class ProcessOperators {

@@ -18,9 +18,5 @@ _operators = {};

process(request) {
const request$ = new BehaviorSubject(request);
from(Object.values(this._operators))
.pipe(withLatestFrom(request$), concatMap(async ([operator, value]) => (await operator(value)) || value))
.subscribe(request$);
return request$.pipe(last());
return from(Object.values(this._operators)).pipe(mergeScan((value, operator) => Promise.resolve(operator(value)).then((x) => x ?? value), request, 1), last());
}
}
//# sourceMappingURL=process-operators.js.map
{
"name": "@equinor/fusion-framework-module-http",
"version": "0.1.0-beta.3",
"version": "0.1.0-beta.4",
"description": "",

@@ -24,3 +24,3 @@ "main": "./dist/esm/index.js",

"dependencies": {
"@equinor/fusion-framework-module": "^0.1.0-beta.3"
"@equinor/fusion-framework-module": "^0.1.0-beta.4"
},

@@ -35,3 +35,3 @@ "types": "index.d.ts",

},
"gitHead": "c112e1fd2c1f4c6b3902767c621cb3967c66c357"
"gitHead": "e3857f92b410b4134fa08ffbc791d211a02a3a85"
}

@@ -1,3 +0,3 @@

import { BehaviorSubject, from, Observable } from 'rxjs';
import { withLatestFrom, concatMap, last } from 'rxjs/operators';
import { from, Observable } from 'rxjs';
import { last, mergeScan } from 'rxjs/operators';

@@ -41,11 +41,15 @@ export type ProcessOperator<T, R = T> = (request: T) => R | void | Promise<R | void>;

process(request: T): Observable<T> {
const request$ = new BehaviorSubject<T>(request);
from(Object.values(this._operators))
.pipe(
withLatestFrom(request$),
concatMap(async ([operator, value]) => (await operator(value)) || value)
)
.subscribe(request$);
return request$.pipe(last());
return from(Object.values(this._operators)).pipe(
mergeScan(
// resolve current operator and return result or previous if void
(value, operator) => Promise.resolve(operator(value)).then((x) => x ?? value),
// initial value
request,
// only allow concurrency of one operator
1
),
// output result of last operator
last()
);
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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