@l3dev/result 0.2.2 → 0.3.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/README.md CHANGED
@@ -35,7 +35,7 @@ result.ok; // true
35
35
  result.value; // 42
36
36
  ```
37
37
 
38
- > Use `NONE` as a shorthand for a null ok result, it is equivalent to `Ok<null>`
38
+ > Use `NONE` for a void ok result: `Ok<void>`
39
39
 
40
40
  ### `err`
41
41
 
package/build/ok.d.ts CHANGED
@@ -2,6 +2,6 @@ export type Ok<TValue> = {
2
2
  ok: true;
3
3
  value: TValue;
4
4
  };
5
- export type None = Ok<null>;
5
+ export type None = Ok<void>;
6
6
  export declare function ok<TValue>(value: TValue): Ok<TValue>;
7
7
  export declare const NONE: None;
package/build/ok.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ok.js","sourceRoot":"","sources":["../src/ok.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,EAAE,CAAS,KAAa;IACvC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAS,CAAC","sourcesContent":["export type Ok<TValue> = {\n\tok: true;\n\tvalue: TValue;\n};\n\nexport type None = Ok<null>;\n\nexport function ok<TValue>(value: TValue): Ok<TValue> {\n\treturn { ok: true, value };\n}\n\nexport const NONE = ok(null) as None;\n"]}
1
+ {"version":3,"file":"ok.js","sourceRoot":"","sources":["../src/ok.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,EAAE,CAAS,KAAa;IACvC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAoB,CAAC","sourcesContent":["export type Ok<TValue> = {\n\tok: true;\n\tvalue: TValue;\n};\n\nexport type None = Ok<void>;\n\nexport function ok<TValue>(value: TValue): Ok<TValue> {\n\treturn { ok: true, value };\n}\n\nexport const NONE = ok(null) as unknown as None;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l3dev/result",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Type-safe result-based error handling",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -16,8 +16,7 @@
16
16
  }
17
17
  },
18
18
  "files": [
19
- "build",
20
- "README.md"
19
+ "build"
21
20
  ],
22
21
  "author": "l3dotdev",
23
22
  "license": "MIT",