mini-interactions-vercel 0.1.0
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/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/package.json +26 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InteractionHandler } from 'mini-interactions-core';
|
|
2
|
+
|
|
3
|
+
interface VercelHandlerOptions {
|
|
4
|
+
handler: InteractionHandler;
|
|
5
|
+
}
|
|
6
|
+
declare function createVercelHandler(options: VercelHandlerOptions): InteractionHandler;
|
|
7
|
+
|
|
8
|
+
export { type VercelHandlerOptions, createVercelHandler };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
function createVercelHandler(options) {
|
|
3
|
+
if (typeof options?.handler !== "function") throw new TypeError("handler must be provided");
|
|
4
|
+
return (request) => options.handler(request);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { createVercelHandler };
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAEO,SAAS,oBAAoB,OAAA,EAAmD;AACrF,EAAA,IAAI,OAAO,OAAA,EAAS,OAAA,KAAY,YAAY,MAAM,IAAI,UAAU,0BAA0B,CAAA;AAC1F,EAAA,OAAO,CAAC,OAAA,KAAY,OAAA,CAAQ,OAAA,CAAQ,OAAO,CAAA;AAC7C","file":"index.js","sourcesContent":["import type { InteractionHandler } from \"mini-interactions-core\";\nexport interface VercelHandlerOptions { handler: InteractionHandler; }\nexport function createVercelHandler(options: VercelHandlerOptions): InteractionHandler {\n if (typeof options?.handler !== \"function\") throw new TypeError(\"handler must be provided\");\n return (request) => options.handler(request);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mini-interactions-vercel",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"mini-interactions-core": "0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup",
|
|
21
|
+
"dev": "tsup --watch",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"clean": "rm -rf dist"
|
|
25
|
+
}
|
|
26
|
+
}
|