@keq-request/exception 5.0.0-alpha.7 → 5.0.0-alpha.9
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/.turbo/turbo-build.log +18 -0
- package/CHANGELOG.md +18 -0
- package/dist/catch-exception.d.ts +4 -0
- package/dist/catch-exception.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +23 -0
- package/dist/index.mjs.map +1 -0
- package/dist/throw-exception.d.ts +5 -0
- package/dist/throw-exception.d.ts.map +1 -0
- package/package.json +3 -4
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
> @keq-request/exception@5.0.0-alpha.9 build /home/runner/work/keq/keq/packages/exception
|
|
3
|
+
> tsup
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.lib.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.0
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/keq/keq/packages/exception/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: esnext
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mCJS[39m Build start
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m444.00 B[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m1.03 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 34ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.js [22m[32m1.48 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m1.18 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 34ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.0.0-alpha.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2686b8d: build with burbo
|
|
8
|
+
- 2686b8d: remove private dependencies
|
|
9
|
+
- Updated dependencies [2686b8d]
|
|
10
|
+
- Updated dependencies [2686b8d]
|
|
11
|
+
- keq@5.0.0-alpha.9
|
|
12
|
+
|
|
13
|
+
## 5.0.0-alpha.8
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 0873c7e: Incorrect build before release.
|
|
18
|
+
- Updated dependencies [0873c7e]
|
|
19
|
+
- keq@5.0.0-alpha.8
|
|
20
|
+
|
|
3
21
|
## 5.0.0-alpha.7
|
|
4
22
|
|
|
5
23
|
### Major Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catch-exception.d.ts","sourceRoot":"","sources":["../src/catch-exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAGtC,wBAAgB,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAQvF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
catchException: () => catchException,
|
|
24
|
+
throwException: () => throwException
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
|
|
28
|
+
// src/throw-exception.ts
|
|
29
|
+
function throwException(check) {
|
|
30
|
+
return async function throwException2(ctx, next) {
|
|
31
|
+
await next();
|
|
32
|
+
await check(ctx);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/catch-exception.ts
|
|
37
|
+
function catchException(handler) {
|
|
38
|
+
return async function catchException2(ctx, next) {
|
|
39
|
+
try {
|
|
40
|
+
await next();
|
|
41
|
+
} catch (err) {
|
|
42
|
+
await handler(err);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
catchException,
|
|
49
|
+
throwException
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/throw-exception.ts","../src/catch-exception.ts"],"sourcesContent":["export * from './throw-exception.js'\nexport * from './catch-exception.js'\n","import { KeqContext, KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport type Check = (ctx: KeqContext) => Promisable<void>\n\nexport function throwException(check: Check): KeqMiddleware {\n return async function throwException(ctx, next) {\n await next()\n\n await check(ctx)\n }\n}\n","import { KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport function catchException(handler: (e: unknown) => Promisable<void>): KeqMiddleware {\n return async function catchException(ctx, next) {\n try {\n await next()\n } catch (err) {\n await handler(err)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,SAAS,eAAe,OAA6B;AAC1D,SAAO,eAAeA,gBAAe,KAAK,MAAM;AAC9C,UAAM,KAAK;AAEX,UAAM,MAAM,GAAG;AAAA,EACjB;AACF;;;ACRO,SAAS,eAAe,SAA0D;AACvF,SAAO,eAAeC,gBAAe,KAAK,MAAM;AAC9C,QAAI;AACF,YAAM,KAAK;AAAA,IACb,SAAS,KAAK;AACZ,YAAM,QAAQ,GAAG;AAAA,IACnB;AAAA,EACF;AACF;","names":["throwException","catchException"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/throw-exception.ts
|
|
2
|
+
function throwException(check) {
|
|
3
|
+
return async function throwException2(ctx, next) {
|
|
4
|
+
await next();
|
|
5
|
+
await check(ctx);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/catch-exception.ts
|
|
10
|
+
function catchException(handler) {
|
|
11
|
+
return async function catchException2(ctx, next) {
|
|
12
|
+
try {
|
|
13
|
+
await next();
|
|
14
|
+
} catch (err) {
|
|
15
|
+
await handler(err);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
catchException,
|
|
21
|
+
throwException
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/throw-exception.ts","../src/catch-exception.ts"],"sourcesContent":["import { KeqContext, KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport type Check = (ctx: KeqContext) => Promisable<void>\n\nexport function throwException(check: Check): KeqMiddleware {\n return async function throwException(ctx, next) {\n await next()\n\n await check(ctx)\n }\n}\n","import { KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport function catchException(handler: (e: unknown) => Promisable<void>): KeqMiddleware {\n return async function catchException(ctx, next) {\n try {\n await next()\n } catch (err) {\n await handler(err)\n }\n }\n}\n"],"mappings":";AAMO,SAAS,eAAe,OAA6B;AAC1D,SAAO,eAAeA,gBAAe,KAAK,MAAM;AAC9C,UAAM,KAAK;AAEX,UAAM,MAAM,GAAG;AAAA,EACjB;AACF;;;ACRO,SAAS,eAAe,SAA0D;AACvF,SAAO,eAAeC,gBAAe,KAAK,MAAM;AAC9C,QAAI;AACF,YAAM,KAAK;AAAA,IACb,SAAS,KAAK;AACZ,YAAM,QAAQ,GAAG;AAAA,IACnB;AAAA,EACF;AACF;","names":["throwException","catchException"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throw-exception.d.ts","sourceRoot":"","sources":["../src/throw-exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAGtC,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK,UAAU,CAAC,IAAI,CAAC,CAAA;AAEzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAM1D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keq-request/exception",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.9",
|
|
4
4
|
"description": "Request exception for keq",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"keq",
|
|
@@ -33,11 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^20.19.24",
|
|
36
|
-
"keq": "5.0.0-alpha.
|
|
37
|
-
"@keq-request/test": "5.0.0-alpha.7"
|
|
36
|
+
"keq": "5.0.0-alpha.9"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
|
-
"keq": "^5.0.0-alpha.
|
|
39
|
+
"keq": "^5.0.0-alpha.9"
|
|
41
40
|
},
|
|
42
41
|
"scripts": {
|
|
43
42
|
"build": "tsup",
|