@shware/http 0.2.20 → 0.2.22
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.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/utils/string.cjs +33 -0
- package/dist/utils/string.cjs.map +1 -0
- package/dist/utils/string.d.cts +6 -0
- package/dist/utils/string.d.ts +6 -0
- package/dist/utils/string.mjs +8 -0
- package/dist/utils/string.mjs.map +1 -0
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
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
|
+
};
|
|
6
10
|
var __copyProps = (to, from, except, desc) => {
|
|
7
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -16,16 +20,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
16
20
|
|
|
17
21
|
// src/index.ts
|
|
18
22
|
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
hasText: () => import_string.hasText
|
|
25
|
+
});
|
|
19
26
|
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./reason.cjs"), module.exports);
|
|
21
27
|
__reExport(index_exports, require("./detail.cjs"), module.exports);
|
|
22
28
|
__reExport(index_exports, require("./status.cjs"), module.exports);
|
|
23
29
|
__reExport(index_exports, require("./vaild.cjs"), module.exports);
|
|
24
30
|
__reExport(index_exports, require("./snowflake.cjs"), module.exports);
|
|
25
31
|
__reExport(index_exports, require("./response.cjs"), module.exports);
|
|
32
|
+
var import_string = require("./utils/string.cjs");
|
|
26
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
34
|
0 && (module.exports = {
|
|
28
|
-
|
|
35
|
+
hasText,
|
|
29
36
|
...require("./detail.cjs"),
|
|
30
37
|
...require("./status.cjs"),
|
|
31
38
|
...require("./vaild.cjs"),
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport type {\n NetworkErrorReason,\n StatusErrorReason,\n AuthenticationErrorReason,\n ModerationErrorReason,\n MultipartErrorReason,\n AppErrorReason,\n ErrorReason,\n} from './reason';\n\nexport * from './detail';\nexport * from './status';\nexport * from './vaild';\nexport * from './snowflake';\nexport * from './response';\nexport { hasText } from './utils/string';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBA,0BAAc,yBAvBd;AAwBA,0BAAc,yBAxBd;AAyBA,0BAAc,wBAzBd;AA0BA,0BAAc,4BA1Bd;AA2BA,0BAAc,2BA3Bd;AA4BA,oBAAwB;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -4,4 +4,5 @@ export { Code, DEFAULT_MESSAGES, ErrorBody, Status, StatusCode, StatusError } fr
|
|
|
4
4
|
export { Result, valid } from './vaild.cjs';
|
|
5
5
|
export { UidGenerator, uid } from './snowflake.cjs';
|
|
6
6
|
export { Cursor, Empty, Entity, EntityId, InitParams, NextParams, PageParams, PagedResponse, ParentPageParams, PrevParams, Response, pageParamsSchema } from './response.cjs';
|
|
7
|
+
export { hasText } from './utils/string.cjs';
|
|
7
8
|
import 'zod';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { Code, DEFAULT_MESSAGES, ErrorBody, Status, StatusCode, StatusError } fr
|
|
|
4
4
|
export { Result, valid } from './vaild.js';
|
|
5
5
|
export { UidGenerator, uid } from './snowflake.js';
|
|
6
6
|
export { Cursor, Empty, Entity, EntityId, InitParams, NextParams, PageParams, PagedResponse, ParentPageParams, PrevParams, Response, pageParamsSchema } from './response.js';
|
|
7
|
+
export { hasText } from './utils/string.js';
|
|
7
8
|
import 'zod';
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
export * from "./reason.mjs";
|
|
3
2
|
export * from "./detail.mjs";
|
|
4
3
|
export * from "./status.mjs";
|
|
5
4
|
export * from "./vaild.mjs";
|
|
6
5
|
export * from "./snowflake.mjs";
|
|
7
6
|
export * from "./response.mjs";
|
|
7
|
+
import { hasText } from "./utils/string.mjs";
|
|
8
|
+
export {
|
|
9
|
+
hasText
|
|
10
|
+
};
|
|
8
11
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport type {\n NetworkErrorReason,\n StatusErrorReason,\n AuthenticationErrorReason,\n ModerationErrorReason,\n MultipartErrorReason,\n AppErrorReason,\n ErrorReason,\n} from './reason';\n\nexport * from './detail';\nexport * from './status';\nexport * from './vaild';\nexport * from './snowflake';\nexport * from './response';\nexport { hasText } from './utils/string';\n"],"mappings":";AAuBA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,eAAe;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
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/utils/string.ts
|
|
21
|
+
var string_exports = {};
|
|
22
|
+
__export(string_exports, {
|
|
23
|
+
hasText: () => hasText
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(string_exports);
|
|
26
|
+
function hasText(str) {
|
|
27
|
+
return typeof str === "string" && str.trim().length !== 0;
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
hasText
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=string.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/string.ts"],"sourcesContent":["/**\n * Check whether the given String contains actual text.\n * */\nexport function hasText(str: string | null | undefined): str is string {\n return typeof str === 'string' && str.trim().length !== 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,QAAQ,KAA+C;AACrE,SAAO,OAAO,QAAQ,YAAY,IAAI,KAAK,EAAE,WAAW;AAC1D;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/string.ts"],"sourcesContent":["/**\n * Check whether the given String contains actual text.\n * */\nexport function hasText(str: string | null | undefined): str is string {\n return typeof str === 'string' && str.trim().length !== 0;\n}\n"],"mappings":";AAGO,SAAS,QAAQ,KAA+C;AACrE,SAAO,OAAO,QAAQ,YAAY,IAAI,KAAK,EAAE,WAAW;AAC1D;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shware/http",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/jest": "^29.5.14",
|
|
33
|
-
"@types/node": "^22.
|
|
33
|
+
"@types/node": "^22.15.18",
|
|
34
34
|
"jest": "^29.7.0",
|
|
35
|
-
"ts-jest": "^29.3.
|
|
36
|
-
"typescript": "^5.8.
|
|
35
|
+
"ts-jest": "^29.3.4",
|
|
36
|
+
"typescript": "^5.8.3"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"zod": "^3.24.
|
|
39
|
+
"zod": "^3.24.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"hono": "^4.7.
|
|
42
|
+
"hono": "^4.7.9"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"hono": {
|