@zipbul/result 0.1.3 → 0.1.5

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.ko.md +11 -23
  3. package/README.md +11 -23
  4. package/package.json +10 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Junhyung Park
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ko.md CHANGED
@@ -426,35 +426,23 @@ Bun.serve({
426
426
 
427
427
  </details>
428
428
 
429
- <details>
430
- <summary><b>@zipbul/cors와 함께</b></summary>
431
-
432
- ```typescript
433
- import { Cors, CorsAction } from '@zipbul/cors';
434
- import { isErr } from '@zipbul/result';
429
+ <br>
435
430
 
436
- const corsResult = Cors.create({
437
- origin: 'https://app.example.com',
438
- credentials: true,
439
- });
431
+ ## 📤 내보내기
440
432
 
441
- // Cors.create()는 Result<Cors, CorsError>를 반환합니다
442
- if (isErr(corsResult)) {
443
- throw new Error(`CORS 설정 에러: ${corsResult.data.message}`);
444
- }
445
-
446
- const cors = corsResult;
433
+ ```typescript
434
+ // 핵심
435
+ export { err } from '@zipbul/result';
436
+ export { isErr } from '@zipbul/result';
437
+ export { safe } from '@zipbul/result';
447
438
 
448
- // cors.handle()는 Promise<Result<CorsResult, CorsError>>를 반환합니다
449
- const result = await cors.handle(request);
439
+ // 타입
440
+ export type { Result, ResultAsync, Err } from '@zipbul/result';
450
441
 
451
- if (isErr(result)) {
452
- return new Response('Internal Error', { status: 500 });
453
- }
442
+ // 마커
443
+ export { DEFAULT_MARKER_KEY, getMarkerKey, setMarkerKey } from '@zipbul/result';
454
444
  ```
455
445
 
456
- </details>
457
-
458
446
  <br>
459
447
 
460
448
  ## 📄 라이선스
package/README.md CHANGED
@@ -426,35 +426,23 @@ Bun.serve({
426
426
 
427
427
  </details>
428
428
 
429
- <details>
430
- <summary><b>With @zipbul/cors</b></summary>
431
-
432
- ```typescript
433
- import { Cors, CorsAction } from '@zipbul/cors';
434
- import { isErr } from '@zipbul/result';
429
+ <br>
435
430
 
436
- const corsResult = Cors.create({
437
- origin: 'https://app.example.com',
438
- credentials: true,
439
- });
431
+ ## 📤 Exports
440
432
 
441
- // Cors.create() returns Result<Cors, CorsError>
442
- if (isErr(corsResult)) {
443
- throw new Error(`CORS config error: ${corsResult.data.message}`);
444
- }
445
-
446
- const cors = corsResult;
433
+ ```typescript
434
+ // Core
435
+ export { err } from '@zipbul/result';
436
+ export { isErr } from '@zipbul/result';
437
+ export { safe } from '@zipbul/result';
447
438
 
448
- // cors.handle() returns Promise<Result<CorsResult, CorsError>>
449
- const result = await cors.handle(request);
439
+ // Types
440
+ export type { Result, ResultAsync, Err } from '@zipbul/result';
450
441
 
451
- if (isErr(result)) {
452
- return new Response('Internal Error', { status: 500 });
453
- }
442
+ // Marker key
443
+ export { DEFAULT_MARKER_KEY, getMarkerKey, setMarkerKey } from '@zipbul/result';
454
444
  ```
455
445
 
456
- </details>
457
-
458
446
  <br>
459
447
 
460
448
  ## 📄 License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipbul/result",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Lightweight Result type for error handling without exceptions",
5
5
  "license": "MIT",
6
6
  "author": "Junhyung Park (https://github.com/parkrevil)",
@@ -13,8 +13,13 @@
13
13
  "homepage": "https://github.com/zipbul/toolkit/tree/main/packages/result#readme",
14
14
  "keywords": [
15
15
  "result",
16
+ "result-type",
17
+ "error-handling",
16
18
  "error",
17
19
  "either",
20
+ "functional",
21
+ "no-exceptions",
22
+ "bun",
18
23
  "typescript",
19
24
  "zipbul"
20
25
  ],
@@ -33,6 +38,10 @@
33
38
  "files": [
34
39
  "dist"
35
40
  ],
41
+ "sideEffects": false,
42
+ "publishConfig": {
43
+ "provenance": true
44
+ },
36
45
  "scripts": {
37
46
  "build": "bun build index.ts --outdir dist --target bun --format esm --production --sourcemap=linked && tsc -p tsconfig.build.json",
38
47
  "typecheck": "tsc --noEmit",