@nicolastoulemont/std 0.1.0 → 0.2.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/dist/adt/index.d.mts +1 -1
- package/dist/brand/index.d.mts +1 -1
- package/dist/either/index.d.mts +1 -1
- package/dist/fn/index.d.mts +2 -0
- package/dist/fn/index.mjs +3 -0
- package/dist/fn-DFHj-EVA.mjs +10 -0
- package/dist/fn-DFHj-EVA.mjs.map +1 -0
- package/dist/gen/index.d.mts +3 -3
- package/dist/gen/index.mjs +2 -2
- package/dist/gen-DF-FXNdy.mjs +99 -0
- package/dist/gen-DF-FXNdy.mjs.map +1 -0
- package/dist/{index-wTrnFgYg.d.mts → index-B3z7T6Dz.d.mts} +12 -12
- package/dist/index-B3z7T6Dz.d.mts.map +1 -0
- package/dist/{index-CtJ8Ks9X.d.mts → index-BFhV56qy.d.mts} +2 -2
- package/dist/{index-CtJ8Ks9X.d.mts.map → index-BFhV56qy.d.mts.map} +1 -1
- package/dist/index-BLG9B4bn.d.mts +116 -0
- package/dist/index-BLG9B4bn.d.mts.map +1 -0
- package/dist/{index-CvGTIg9L.d.mts → index-BiFc2xWF.d.mts} +3 -3
- package/dist/{index-CvGTIg9L.d.mts.map → index-BiFc2xWF.d.mts.map} +1 -1
- package/dist/{index-DgOAEEpu.d.mts → index-BwVaI5d0.d.mts} +2 -2
- package/dist/{index-DgOAEEpu.d.mts.map → index-BwVaI5d0.d.mts.map} +1 -1
- package/dist/{index-bLRqTe5I.d.mts → index-CckxkaUd.d.mts} +2 -2
- package/dist/{index-bLRqTe5I.d.mts.map → index-CckxkaUd.d.mts.map} +1 -1
- package/dist/{index-Dtq3kmln.d.mts → index-Cp_4sFun.d.mts} +2 -2
- package/dist/{index-Dtq3kmln.d.mts.map → index-Cp_4sFun.d.mts.map} +1 -1
- package/dist/{index-CcPnhWje.d.mts → index-DbfMra4p.d.mts} +3 -3
- package/dist/index-DbfMra4p.d.mts.map +1 -0
- package/dist/{index-yyBTq8Ys.d.mts → index-zC2zAtZY.d.mts} +1 -1
- package/dist/{index-yyBTq8Ys.d.mts.map → index-zC2zAtZY.d.mts.map} +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/dist/option/index.d.mts +2 -2
- package/dist/{option.types-D6TYG_i3.d.mts → option.types-eqVODMIy.d.mts} +2 -2
- package/dist/{option.types-D6TYG_i3.d.mts.map → option.types-eqVODMIy.d.mts.map} +1 -1
- package/dist/pipe/index.d.mts +1 -1
- package/dist/predicate/index.d.mts +1 -1
- package/dist/predicate/index.mjs +1 -1
- package/dist/{predicate-B6-EdVgW.mjs → predicate-BZkZmo-W.mjs} +6 -6
- package/dist/predicate-BZkZmo-W.mjs.map +1 -0
- package/dist/result/index.d.mts +2 -2
- package/dist/{result.types-Ce7AEOzj.d.mts → result.types-Bd8a43Fg.d.mts} +23 -5
- package/dist/result.types-Bd8a43Fg.d.mts.map +1 -0
- package/package.json +8 -5
- package/dist/gen-YfMC9sDT.mjs +0 -42
- package/dist/gen-YfMC9sDT.mjs.map +0 -1
- package/dist/index-CcPnhWje.d.mts.map +0 -1
- package/dist/index-DPVT0yK4.d.mts +0 -50
- package/dist/index-DPVT0yK4.d.mts.map +0 -1
- package/dist/index-wTrnFgYg.d.mts.map +0 -1
- package/dist/predicate-B6-EdVgW.mjs.map +0 -1
- package/dist/result.types-Ce7AEOzj.d.mts.map +0 -1
- package/dist/run/index.d.mts +0 -2
- package/dist/run/index.mjs +0 -3
- package/dist/run-DpXkImo9.mjs +0 -10
- package/dist/run-DpXkImo9.mjs.map +0 -1
package/dist/run/index.d.mts
DELETED
package/dist/run/index.mjs
DELETED
package/dist/run-DpXkImo9.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-DpXkImo9.mjs","names":[],"sources":["../src/run/run.ts"],"sourcesContent":["import { gen } from \"../gen\"\nimport type { Result as ResultType } from \"../result/result.types\"\n\n/**\n * Convenience wrapper around Do() that executes the computation immediately\n * and returns the Result directly.\n *\n * Use this when you want inline execution without storing the computation.\n * For deferred execution, use Do() directly.\n *\n * @see {@link Do} for deferred/composable computations\n *\n * @example\n * ```typescript\n * // Sync computation\n * const result = run(function* () {\n * const a = yield* divide(10, 2)\n * const b = yield* divide(a, 2)\n * return b\n * }) // Result<number, \"DivisionByZero\">\n *\n * // Async computation\n * const user = await run(async function* () {\n * const data = yield* await fetchUser(1)\n * return data.name\n * }) // Promise<Result<string, \"NotFound\">>\n *\n * // Type accumulation\n * const result = run(function* () {\n * const a = yield* divide(10, 2) // \"DivisionByZero\"\n * const b = yield* findUser(a) // \"NotFound\"\n * return b.name\n * }) // Result<string, \"DivisionByZero\" | \"NotFound\">\n * ```\n */\n\n/**\n * Execute a sync generator computation immediately.\n *\n * @template A - The success value type\n * @template E - The error type (union of all yielded error types)\n * @param generatorFn - A function returning a sync generator\n * @returns Result<A, E> directly\n */\nexport function run<A, E>(generatorFn: () => Generator<E, A, unknown>): ResultType<A, E>\n\n/**\n * Execute an async generator computation immediately.\n *\n * @template A - The success value type\n * @template E - The error type (union of all yielded error types)\n * @param generatorFn - A function returning an async generator\n * @returns Promise<Result<A, E>>\n */\nexport function run<A, E>(generatorFn: () => AsyncGenerator<E, A, unknown>): Promise<ResultType<A, E>>\n// Implementation\n/* oxlint-disable no-explicit-any, no-unsafe-type-assertion, no-unsafe-return, no-unsafe-argument -- Required for overloaded function implementation */\nexport function run<A, E>(\n generatorFn: (() => Generator<E, A, unknown>) | (() => AsyncGenerator<E, A, unknown>),\n): ResultType<A, E> | Promise<ResultType<A, E>> {\n const computation = gen(generatorFn as any)\n return computation.run() as any\n}\n/* oxlint-enable no-explicit-any, no-unsafe-type-assertion, no-unsafe-return */\n"],"mappings":";;;AAyDA,SAAgB,IACd,aAC8C;AAE9C,QADoB,IAAI,YAAmB,CACxB,KAAK"}
|