Skip to content

Commit

Permalink
feat: provide types
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Feb 12, 2024
1 parent e1612b5 commit 0dee811
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
"provenance": true
},
"exports": {
".": "./src/index.mjs"
".": {
"types": "./types/index.d.mts",
"default": "./src/index.mjs"
}
},
"types": "./types/index.d.mts",
"description": "intercepects / modifies requests as they pass between endpoints",
"keywords": [
"interceptor"
Expand All @@ -24,6 +28,7 @@
],
"license": "BSD-2-Clause",
"scripts": {
"prepare": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs",
"test": "npm run test:ava",
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
Expand Down
4 changes: 4 additions & 0 deletions src/interceptor.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { setAttributes, getAttributes } from "model-attributes";

/**
* @typedef {Object} Endpoint
*/

/**
* Base interceptor. The base class for all the interceptors
* Calls configure() and reset().
Expand Down

0 comments on commit 0dee811

Please sign in to comment.