whistle.interceptors 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/server.js +1 -0
- package/index.js +2 -0
- package/package.json +18 -0
- package/rules.txt +0 -0
- package/tsconfig.json +16 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# whistle.interceptors
|
package/dist/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var f=(s,t)=>{for(var e in t)g(s,e,{get:t[e],enumerable:!0})},P=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of p(t))!S.call(s,r)&&r!==e&&g(s,r,{get:()=>t[r],enumerable:!(i=c(t,r))||i.enumerable});return s};var d=s=>P(g({},"__esModule",{value:!0}),s);var h=(s,t,e)=>new Promise((i,r)=>{var l=n=>{try{u(e.next(n))}catch(a){r(a)}},o=n=>{try{u(e.throw(n))}catch(a){r(a)}},u=n=>n.done?i(n.value):Promise.resolve(n.value).then(l,o);u((e=e.apply(s,t)).next())});var E={};f(E,{default:()=>R});module.exports=d(E);var W=["file"];function v(s){let t=new Map;return s.split("&").forEach(i=>{let[r,l]=i.split("=");t.set(r,l)}),t}var R=(s,t)=>{s.on("request",(e,i)=>h(null,null,function*(){e.method==="POST"&&e.on("data",r=>{let l=JSON.parse(r.toString()),o=v(e.originalReq.globalValue);Array.from(o.entries()).every(([n,a])=>W.includes(n)?!0:l[n]&&l[n]===a)&&o.has("file")&&t.getValues(n=>{i.end(n[o.get("file")])})}),e.passThrough()})),s.on("upgrade",(e,i)=>{e.passThrough()}),s.on("connect",(e,i)=>{e.passThrough()})};
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "whistle.interceptors",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "flexible interception requests",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "lvyuanxin",
|
|
7
|
+
"email": "lyxjay1005@163.com"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "tsup src/server.ts --watch",
|
|
11
|
+
"build": "tsup src/server.ts --minify"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/node": "^22.15.2",
|
|
15
|
+
"tsup": "^8.0.0",
|
|
16
|
+
"typescript": "^4.6.2"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/rules.txt
ADDED
|
File without changes
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist/",
|
|
4
|
+
"noImplicitAny": true,
|
|
5
|
+
"removeComments": true,
|
|
6
|
+
"module": "CommonJS",
|
|
7
|
+
"target": "es6",
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"moduleResolution": "node"
|
|
12
|
+
},
|
|
13
|
+
"include": [
|
|
14
|
+
"src"
|
|
15
|
+
]
|
|
16
|
+
}
|