@axman/res 0.0.1

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.
@@ -0,0 +1 @@
1
+ export * from './res';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(e){return[e,null]}function t(e){return[null,e]}const o=Object.freeze(Object.defineProperty({__proto__:null,err:t,ok:r},Symbol.toStringTag,{value:"Module"}));exports.err=t;exports.ok=r;exports.res=o;
@@ -0,0 +1,2 @@
1
+ export * from './index-exports';
2
+ export * as res from './index-exports';
@@ -0,0 +1,16 @@
1
+ function r(e) {
2
+ return [e, null];
3
+ }
4
+ function n(e) {
5
+ return [null, e];
6
+ }
7
+ const t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8
+ __proto__: null,
9
+ err: n,
10
+ ok: r
11
+ }, Symbol.toStringTag, { value: "Module" }));
12
+ export {
13
+ n as err,
14
+ r as ok,
15
+ t as res
16
+ };
package/dist/res.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export type Ok<T> = [T, null];
2
+ export type Err<T> = [null, T];
3
+ export type Res<T, E> = Ok<T> | Err<E>;
4
+ export declare function ok<T>(value: T): Ok<T>;
5
+ export declare function err<E>(error: E): Err<E>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@axman/res",
3
+ "author": "akhmanov",
4
+ "version": "0.0.1",
5
+ "description": "Go style Result for TypeScript",
6
+ "license": "MIT",
7
+ "private": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "sideEffects": false,
12
+ "main": "./dist/index.cjs.js",
13
+ "module": "./dist/index.es.js",
14
+ "types": "./dist/index.d.ts",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/akhmanov/res-js.git"
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.es.js",
23
+ "require": "./dist/index.cjs.js",
24
+ "default": "./dist/index.es.js"
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "keywords": [
32
+ "res",
33
+ "result"
34
+ ],
35
+ "scripts": {
36
+ "test": "vitest run",
37
+ "build": "tsc -b && vite build -c vite.config.ts",
38
+ "fmt": "biome format --write .",
39
+ "lint": "biome check .",
40
+ "lint:fix": "biome check --fix ."
41
+ },
42
+ "devDependencies": {
43
+ "@biomejs/biome": "^2.3.11",
44
+ "@tsconfig/strictest": "^2.0.6",
45
+ "@types/node": "^24.9.1",
46
+ "typescript": "^5.9.3",
47
+ "vite": "^7.1.11",
48
+ "vite-plugin-dts": "^4.5.4",
49
+ "vitest": "^3.2.4"
50
+ }
51
+ }