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

@aomex/middleware

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aomex/middleware - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

9

CHANGELOG.md
# @aomex/middleware
## 0.0.3
### Patch Changes
- [`59ef917`](https://github.com/aomex/aomex/commit/59ef917533293301e8f3ab82460c8efc07df27c3) Thanks [@geekact](https://github.com/geekact)! - feat(middleware): chain.split 支持传递数组类型的分割点
- Updated dependencies [[`146b6b5`](https://github.com/aomex/aomex/commit/146b6b5f09d4b9f557c1771686f3585bebf4cfc9)]:
- @aomex/helper@0.0.3
## 0.0.2

@@ -4,0 +13,0 @@

2

dist/index.d.ts

@@ -65,3 +65,3 @@ interface _PureFn {

*/
static split(chain: Chain, point?: string): Chain<object>;
static split(chain: Chain, point?: string | string[]): Chain<object>;
protected readonly SubClass: new (middlewareList?: Middleware[]) => Chain;

@@ -68,0 +68,0 @@ protected points: Record<string, number>;

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

// src/chain.ts
import { toArray } from "@aomex/helper";
var _Chain = class {

@@ -48,6 +49,7 @@ constructor(middlewareList = []) {

*/
static split(chain2, point) {
if (!point || !chain2.points[point])
static split(chain2, point = []) {
const longestLengthOfPoint = toArray(point).map((p) => chain2.points[p]).filter(Boolean).sort((a, b) => b - a)[0];
if (!longestLengthOfPoint)
return chain2;
const middlewareList = chain2.middlewareList.slice(chain2.points[point]);
const middlewareList = chain2.middlewareList.slice(longestLengthOfPoint);
return new chain2.SubClass(middlewareList);

@@ -54,0 +56,0 @@ }

{
"name": "@aomex/middleware",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -26,3 +26,6 @@ "type": "module",

"license": "MIT",
"dependencies": {
"@aomex/helper": "^0.0.3"
},
"scripts": {}
}

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