massaman 0.2.0 → 0.4.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/array/index.d.mts +2 -2
- package/dist/array/index.mjs +2 -2
- package/dist/{array-C8MqjyiP.mjs → array-DGmsKhoS.mjs} +3 -3
- package/dist/{array-C8MqjyiP.mjs.map → array-DGmsKhoS.mjs.map} +1 -1
- package/dist/control/index.d.mts +3 -3
- package/dist/control/index.mjs +2 -2
- package/dist/{control-B8mDJqXw.mjs → control-DCdm8IH6.mjs} +81 -2
- package/dist/control-DCdm8IH6.mjs.map +1 -0
- package/dist/conversion/index.d.mts +1 -1
- package/dist/conversion/index.mjs +1 -1
- package/dist/{conversion-ByBXBR5i.mjs → conversion-BB912-15.mjs} +1 -1
- package/dist/{conversion-ByBXBR5i.mjs.map → conversion-BB912-15.mjs.map} +1 -1
- package/dist/fp/index.d.mts +2 -0
- package/dist/fp/index.mjs +2 -0
- package/dist/function/index.d.mts +2 -2
- package/dist/function/index.mjs +1 -1
- package/dist/{function-2-6QB4m7.mjs → function-Brosl7-Y.mjs} +1 -1
- package/dist/{function-2-6QB4m7.mjs.map → function-Brosl7-Y.mjs.map} +1 -1
- package/dist/{index-mfIoxwxy.d.mts → index-B9ig68hj.d.mts} +3 -3
- package/dist/index-B9ig68hj.d.mts.map +1 -0
- package/dist/{index-BjmDP8W9.d.mts → index-C7dxY5U-.d.mts} +1 -1
- package/dist/index-C7dxY5U-.d.mts.map +1 -0
- package/dist/{index-g2aw5tc_.d.mts → index-CQAReq7e.d.mts} +3 -3
- package/dist/index-CQAReq7e.d.mts.map +1 -0
- package/dist/{index-D5l6I7QH.d.mts → index-CoCKuspw.d.mts} +1 -1
- package/dist/index-CoCKuspw.d.mts.map +1 -0
- package/dist/{index-keGHab-v.d.mts → index-D5qkz-H4.d.mts} +3 -3
- package/dist/index-D5qkz-H4.d.mts.map +1 -0
- package/dist/{index-BHb3Vge_.d.mts → index-DKEiLKtl.d.mts} +73 -3
- package/dist/index-DKEiLKtl.d.mts.map +1 -0
- package/dist/{index-DtnKhaAD.d.mts → index-DPhfdSi7.d.mts} +2 -2
- package/dist/index-DPhfdSi7.d.mts.map +1 -0
- package/dist/index.d.mts +11 -11
- package/dist/index.mjs +10 -10
- package/dist/match/index.d.mts +2 -2
- package/dist/match/index.mjs +1 -1
- package/dist/{match-CG_v2C4Q.mjs → match-uR6HPDRb.mjs} +1 -1
- package/dist/{match-CG_v2C4Q.mjs.map → match-uR6HPDRb.mjs.map} +1 -1
- package/dist/math/index.d.mts +2 -2
- package/dist/math/index.mjs +2 -2
- package/dist/object/index.d.mts +2 -2
- package/dist/object/index.mjs +2 -2
- package/dist/{object-BHnp9Sr9.mjs → object-DUAxOgHi.mjs} +3 -3
- package/dist/{object-BHnp9Sr9.mjs.map → object-DUAxOgHi.mjs.map} +1 -1
- package/dist/predicate/index.d.mts +2 -2
- package/dist/predicate/index.mjs +2 -2
- package/dist/{predicate-DtTBffBT.mjs → predicate-CleUejOb.mjs} +3 -3
- package/dist/{predicate-DtTBffBT.mjs.map → predicate-CleUejOb.mjs.map} +1 -1
- package/dist/promise/index.d.mts +2 -2
- package/dist/promise/index.mjs +2 -2
- package/dist/{types-X6LqLWno.d.mts → types-BsimcHZS.d.mts} +1 -1
- package/dist/types-BsimcHZS.d.mts.map +1 -0
- package/package.json +11 -7
- package/dist/control-B8mDJqXw.mjs.map +0 -1
- package/dist/index-BHb3Vge_.d.mts.map +0 -1
- package/dist/index-BjmDP8W9.d.mts.map +0 -1
- package/dist/index-D5l6I7QH.d.mts.map +0 -1
- package/dist/index-DtnKhaAD.d.mts.map +0 -1
- package/dist/index-g2aw5tc_.d.mts.map +0 -1
- package/dist/index-keGHab-v.d.mts.map +0 -1
- package/dist/index-mfIoxwxy.d.mts.map +0 -1
- package/dist/types-X6LqLWno.d.mts.map +0 -1
package/dist/array/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { adjust, ascend, at, chunk, compact, countBy, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, reduceWhile, remove, sample, sampleSize, scan, shuffle, sortBy, sortWith, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, unfold, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
1
|
+
import { $ as toFilled, A as isSubset, B as pull, C as forEachRight, Ct as adjust, D as intersection, E as initial, F as mapAsync, G as sampleSize, H as reduceAsync, I as maxBy, J as tail, K as shuffle, L as minBy, M as keyBy, N as last, O as intersectionBy, P as limitAsync, Q as takeWhile, R as orderBy, S as forEachAsync, St as dropRepeats, T as head, U as remove, V as pullAt, W as sample, X as takeRight, Y as take, Z as takeRightWhile, _ as flatMap, _t as ascend, a as combinations, at as uniqWith, b as flatten, bt as scan, c as difference, ct as windowed, d as drop, dt as xorBy, et as union, f as dropRight, ft as xorWith, g as filterAsync, gt as unfold, h as fill, ht as zipWith, i as chunkBy, it as uniqBy, j as isSubsetWith, k as intersectionWith, l as differenceBy, lt as without, m as dropWhile, mt as zipObject, n as cartesianProduct, nt as unionWith, o as compact, ot as unzip, p as dropRightWhile, pt as zip, q as sortBy, r as chunk, rt as uniq, s as countBy, st as unzipWith, t as at, tt as unionBy, u as differenceWith, ut as xor, v as flatMapAsync, vt as descend, w as groupBy, x as flattenDeep, xt as reduceWhile, y as flatMapDeep, yt as sortWith, z as partition } from "../index-B9ig68hj.mjs";
|
|
2
|
+
export { adjust, ascend, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, reduceWhile, remove, sample, sampleSize, scan, shuffle, sortBy, sortWith, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, unfold, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/array/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { adjust, ascend, at, chunk, compact, countBy, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, reduceWhile, remove, sample, sampleSize, scan, shuffle, sortBy, sortWith, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, unfold, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
1
|
+
import { $ as toFilled, A as isSubset, B as pull, C as forEachRight, Ct as adjust, D as intersection, E as initial, F as mapAsync, G as sampleSize, H as reduceAsync, I as maxBy, J as tail, K as shuffle, L as minBy, M as keyBy, N as last, O as intersectionBy, P as limitAsync, Q as takeWhile, R as orderBy, S as forEachAsync, St as dropRepeats, T as head, U as remove, V as pullAt, W as sample, X as takeRight, Y as take, Z as takeRightWhile, _ as flatMap, _t as ascend, a as combinations, at as uniqWith, b as flatten, bt as scan, c as difference, ct as windowed, d as drop, dt as xorBy, et as union, f as dropRight, ft as xorWith, g as filterAsync, gt as unfold, h as fill, ht as zipWith, i as chunkBy, it as uniqBy, j as isSubsetWith, k as intersectionWith, l as differenceBy, lt as without, m as dropWhile, mt as zipObject, n as cartesianProduct, nt as unionWith, o as compact, ot as unzip, p as dropRightWhile, pt as zip, q as sortBy, r as chunk, rt as uniq, s as countBy, st as unzipWith, t as at, tt as unionBy, u as differenceWith, ut as xor, v as flatMapAsync, vt as descend, w as groupBy, x as flattenDeep, xt as reduceWhile, y as flatMapDeep, yt as sortWith, z as partition } from "../array-DGmsKhoS.mjs";
|
|
2
|
+
export { adjust, ascend, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, reduceWhile, remove, sample, sampleSize, scan, shuffle, sortBy, sortWith, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, unfold, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at, chunk, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith } from "es-toolkit/array";
|
|
1
|
+
import { at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith } from "es-toolkit/array";
|
|
2
2
|
//#region src/array/adjust.ts
|
|
3
3
|
/**
|
|
4
4
|
* Applies a function to the element at the given index, returning a new array.
|
|
@@ -186,6 +186,6 @@ function unfold(fn, seed) {
|
|
|
186
186
|
return result;
|
|
187
187
|
}
|
|
188
188
|
//#endregion
|
|
189
|
-
export {
|
|
189
|
+
export { toFilled as $, isSubset as A, pull as B, forEachRight as C, adjust as Ct, intersection as D, initial as E, mapAsync as F, sampleSize as G, reduceAsync as H, maxBy as I, tail as J, shuffle as K, minBy as L, keyBy as M, last as N, intersectionBy as O, limitAsync as P, takeWhile as Q, orderBy as R, forEachAsync as S, dropRepeats as St, head as T, remove as U, pullAt as V, sample as W, takeRight as X, take as Y, takeRightWhile as Z, flatMap as _, ascend as _t, combinations as a, uniqWith as at, flatten as b, scan as bt, difference as c, windowed as ct, drop as d, xorBy as dt, union as et, dropRight as f, xorWith as ft, filterAsync as g, unfold as gt, fill as h, zipWith as ht, chunkBy as i, uniqBy as it, isSubsetWith as j, intersectionWith as k, differenceBy as l, without as lt, dropWhile as m, zipObject as mt, cartesianProduct as n, unionWith as nt, compact as o, unzip as ot, dropRightWhile as p, zip as pt, sortBy as q, chunk as r, uniq as rt, countBy as s, unzipWith as st, at as t, unionBy as tt, differenceWith as u, xor as ut, flatMapAsync as v, descend as vt, groupBy as w, flattenDeep as x, reduceWhile as xt, flatMapDeep as y, sortWith as yt, partition as z };
|
|
190
190
|
|
|
191
|
-
//# sourceMappingURL=array-
|
|
191
|
+
//# sourceMappingURL=array-DGmsKhoS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-
|
|
1
|
+
{"version":3,"file":"array-DGmsKhoS.mjs","names":[],"sources":["../src/array/adjust.ts","../src/array/dropRepeats.ts","../src/array/reduceWhile.ts","../src/array/scan.ts","../src/array/sorting.ts","../src/array/unfold.ts"],"sourcesContent":["/**\n * Applies a function to the element at the given index, returning a new array.\n *\n * The original array is not modified. If the index is out of bounds, the\n * array is returned unchanged.\n *\n * @example\n * ```ts\n * adjust([1, 2, 3], 1, (n) => n * 10)\n * // [1, 20, 3]\n * ```\n */\nexport function adjust<T>(array: readonly T[], index: number, fn: (value: T) => T): T[] {\n const result = [...array]\n if (index >= 0 && index < array.length) {\n // oxlint-disable-next-line security/detect-object-injection -- Numeric array index parameter, not user-controlled key\n result[index] = fn(result[index])\n }\n return result\n}\n","/**\n * Removes consecutively repeated elements from an array using strict\n * equality (`===`).\n *\n * Only adjacent duplicates are removed — non-adjacent duplicates are kept.\n * Use {@link uniq} from es-toolkit to remove all duplicates regardless of position.\n *\n * Quirks (inherent to `===`):\n * - `NaN !== NaN`, so adjacent `NaN`s are *not* collapsed.\n * - `-0 === 0`, so adjacent `-0` and `0` *are* collapsed.\n * - Object/array elements compare by reference, not structure.\n *\n * @example\n * ```ts\n * dropRepeats([1, 1, 2, 3, 3, 2, 1])\n * // [1, 2, 3, 2, 1]\n * ```\n */\nexport function dropRepeats<T>(array: readonly T[]): T[] {\n return array.reduce<T[]>((acc, item, index) => {\n if (index === 0 || item !== array[index - 1]) {\n acc.push(item)\n }\n return acc\n }, [])\n}\n","/**\n * Like `reduce` but stops early when the predicate returns `false`.\n *\n * The predicate receives the current accumulator and element. When it\n * returns `false`, the current accumulator is returned without processing\n * the remaining elements.\n *\n * @example\n * ```ts\n * // Sum until we hit a negative number\n * reduceWhile(\n * [1, 2, 3, -1, 5],\n * (acc, n) => n >= 0,\n * (acc, n) => acc + n,\n * 0,\n * )\n * // 6\n * ```\n */\nexport function reduceWhile<T, R>(\n array: readonly T[],\n predicate: (accumulator: R, value: T) => boolean,\n fn: (accumulator: R, value: T, index: number) => R,\n initial: R\n): R {\n // oxlint-disable-next-line functional/no-let -- iterative impl avoids stack overflow on large arrays\n let acc = initial\n // oxlint-disable-next-line functional/no-let -- iterative impl avoids stack overflow on large arrays\n for (let index = 0; index < array.length; index += 1) {\n // oxlint-disable-next-line security/detect-object-injection -- Locally computed numeric array index\n const value = array[index]\n if (!predicate(acc, value)) {\n return acc\n }\n acc = fn(acc, value, index)\n }\n return acc\n}\n","/**\n * Like `reduce` but returns an array of all intermediate accumulator values.\n *\n * The result array starts with the initial value and ends with the final\n * accumulator, so its length is `array.length + 1`.\n *\n * @example\n * ```ts\n * scan([1, 2, 3, 4], (acc, n) => acc + n, 0)\n * // [0, 1, 3, 6, 10]\n * ```\n */\nexport function scan<T, R>(\n array: readonly T[],\n fn: (accumulator: R, value: T, index: number) => R,\n initial: R\n): R[] {\n return array.reduce<R[]>(\n (result, item, index) => {\n const prev = result[result.length - 1]\n result.push(fn(prev, item, index))\n return result\n },\n [initial]\n )\n}\n","/**\n * Creates an ascending comparator from an accessor function.\n *\n * @example\n * ```ts\n * users.sort(ascend(u => u.name))\n * ```\n */\nexport function ascend<T>(fn: (value: T) => number | string): (a: T, b: T) => number {\n return (a: T, b: T) => {\n const aa = fn(a)\n const bb = fn(b)\n if (aa < bb) {\n return -1\n }\n if (aa > bb) {\n return 1\n }\n return 0\n }\n}\n\n/**\n * Creates a descending comparator from an accessor function.\n *\n * @example\n * ```ts\n * users.sort(descend(u => u.age))\n * ```\n */\nexport function descend<T>(fn: (value: T) => number | string): (a: T, b: T) => number {\n return (a: T, b: T) => {\n const aa = fn(a)\n const bb = fn(b)\n if (aa > bb) {\n return -1\n }\n if (aa < bb) {\n return 1\n }\n return 0\n }\n}\n\n/**\n * Sorts an array using multiple comparators in priority order.\n *\n * The first comparator has highest priority. When it returns 0 (tie),\n * the next comparator is used, and so on.\n *\n * @example\n * ```ts\n * sortWith(users, [\n * ascend(u => u.department),\n * descend(u => u.age),\n * ])\n * ```\n */\nexport function sortWith<T>(\n array: readonly T[],\n comparators: ReadonlyArray<(a: T, b: T) => number>\n): T[] {\n return [...array].toSorted((a, b) => {\n for (const cmp of comparators) {\n const result = cmp(a, b)\n if (result !== 0) {\n return result\n }\n }\n return 0\n })\n}\n","/**\n * Builds an array from a seed value using an iterator function.\n *\n * The iterator receives the current seed and returns either a `[value, nextSeed]`\n * tuple to continue, or `false` to stop.\n *\n * Dual of `reduce` — reduce collapses a list into a value, unfold expands\n * a value into a list.\n *\n * **Termination is the caller's responsibility.** If `fn` never returns\n * `false`, `unfold` will run until memory is exhausted. For bounded\n * generation, encode a counter or limit into the seed.\n *\n * @example\n * ```ts\n * unfold((n) => (n > 0 ? [n, n - 1] : false), 5)\n * // [5, 4, 3, 2, 1]\n * ```\n */\nexport function unfold<T, R>(fn: (seed: T) => [R, T] | false, seed: T): R[] {\n const result: R[] = []\n // oxlint-disable-next-line functional/no-let -- iterative impl avoids stack overflow on large outputs\n let current = seed\n // oxlint-disable-next-line functional/no-let -- iterative impl avoids stack overflow on large outputs\n let pair = fn(current)\n while (pair !== false) {\n result.push(pair[0])\n current = pair[1]\n pair = fn(current)\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAgB,OAAU,OAAqB,OAAe,IAA0B;CACtF,MAAM,SAAS,CAAC,GAAG,KAAK;CACxB,IAAI,SAAS,KAAK,QAAQ,MAAM,QAE9B,OAAO,SAAS,GAAG,OAAO,MAAM;CAElC,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;ACDA,SAAgB,YAAe,OAA0B;CACvD,OAAO,MAAM,QAAa,KAAK,MAAM,UAAU;EA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;;;;;;;;;;;;;;;;;;;;ACpDA,SAAgB,OAAa,IAAiC,MAAc;CAC1E,MAAM,SAAc,CAAC;CAErB,IAAI,UAAU;CAEd,IAAI,OAAO,GAAG,OAAO;CACrB,OAAO,SAAS,OAAO;EACrB,OAAO,KAAK,KAAK,EAAE;EACnB,UAAU,KAAK;EACf,OAAO,GAAG,OAAO;CACnB;CACA,OAAO;AACT"}
|
package/dist/control/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as Ok, r as Result, t as Err } from "../types-
|
|
2
|
-
import { a as
|
|
3
|
-
export { Err, Ok, Result, assert, attempt, attemptAsync, err, invariant, isErr, isOk, ok, unwrap };
|
|
1
|
+
import { n as Ok, r as Result, t as Err } from "../types-BsimcHZS.mjs";
|
|
2
|
+
import { a as todo, c as isOk, d as attempt, f as attemptAsync, i as unimplemented, l as ok, n as invariant, o as err, r as unreachable, s as isErr, t as assert, u as unwrap } from "../index-DKEiLKtl.mjs";
|
|
3
|
+
export { type Err, type Ok, type Result, assert, attempt, attemptAsync, err, invariant, isErr, isOk, ok, todo, unimplemented, unreachable, unwrap };
|
package/dist/control/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { assert, attempt, attemptAsync, err, invariant, isErr, isOk, ok, unwrap };
|
|
1
|
+
import { a as todo, c as err, d as ok, f as unwrap, i as unimplemented, l as isErr, n as invariant, o as attempt, r as unreachable, s as attemptAsync, t as assert, u as isOk } from "../control-DCdm8IH6.mjs";
|
|
2
|
+
export { assert, attempt, attemptAsync, err, invariant, isErr, isOk, ok, todo, unimplemented, unreachable, unwrap };
|
|
@@ -159,6 +159,85 @@ async function attemptAsync(fn) {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
-
|
|
162
|
+
//#region src/control/todo.ts
|
|
163
|
+
/**
|
|
164
|
+
* Stub for a code path you intend to write but haven't. Throws at runtime,
|
|
165
|
+
* returns `never` so it typechecks in any position.
|
|
166
|
+
*
|
|
167
|
+
* For paths you intentionally don't support, see `unimplemented`.
|
|
168
|
+
* For paths that should be impossible, see `unreachable`.
|
|
169
|
+
*
|
|
170
|
+
* @param message - Optional context appended to the thrown error
|
|
171
|
+
* @returns Never returns — always throws
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* function parseConfig(raw: string): Config {
|
|
176
|
+
* return todo('waiting on schema decision')
|
|
177
|
+
* }
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
function todo(message) {
|
|
181
|
+
if (isNil(message)) throw new Error("not yet implemented");
|
|
182
|
+
throw new Error(`not yet implemented: ${message}`);
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/control/unimplemented.ts
|
|
186
|
+
/**
|
|
187
|
+
* Marks a code path as intentionally unsupported. Throws at runtime, returns
|
|
188
|
+
* `never` so it typechecks in any position.
|
|
189
|
+
*
|
|
190
|
+
* For work you plan to finish later, see `todo`.
|
|
191
|
+
* For paths that should be impossible, see `unreachable`.
|
|
192
|
+
*
|
|
193
|
+
* @param message - Optional context appended to the thrown error
|
|
194
|
+
* @returns Never returns — always throws
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* type Driver = 'postgres' | 'sqlite' | 'mysql'
|
|
199
|
+
*
|
|
200
|
+
* function migrate(driver: Driver): void {
|
|
201
|
+
* return match(driver)
|
|
202
|
+
* .with('postgres', runPgMigration)
|
|
203
|
+
* .with('sqlite', runSqliteMigration)
|
|
204
|
+
* .with('mysql', () => unimplemented('mysql driver intentionally unsupported'))
|
|
205
|
+
* .exhaustive()
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
function unimplemented(message) {
|
|
210
|
+
if (isNil(message)) throw new Error("not implemented");
|
|
211
|
+
throw new Error(`not implemented: ${message}`);
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/control/unreachable.ts
|
|
215
|
+
/**
|
|
216
|
+
* Marks a code path as logically impossible. Throws at runtime if execution
|
|
217
|
+
* gets there. Returns `never` so it typechecks in any position.
|
|
218
|
+
*
|
|
219
|
+
* For work you plan to finish later, see `todo`.
|
|
220
|
+
* For paths you intentionally don't support, see `unimplemented`.
|
|
221
|
+
*
|
|
222
|
+
* @param message - Optional context appended to the thrown error
|
|
223
|
+
* @returns Never returns — always throws
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```ts
|
|
227
|
+
* function parseDigit(input: string): number {
|
|
228
|
+
* const parsed = Number.parseInt(input, 10)
|
|
229
|
+
* if (Number.isNaN(parsed)) {
|
|
230
|
+
* return unreachable('caller pre-validated')
|
|
231
|
+
* }
|
|
232
|
+
* return parsed
|
|
233
|
+
* }
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
function unreachable(message) {
|
|
237
|
+
if (isNil(message)) throw new Error("entered unreachable code");
|
|
238
|
+
throw new Error(`entered unreachable code: ${message}`);
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
export { todo as a, err as c, ok as d, unwrap as f, unimplemented as i, isErr as l, invariant as n, attempt as o, unreachable as r, attemptAsync as s, assert as t, isOk as u };
|
|
163
242
|
|
|
164
|
-
//# sourceMappingURL=control-
|
|
243
|
+
//# sourceMappingURL=control-DCdm8IH6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-DCdm8IH6.mjs","names":[],"sources":["../src/control/result.ts","../src/control/attempt.ts","../src/control/todo.ts","../src/control/unimplemented.ts","../src/control/unreachable.ts"],"sourcesContent":["import { isNil } from 'es-toolkit/predicate'\n\nimport type { Err, Ok, Result } from './types.js'\n\n/**\n * Minimal error coercion used internally by `err()`. Kept local to avoid\n * pulling the full conversion module into the `massaman/control` bundle.\n * For richer stringification (Maps, Sets, Errors with own props, circular\n * refs), import `toError` from `massaman/conversion`.\n */\nfunction coerceError(thrown: unknown): Error {\n if (thrown instanceof Error) {\n return thrown\n }\n if (typeof thrown === 'string') {\n return new Error(thrown)\n }\n try {\n const message = JSON.stringify(thrown) ?? String(thrown)\n return new Error(message, { cause: thrown })\n } catch {\n return new Error(String(thrown), { cause: thrown })\n }\n}\n\n/**\n * Creates a success result wrapping the given value.\n *\n * @param value - The success value\n * @returns An `Ok` result containing the value\n *\n * @example\n * ```ts\n * const result = ok(42)\n * // { ok: true, value: 42 }\n * ```\n */\nexport function ok<T>(value: T): Ok<T> {\n return { ok: true, value, error: null }\n}\n\n/**\n * Creates a failure result wrapping the given error.\n *\n * @param error - The error value\n * @returns An `Err` result containing the error\n *\n * @example\n * ```ts\n * const result = err(new Error('fail'))\n * // { ok: false, error: Error('fail') }\n * ```\n */\nexport function err(error: unknown): Err {\n return { ok: false, value: null, error: coerceError(error) }\n}\n\n/**\n * Type guard that narrows a `Result` to `Ok`.\n *\n * @param result - The result to check\n * @returns `true` if the result is `Ok`\n *\n * @example\n * ```ts\n * const result = attempt(() => JSON.parse('{}'))\n * if (isOk(result)) {\n * console.log(result.value)\n * }\n * ```\n */\nexport function isOk<T>(result: Result<T>): result is Ok<T> {\n return result.ok === true\n}\n\n/**\n * Type guard that narrows a `Result` to `Err`.\n *\n * @param result - The result to check\n * @returns `true` if the result is `Err`\n *\n * @example\n * ```ts\n * const result = attempt(() => JSON.parse('bad'))\n * if (isErr(result)) {\n * console.error(result.error)\n * }\n * ```\n */\nexport function isErr<T>(result: Result<T>): result is Err {\n return result.ok === false\n}\n\n/**\n * Extract the value from an `Ok` result, or throw on `Err`.\n *\n * When called without a message, throws the original error.\n * When called with a message, throws a new Error with that message\n * and the original error as `cause` (like Rust's `expect`).\n *\n * @param result - The result to unwrap\n * @param message - Optional custom error message (Rust `expect` behavior)\n * @returns The unwrapped value\n *\n * @example\n * ```ts\n * const value = unwrap(ok(42)) // 42\n * unwrap(err('fail')) // throws Error('fail')\n * unwrap(err('fail'), 'config required') // throws Error('config required', { cause: Error('fail') })\n * ```\n */\nexport function unwrap<T>(result: Result<T>, message?: string): T {\n if (result.ok) {\n return result.value\n }\n if (!isNil(message)) {\n throw new Error(message, { cause: result.error })\n }\n throw result.error\n}\n","import { err, ok } from './result.js'\nimport type { Result } from './types.js'\n\n/**\n * Executes a synchronous function and wraps the outcome in a `Result`.\n * Returns `Ok` with the return value on success, `Err` with the thrown value on failure.\n *\n * @param fn - The function to execute\n * @returns A `Result` containing either the value or the error\n *\n * @example\n * ```ts\n * const result = attempt(() => JSON.parse('{\"a\":1}'))\n * if (isOk(result)) {\n * console.log(result.value) // { a: 1 }\n * }\n * ```\n */\nexport function attempt<T>(fn: () => T): Result<T> {\n try {\n return ok(fn())\n } catch (error) {\n return err(error)\n }\n}\n\n/**\n * Executes an asynchronous function and wraps the outcome in a `Result`.\n * Returns `Ok` with the resolved value on success, `Err` with the rejection reason on failure.\n *\n * @param fn - The async function to execute\n * @returns A promise resolving to a `Result` containing either the value or the error\n *\n * @example\n * ```ts\n * const result = await attemptAsync(() => fetch('/api/data'))\n * if (isErr(result)) {\n * console.error(result.error)\n * }\n * ```\n */\nexport async function attemptAsync<T>(fn: () => Promise<T>): Promise<Result<T>> {\n try {\n return ok(await fn())\n } catch (error) {\n return err(error)\n }\n}\n","import { isNil } from 'es-toolkit/predicate'\n\n/**\n * Stub for a code path you intend to write but haven't. Throws at runtime,\n * returns `never` so it typechecks in any position.\n *\n * For paths you intentionally don't support, see `unimplemented`.\n * For paths that should be impossible, see `unreachable`.\n *\n * @param message - Optional context appended to the thrown error\n * @returns Never returns — always throws\n *\n * @example\n * ```ts\n * function parseConfig(raw: string): Config {\n * return todo('waiting on schema decision')\n * }\n * ```\n */\nexport function todo(message?: string): never {\n if (isNil(message)) {\n throw new Error('not yet implemented')\n }\n throw new Error(`not yet implemented: ${message}`)\n}\n","import { isNil } from 'es-toolkit/predicate'\n\n/**\n * Marks a code path as intentionally unsupported. Throws at runtime, returns\n * `never` so it typechecks in any position.\n *\n * For work you plan to finish later, see `todo`.\n * For paths that should be impossible, see `unreachable`.\n *\n * @param message - Optional context appended to the thrown error\n * @returns Never returns — always throws\n *\n * @example\n * ```ts\n * type Driver = 'postgres' | 'sqlite' | 'mysql'\n *\n * function migrate(driver: Driver): void {\n * return match(driver)\n * .with('postgres', runPgMigration)\n * .with('sqlite', runSqliteMigration)\n * .with('mysql', () => unimplemented('mysql driver intentionally unsupported'))\n * .exhaustive()\n * }\n * ```\n */\nexport function unimplemented(message?: string): never {\n if (isNil(message)) {\n throw new Error('not implemented')\n }\n throw new Error(`not implemented: ${message}`)\n}\n","import { isNil } from 'es-toolkit/predicate'\n\n/**\n * Marks a code path as logically impossible. Throws at runtime if execution\n * gets there. Returns `never` so it typechecks in any position.\n *\n * For work you plan to finish later, see `todo`.\n * For paths you intentionally don't support, see `unimplemented`.\n *\n * @param message - Optional context appended to the thrown error\n * @returns Never returns — always throws\n *\n * @example\n * ```ts\n * function parseDigit(input: string): number {\n * const parsed = Number.parseInt(input, 10)\n * if (Number.isNaN(parsed)) {\n * return unreachable('caller pre-validated')\n * }\n * return parsed\n * }\n * ```\n */\nexport function unreachable(message?: string): never {\n if (isNil(message)) {\n throw new Error('entered unreachable code')\n }\n throw new Error(`entered unreachable code: ${message}`)\n}\n"],"mappings":";;;;;;;;;AAUA,SAAS,YAAY,QAAwB;CAC3C,IAAI,kBAAkB,OACpB,OAAO;CAET,IAAI,OAAO,WAAW,UACpB,OAAO,IAAI,MAAM,MAAM;CAEzB,IAAI;EACF,MAAM,UAAU,KAAK,UAAU,MAAM,KAAK,OAAO,MAAM;EACvD,OAAO,IAAI,MAAM,SAAS,EAAE,OAAO,OAAO,CAAC;CAC7C,QAAQ;EACN,OAAO,IAAI,MAAM,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC;CACpD;AACF;;;;;;;;;;;;;AAcA,SAAgB,GAAM,OAAiB;CACrC,OAAO;EAAE,IAAI;EAAM;EAAO,OAAO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;AACxD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "../index-
|
|
1
|
+
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "../index-C7dxY5U-.mjs";
|
|
2
2
|
export { stringify, toArray, toBoolean, toError, toFinite, toInteger, toNumber, toString };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "../conversion-
|
|
1
|
+
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "../conversion-BB912-15.mjs";
|
|
2
2
|
export { stringify, toArray, toBoolean, toError, toFinite, toInteger, toNumber, toString };
|
|
@@ -186,4 +186,4 @@ function toBoolean(value) {
|
|
|
186
186
|
//#endregion
|
|
187
187
|
export { toFinite as a, toString as c, toError as i, toArray as n, toInteger as o, toBoolean as r, toNumber as s, stringify as t };
|
|
188
188
|
|
|
189
|
-
//# sourceMappingURL=conversion-
|
|
189
|
+
//# sourceMappingURL=conversion-BB912-15.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversion-
|
|
1
|
+
{"version":3,"file":"conversion-BB912-15.mjs","names":[],"sources":["../src/conversion/convert.ts"],"sourcesContent":["import { isError, isMap, isNil, isPrimitive, isSet, isString } from 'es-toolkit/predicate'\n\n/**\n * Coerces an unknown thrown value into a proper `Error` instance.\n *\n * Handles the common cases where libraries throw non-`Error` values\n * (e.g. plain API response bodies, arrays, Maps) that would otherwise\n * serialize as `[object Object]` in error messages.\n *\n * @param thrown - The caught value from a `catch` block.\n * @returns An `Error` with a meaningful `.message`. If `thrown` is\n * already an `Error`, it is returned as-is. The original value is\n * preserved as `.cause` for debugging.\n *\n * @example\n * ```ts\n * try {\n * await riskyCall()\n * } catch (thrown) {\n * const error = toError(thrown)\n * console.error(error.message)\n * }\n * ```\n */\nexport function toError(thrown: unknown): Error {\n if (isError(thrown)) {\n return thrown\n }\n if (isString(thrown)) {\n return new Error(thrown)\n }\n return new Error(stringify(thrown), { cause: thrown })\n}\n\n/**\n * Produces a human-readable string from any unknown value.\n *\n * Uses `JSON.stringify` for structured types (plain objects, arrays)\n * so the message contains actual content instead of `[object Object]`.\n * Maps and Sets are converted to their array representation first.\n * Falls back to `String()` for primitives or when serialization fails\n * (e.g. circular references).\n *\n * @param value - The value to stringify.\n * @returns A meaningful string representation.\n *\n * @example\n * ```ts\n * stringify({ status: 400 }) // '{\"status\":400}'\n * stringify(new Map([['k', 'v']])) // '[[\"k\",\"v\"]]'\n * stringify(null) // 'null'\n * stringify(42) // '42'\n * ```\n */\nexport function stringify(value: unknown): string {\n if (isNil(value) || isPrimitive(value)) {\n return String(value)\n }\n try {\n return JSON.stringify(toSerializable(value))\n } catch {\n return String(value)\n }\n}\n\n/**\n * Convert types that `JSON.stringify` handles poorly into\n * serializable equivalents, recursively walking objects and arrays.\n *\n * - `Map` -> array of `[key, value]` entries (recursed)\n * - `Set` -> array of values (recursed)\n * - `Error` -> plain object with `name`, `message`, `stack`, and enumerable props\n * - Arrays and plain objects are recursed\n * - Uses a `WeakSet` to detect and break circular references\n */\nfunction toSerializable(value: unknown, seen: WeakSet<object> = new WeakSet()): unknown {\n if (isNil(value) || isPrimitive(value)) {\n return value\n }\n\n const obj = value as object\n if (seen.has(obj)) {\n return '[Circular]'\n }\n seen.add(obj)\n\n if (isError(value)) {\n const errorObj: Record<string, unknown> = {\n name: value.name,\n message: value.message,\n stack: value.stack,\n }\n for (const key of Object.keys(value)) {\n // oxlint-disable-next-line security/detect-object-injection -- safe: key from Object.keys\n errorObj[key] = toSerializable((value as unknown as Record<string, unknown>)[key], seen)\n }\n return errorObj\n }\n\n if (isMap(value)) {\n return Array.from(value.entries()).map(([k, v]) => [\n toSerializable(k, seen),\n toSerializable(v, seen),\n ])\n }\n\n if (isSet(value)) {\n return Array.from(value).map((v) => toSerializable(v, seen))\n }\n\n if (Array.isArray(value)) {\n return value.map((v) => toSerializable(v, seen))\n }\n\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(value as Record<string, unknown>)) {\n // oxlint-disable-next-line security/detect-object-injection -- safe: key from Object.keys\n result[key] = toSerializable((value as Record<string, unknown>)[key], seen)\n }\n return result\n}\n\n/**\n * Converts a value to a number.\n *\n * Thin wrapper over `Number(value)` — kept as a stable surface so callers\n * don't depend directly on the global constructor's semantics (which have\n * shifted in the past, e.g. `Number(BigInt)`, and may again).\n *\n * @example\n * ```ts\n * toNumber('42') // 42\n * toNumber(null) // 0\n * ```\n */\nexport function toNumber(value: unknown): number {\n return Number(value)\n}\n\n/**\n * Converts a value to a string.\n *\n * Thin wrapper over `String(value)` — kept as a stable surface against\n * future global-constructor changes.\n *\n * @example\n * ```ts\n * toString(42) // '42'\n * toString(null) // 'null'\n * ```\n */\nexport function toString(value: unknown): string {\n return String(value)\n}\n\n/**\n * Converts a value to an integer by calling {@link toNumber} and truncating.\n *\n * @example\n * ```ts\n * toInteger('4.9') // 4\n * toInteger(null) // 0\n * ```\n */\nexport function toInteger(value: unknown): number {\n return Math.trunc(toNumber(value))\n}\n\n/**\n * Converts a value to a finite number.\n *\n * Returns `0` for non-finite results (`NaN`, `Infinity`, `-Infinity`).\n *\n * @example\n * ```ts\n * toFinite('3.14') // 3.14\n * toFinite(Infinity) // 0\n * ```\n */\nexport function toFinite(value: unknown): number {\n const n = Number(value)\n if (Number.isFinite(n)) {\n return n\n }\n return 0\n}\n\n/**\n * Converts a value to an array.\n *\n * - Arrays are returned as-is.\n * - Iterables (strings, Sets, Maps) are spread into an array.\n * - `null` / `undefined` return `[]`.\n * - All other values are wrapped in a single-element array.\n *\n * @example\n * ```ts\n * toArray(new Set([1, 2])) // [1, 2]\n * toArray('abc') // ['a', 'b', 'c']\n * toArray(null) // []\n * toArray(42) // [42]\n * ```\n */\nexport function toArray<T>(value: Iterable<T> | T | null | undefined): T[] {\n if (value == null) {\n return []\n }\n if (Array.isArray(value)) {\n return value as T[]\n }\n if (typeof (value as unknown as Record<symbol, unknown>)[Symbol.iterator] === 'function') {\n return Array.from(value as Iterable<T>)\n }\n return [value as T]\n}\n\n/**\n * Converts a value to a boolean.\n *\n * Thin wrapper over `Boolean(value)` — kept as a stable surface against\n * future global-constructor changes.\n *\n * @example\n * ```ts\n * toBoolean(1) // true\n * toBoolean(0) // false\n * toBoolean('') // false\n * ```\n */\nexport function toBoolean(value: unknown): boolean {\n return Boolean(value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,QAAQ,QAAwB;CAC9C,IAAI,QAAQ,MAAM,GAChB,OAAO;CAET,IAAI,SAAS,MAAM,GACjB,OAAO,IAAI,MAAM,MAAM;CAEzB,OAAO,IAAI,MAAM,UAAU,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC;AACvD;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,UAAU,OAAwB;CAChD,IAAI,MAAM,KAAK,KAAK,YAAY,KAAK,GACnC,OAAO,OAAO,KAAK;CAErB,IAAI;EACF,OAAO,KAAK,UAAU,eAAe,KAAK,CAAC;CAC7C,QAAQ;EACN,OAAO,OAAO,KAAK;CACrB;AACF;;;;;;;;;;;AAYA,SAAS,eAAe,OAAgB,uBAAwB,IAAI,QAAQ,GAAY;CACtF,IAAI,MAAM,KAAK,KAAK,YAAY,KAAK,GACnC,OAAO;CAGT,MAAM,MAAM;CACZ,IAAI,KAAK,IAAI,GAAG,GACd,OAAO;CAET,KAAK,IAAI,GAAG;CAEZ,IAAI,QAAQ,KAAK,GAAG;EAClB,MAAM,WAAoC;GACxC,MAAM,MAAM;GACZ,SAAS,MAAM;GACf,OAAO,MAAM;EACf;EACA,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAEjC,SAAS,OAAO,eAAgB,MAA6C,MAAM,IAAI;EAEzF,OAAO;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act, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith } from "es-toolkit/fp";
|
|
2
|
+
export { type WindowedOptions, add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith } from "es-toolkit/fp";
|
|
2
|
+
export { add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as unless, C as retry, D as flowAsync, E as unary, M as call, N as callAsync, O as tap, S as rest, T as throttle, _ as negate, a as ThrottledFunction, b as partial, c as asyncNoop, d as curryRight, f as debounce, g as memoize, h as identity, i as ThrottleOptions, j as when, k as ifElse, l as before, m as flowRight, n as DebouncedFunction, o as after, p as flow, r as MemoizeCache, s as ary, t as DebounceOptions, u as curry, v as noop, w as spread, x as partialRight, y as once } from "../index-
|
|
2
|
-
export { DebounceOptions, DebouncedFunction, MemoizeCache, ThrottleOptions, ThrottledFunction, after, ary, asyncNoop, before, call, callAsync, curry, curryRight, debounce, flow, flowAsync, flowRight, identity, ifElse, memoize, negate, noop, once, partial, partialRight, rest, retry, spread, tap, throttle, unary, unless, when };
|
|
1
|
+
import { A as unless, C as retry, D as flowAsync, E as unary, M as call, N as callAsync, O as tap, S as rest, T as throttle, _ as negate, a as ThrottledFunction, b as partial, c as asyncNoop, d as curryRight, f as debounce, g as memoize, h as identity, i as ThrottleOptions, j as when, k as ifElse, l as before, m as flowRight, n as DebouncedFunction, o as after, p as flow, r as MemoizeCache, s as ary, t as DebounceOptions, u as curry, v as noop, w as spread, x as partialRight, y as once } from "../index-CoCKuspw.mjs";
|
|
2
|
+
export { type DebounceOptions, type DebouncedFunction, type MemoizeCache, type ThrottleOptions, type ThrottledFunction, after, ary, asyncNoop, before, call, callAsync, curry, curryRight, debounce, flow, flowAsync, flowRight, identity, ifElse, memoize, negate, noop, once, partial, partialRight, rest, retry, spread, tap, throttle, unary, unless, when };
|
package/dist/function/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as tap, D as call, E as when, O as callAsync, S as flowAsync, T as unless, _ as rest, a as curry, b as throttle, c as flow, d as memoize, f as negate, g as partialRight, h as partial, i as before, l as flowRight, m as once, n as ary, o as curryRight, p as noop, r as asyncNoop, s as debounce, t as after, u as identity, v as retry, w as ifElse, x as unary, y as spread } from "../function-
|
|
1
|
+
import { C as tap, D as call, E as when, O as callAsync, S as flowAsync, T as unless, _ as rest, a as curry, b as throttle, c as flow, d as memoize, f as negate, g as partialRight, h as partial, i as before, l as flowRight, m as once, n as ary, o as curryRight, p as noop, r as asyncNoop, s as debounce, t as after, u as identity, v as retry, w as ifElse, x as unary, y as spread } from "../function-Brosl7-Y.mjs";
|
|
2
2
|
export { after, ary, asyncNoop, before, call, callAsync, curry, curryRight, debounce, flow, flowAsync, flowRight, identity, ifElse, memoize, negate, noop, once, partial, partialRight, rest, retry, spread, tap, throttle, unary, unless, when };
|
|
@@ -119,4 +119,4 @@ function flowAsync(first, ...rest) {
|
|
|
119
119
|
//#endregion
|
|
120
120
|
export { tap as C, call as D, when as E, callAsync as O, flowAsync as S, unless as T, rest as _, curry as a, throttle as b, flow as c, memoize as d, negate as f, partialRight as g, partial as h, before as i, flowRight as l, once as m, ary as n, curryRight as o, noop as p, asyncNoop as r, debounce as s, after as t, identity as u, retry as v, ifElse as w, unary as x, spread as y };
|
|
121
121
|
|
|
122
|
-
//# sourceMappingURL=function-
|
|
122
|
+
//# sourceMappingURL=function-Brosl7-Y.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-
|
|
1
|
+
{"version":3,"file":"function-Brosl7-Y.mjs","names":[],"sources":["../src/function/call.ts","../src/function/branching.ts","../src/function/tap.ts","../src/function/flowAsync.ts"],"sourcesContent":["/**\n * Invokes a function with the provided arguments and returns the result.\n *\n * Equivalent to `fn(...args)` — exists as a stable, named surface for the\n * \"apply function to args\" operation. Use inside `.map(call)` over arrays\n * of thunks, or anywhere a value-position function-call is clearer than an\n * inline arrow.\n *\n * @example\n * ```ts\n * call(Math.max, 1, 2, 3) // 3\n * [getUser, getAccount, getPrefs].map((fn) => call(fn))\n * ```\n */\nexport function call<A extends readonly unknown[], R>(fn: (...args: A) => R, ...args: A): R {\n return fn(...args)\n}\n\n/**\n * Invokes a function returning a Promise with the provided arguments.\n *\n * Async-typed sibling of {@link call} — equivalent to `fn(...args)` for\n * promise-returning functions, but the signature constrains the return to\n * `Promise<R>` so it composes cleanly inside async pipelines.\n *\n * @example\n * ```ts\n * const user = await callAsync(fetchUser, 'user-123')\n * ```\n */\nexport async function callAsync<A extends readonly unknown[], R>(\n fn: (...args: A) => Promise<R>,\n ...args: A\n): Promise<R> {\n return fn(...args)\n}\n","/**\n * Returns a function that applies a transform only when a predicate passes,\n * otherwise returns the value unchanged.\n *\n * @example\n * ```ts\n * const trimIfString = when(isString, (s: string) => s.trim())\n * trimIfString(' hello ') // 'hello'\n * ```\n */\nexport function when<T>(predicate: (value: T) => boolean, fn: (value: T) => T): (value: T) => T {\n return (value: T) => {\n if (predicate(value)) {\n return fn(value)\n }\n return value\n }\n}\n\n/**\n * Returns a function that applies a transform only when a predicate fails,\n * otherwise returns the value unchanged.\n *\n * Complement of {@link when}.\n *\n * @example\n * ```ts\n * const ensureArray = unless(Array.isArray, (v) => [v])\n * ensureArray(42) // [42]\n * ensureArray([1]) // [1]\n * ```\n */\nexport function unless<T>(predicate: (value: T) => boolean, fn: (value: T) => T): (value: T) => T {\n return (value: T) => {\n if (predicate(value)) {\n return value\n }\n return fn(value)\n }\n}\n\n/**\n * Returns a function that branches between two functions based on a predicate.\n *\n * @example\n * ```ts\n * const format = ifElse(\n * (n: number) => n > 0,\n * (n) => `+${n}`,\n * (n) => `${n}`,\n * )\n * format(5) // '+5'\n * format(-3) // '-3'\n * ```\n */\nexport function ifElse<T, R>(\n predicate: (value: T) => boolean,\n onTrue: (value: T) => R,\n onFalse: (value: T) => R\n): (value: T) => R {\n return (value: T) => {\n if (predicate(value)) {\n return onTrue(value)\n }\n return onFalse(value)\n }\n}\n","/**\n * Returns a function that runs a side-effect and returns the value unchanged.\n *\n * Useful for debugging inside `flow` pipelines without breaking the chain.\n *\n * @example\n * ```ts\n * const process = flow(\n * fetchUsers,\n * tap(users => console.log('count:', users.length)),\n * filterActive,\n * )\n * ```\n */\nexport function tap<T>(fn: (value: T) => unknown): (value: T) => T {\n return (value: T) => {\n fn(value)\n return value\n }\n}\n","import type { DangerouslyAllowAny } from '../types/internal.js'\n\ntype MaybePromise<T> = T | Promise<T>\n\n/**\n * Creates an async pipeline that awaits each step before passing the result\n * to the next function. Like {@link flow} from es-toolkit but async-aware.\n *\n * Each function can return a value or a Promise — `flowAsync` always returns\n * a Promise that resolves to the final step's awaited result.\n *\n * @example\n * ```ts\n * const getUsername = flowAsync(\n * (id: string) => fetchUser(id), // Promise<User>\n * (user) => user.name, // string\n * (name) => name.toUpperCase(),\n * )\n * await getUsername('123') // 'ALICE'\n * ```\n */\nexport function flowAsync<A extends readonly unknown[], R1>(\n f1: (...args: A) => MaybePromise<R1>\n): (...args: A) => Promise<Awaited<R1>>\nexport function flowAsync<A extends readonly unknown[], R1, R2>(\n f1: (...args: A) => MaybePromise<R1>,\n f2: (a: Awaited<R1>) => MaybePromise<R2>\n): (...args: A) => Promise<Awaited<R2>>\nexport function flowAsync<A extends readonly unknown[], R1, R2, R3>(\n f1: (...args: A) => MaybePromise<R1>,\n f2: (a: Awaited<R1>) => MaybePromise<R2>,\n f3: (a: Awaited<R2>) => MaybePromise<R3>\n): (...args: A) => Promise<Awaited<R3>>\nexport function flowAsync<A extends readonly unknown[], R1, R2, R3, R4>(\n f1: (...args: A) => MaybePromise<R1>,\n f2: (a: Awaited<R1>) => MaybePromise<R2>,\n f3: (a: Awaited<R2>) => MaybePromise<R3>,\n f4: (a: Awaited<R3>) => MaybePromise<R4>\n): (...args: A) => Promise<Awaited<R4>>\nexport function flowAsync<A extends readonly unknown[], R1, R2, R3, R4, R5>(\n f1: (...args: A) => MaybePromise<R1>,\n f2: (a: Awaited<R1>) => MaybePromise<R2>,\n f3: (a: Awaited<R2>) => MaybePromise<R3>,\n f4: (a: Awaited<R3>) => MaybePromise<R4>,\n f5: (a: Awaited<R4>) => MaybePromise<R5>\n): (...args: A) => Promise<Awaited<R5>>\nexport function flowAsync<A extends readonly unknown[], R1, R2, R3, R4, R5, R6>(\n f1: (...args: A) => MaybePromise<R1>,\n f2: (a: Awaited<R1>) => MaybePromise<R2>,\n f3: (a: Awaited<R2>) => MaybePromise<R3>,\n f4: (a: Awaited<R3>) => MaybePromise<R4>,\n f5: (a: Awaited<R4>) => MaybePromise<R5>,\n f6: (a: Awaited<R5>) => MaybePromise<R6>\n): (...args: A) => Promise<Awaited<R6>>\nexport function flowAsync<A extends readonly unknown[], R1, R2, R3, R4, R5, R6, R7>(\n f1: (...args: A) => MaybePromise<R1>,\n f2: (a: Awaited<R1>) => MaybePromise<R2>,\n f3: (a: Awaited<R2>) => MaybePromise<R3>,\n f4: (a: Awaited<R3>) => MaybePromise<R4>,\n f5: (a: Awaited<R4>) => MaybePromise<R5>,\n f6: (a: Awaited<R5>) => MaybePromise<R6>,\n f7: (a: Awaited<R6>) => MaybePromise<R7>\n): (...args: A) => Promise<Awaited<R7>>\nexport function flowAsync(\n first: (...args: readonly DangerouslyAllowAny[]) => unknown,\n ...rest: ReadonlyArray<(arg: DangerouslyAllowAny) => unknown>\n): (...args: readonly unknown[]) => Promise<unknown> {\n return async (...args: readonly unknown[]) =>\n rest.reduce<Promise<unknown>>(async (acc, fn) => fn(await acc), Promise.resolve(first(...args)))\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,SAAgB,KAAsC,IAAuB,GAAG,MAAY;CAC1F,OAAO,GAAG,GAAG,IAAI;AACnB;;;;;;;;;;;;;AAcA,eAAsB,UACpB,IACA,GAAG,MACS;CACZ,OAAO,GAAG,GAAG,IAAI;AACnB;;;;;;;;;;;;;ACzBA,SAAgB,KAAQ,WAAkC,IAAsC;CAC9F,QAAQ,UAAa;EACnB,IAAI,UAAU,KAAK,GACjB,OAAO,GAAG,KAAK;EAEjB,OAAO;CACT;AACF;;;;;;;;;;;;;;AAeA,SAAgB,OAAU,WAAkC,IAAsC;CAChG,QAAQ,UAAa;EACnB,IAAI,UAAU,KAAK,GACjB,OAAO;EAET,OAAO,GAAG,KAAK;CACjB;AACF;;;;;;;;;;;;;;;AAgBA,SAAgB,OACd,WACA,QACA,SACiB;CACjB,QAAQ,UAAa;EACnB,IAAI,UAAU,KAAK,GACjB,OAAO,OAAO,KAAK;EAErB,OAAO,QAAQ,KAAK;CACtB;AACF;;;;;;;;;;;;;;;;;ACpDA,SAAgB,IAAO,IAA4C;CACjE,QAAQ,UAAa;EACnB,GAAG,KAAK;EACR,OAAO;CACT;AACF;;;AC4CA,SAAgB,UACd,OACA,GAAG,MACgD;CACnD,OAAO,OAAO,GAAG,SACf,KAAK,OAAyB,OAAO,KAAK,OAAO,GAAG,MAAM,GAAG,GAAG,QAAQ,QAAQ,MAAM,GAAG,IAAI,CAAC,CAAC;AACnG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at, chunk, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith } from "es-toolkit/array";
|
|
1
|
+
import { at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith } from "es-toolkit/array";
|
|
2
2
|
|
|
3
3
|
//#region src/array/adjust.d.ts
|
|
4
4
|
/**
|
|
@@ -130,5 +130,5 @@ declare function sortWith<T>(array: readonly T[], comparators: ReadonlyArray<(a:
|
|
|
130
130
|
*/
|
|
131
131
|
declare function unfold<T, R>(fn: (seed: T) => [R, T] | false, seed: T): R[];
|
|
132
132
|
//#endregion
|
|
133
|
-
export {
|
|
134
|
-
//# sourceMappingURL=index-
|
|
133
|
+
export { toFilled as $, isSubset as A, pull as B, forEachRight as C, adjust as Ct, intersection as D, initial as E, mapAsync as F, sampleSize as G, reduceAsync as H, maxBy as I, tail as J, shuffle as K, minBy as L, keyBy as M, last as N, intersectionBy as O, limitAsync as P, takeWhile as Q, orderBy as R, forEachAsync as S, dropRepeats as St, head as T, remove as U, pullAt as V, sample as W, takeRight as X, take as Y, takeRightWhile as Z, flatMap as _, ascend as _t, combinations as a, uniqWith as at, flatten as b, scan as bt, difference as c, windowed as ct, drop as d, xorBy as dt, union as et, dropRight as f, xorWith as ft, filterAsync as g, unfold as gt, fill as h, zipWith as ht, chunkBy as i, uniqBy as it, isSubsetWith as j, intersectionWith as k, differenceBy as l, without as lt, dropWhile as m, zipObject as mt, cartesianProduct as n, unionWith as nt, compact as o, unzip as ot, dropRightWhile as p, zip as pt, sortBy as q, chunk as r, uniq as rt, countBy as s, unzipWith as st, at as t, unionBy as tt, differenceWith as u, xor as ut, flatMapAsync as v, descend as vt, groupBy as w, flattenDeep as x, reduceWhile as xt, flatMapDeep as y, sortWith as yt, partition as z };
|
|
134
|
+
//# sourceMappingURL=index-B9ig68hj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B9ig68hj.d.mts","names":[],"sources":["../src/array/adjust.ts","../src/array/dropRepeats.ts","../src/array/reduceWhile.ts","../src/array/scan.ts","../src/array/sorting.ts","../src/array/unfold.ts"],"mappings":";;;;;;AAYA;;;;;;;;;iBAAgB,MAAA,IAAU,KAAA,WAAgB,CAAA,IAAK,KAAA,UAAe,EAAA,GAAK,KAAA,EAAO,CAAA,KAAM,CAAA,GAAI,CAAA;;;;;;AAApF;;;;;;;;;;;;;;;iBCMgB,WAAA,IAAe,KAAA,WAAgB,CAAA,KAAM,CAAC;;;;;;ADNtD;;;;;;;;;;;;;;;;iBEOgB,WAAA,OACd,KAAA,WAAgB,CAAA,IAChB,SAAA,GAAY,WAAA,EAAa,CAAA,EAAG,KAAA,EAAO,CAAA,cACnC,EAAA,GAAK,WAAA,EAAa,CAAA,EAAG,KAAA,EAAO,CAAA,EAAG,KAAA,aAAkB,CAAA,EACjD,OAAA,EAAS,CAAA,GACR,CAAA;;;;;;AFZH;;;;;;;;;iBGAgB,IAAA,OACd,KAAA,WAAgB,CAAA,IAChB,EAAA,GAAK,WAAA,EAAa,CAAA,EAAG,KAAA,EAAO,CAAA,EAAG,KAAA,aAAkB,CAAA,EACjD,OAAA,EAAS,CAAA,GACR,CAAA;;;;;;AHJH;;;;;iBIJgB,MAAA,IAAU,EAAA,GAAK,KAAA,EAAO,CAAA,wBAAyB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA;;;;;;;;;iBAsBxD,OAAA,IAAW,EAAA,GAAK,KAAA,EAAO,CAAA,wBAAyB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA;;;;;AJlBY;;;;ACMrF;;;;;;iBGwCgB,QAAA,IACd,KAAA,WAAgB,CAAA,IAChB,WAAA,EAAa,aAAA,EAAe,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,eACpC,CAAA;;;;;;AJjDH;;;;;;;;;;;;;;;;iBKOgB,MAAA,OAAa,EAAA,GAAK,IAAA,EAAM,CAAA,MAAO,CAAA,EAAG,CAAA,WAAY,IAAA,EAAM,CAAA,GAAI,CAAA"}
|
|
@@ -125,4 +125,4 @@ declare function toArray<T>(value: Iterable<T> | T | null | undefined): T[];
|
|
|
125
125
|
declare function toBoolean(value: unknown): boolean;
|
|
126
126
|
//#endregion
|
|
127
127
|
export { toFinite as a, toString as c, toError as i, toArray as n, toInteger as o, toBoolean as r, toNumber as s, stringify as t };
|
|
128
|
-
//# sourceMappingURL=index-
|
|
128
|
+
//# sourceMappingURL=index-C7dxY5U-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-C7dxY5U-.d.mts","names":[],"sources":["../src/conversion/convert.ts"],"mappings":";;AAwBA;;;;AAA+C;AA8B/C;;;;AAAwC;AAiFxC;;;;AAAuC;AAgBvC;;;;AAAuC;AAavC;iBA5IgB,OAAA,CAAQ,MAAA,YAAkB,KAAK;;;AA4IP;AAexC;;;;AAAuC;AAwBvC;;;;;;;;;;;;iBArJgB,SAAA,CAAU,KAAc;;;;AAqJgC;AA0BxE;;;;AAAwC;;;;;iBA9FxB,QAAA,CAAS,KAAc;;;;;;;;;;;;;iBAgBvB,QAAA,CAAS,KAAc;;;;;;;;;;iBAavB,SAAA,CAAU,KAAc;;;;;;;;;;;;iBAexB,QAAA,CAAS,KAAc;;;;;;;;;;;;;;;;;iBAwBvB,OAAA,IAAW,KAAA,EAAO,QAAA,CAAS,CAAA,IAAK,CAAA,sBAAuB,CAAA;;;;;;;;;;;;;;iBA0BvD,SAAA,CAAU,KAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError as isError$1, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap as isMap$1, isNil as isNil$1, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive as isPrimitive$1, isPromise, isRegExp, isSet as isSet$1, isString as isString$1, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet } from "es-toolkit/predicate";
|
|
1
|
+
import { isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError as isError$1, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap as isMap$1, isNil as isNil$1, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive as isPrimitive$1, isPromise, isRegExp, isSet as isSet$1, isString as isString$1, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet } from "es-toolkit/predicate";
|
|
2
2
|
|
|
3
3
|
//#region src/types/internal.d.ts
|
|
4
4
|
/**
|
|
@@ -182,5 +182,5 @@ declare function isInteger(value: unknown): value is number;
|
|
|
182
182
|
*/
|
|
183
183
|
declare function isNaN(value: unknown): value is number;
|
|
184
184
|
//#endregion
|
|
185
|
-
export {
|
|
186
|
-
//# sourceMappingURL=index-
|
|
185
|
+
export { isString$1 as A, isNaN as B, isNull as C, isPromise as D, isPrimitive$1 as E, isWeakSet as F, both as G, isObject as H, isArray as I, either as K, isEmpty as L, isTypedArray as M, isUndefined as N, isRegExp as O, isWeakMap as P, isFiniteNumber as R, isNotNil as S, isPlainObject as T, allPass as U, isNotEmpty as V, anyPass as W, isJSONValue as _, isBuffer as a, isNil$1 as b, isEqual as c, isFile as d, isFunction as f, isJSONObject as g, isJSONArray as h, isBrowser as i, isSymbol as j, isSet$1 as k, isEqualWith as l, isJSON as m, isBlob as n, isDate as o, isIterable as p, isBoolean as r, isEmptyObject as s, isArrayBuffer as t, isError$1 as u, isLength as v, isNumber as w, isNode as x, isMap$1 as y, isInteger as z };
|
|
186
|
+
//# sourceMappingURL=index-CQAReq7e.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CQAReq7e.d.mts","names":[],"sources":["../src/types/internal.ts","../src/predicate/combinators.ts","../src/predicate/guards.ts"],"mappings":";;;;;;AAkBA;;;;AAA+B;;;;ACE/B;;;;;;KDFY,mBAAA;;;;;AAAZ;;;;AAA+B;;;;ACE/B;;;;;;;;iBAAgB,OAAA,IAAW,UAAA,iBAA2B,KAAA,EAAO,CAAC;AAAA,iBAC9C,OAAA,YAAmB,aAAA,EAAe,KAAA,EAAO,mBAAA,eACvD,UAAA,EAAY,EAAA,IACV,KAAA,EAAO,UAAA,CAAW,EAAA,MAAQ,KAAA,IAAS,UAAA,CAAW,EAAA,IAAM,mBAAA,CAAoB,OAAA,CAAQ,EAAA;AAFpF;;;;;;;;;;;;;;;;;AAAA,iBA0BgB,OAAA,IAAW,UAAA,iBAA2B,KAAA,EAAO,CAAC;AAAA,iBAC9C,OAAA,YAAmB,aAAA,EAAe,KAAA,EAAO,mBAAA,eACvD,UAAA,EAAY,EAAA,IACV,KAAA,EAAO,UAAA,CAAW,EAAA,MAAQ,KAAA,IAAS,UAAA,CAAW,EAAA,IAAM,OAAA,CAAQ,EAAA;;;;;;;;;;;;;iBAmBhD,IAAA,cAAkB,CAAA,YAAa,CAAA,EAC7C,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,KAAA,IAAS,CAAA,EAC1B,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,KAAA,IAAS,CAAA,IACxB,KAAA,EAAO,CAAA,KAAM,KAAA,IAAS,CAAA,GAAI,CAAA;AAAA,iBACd,IAAA,IAAQ,CAAA,GAAI,KAAA,EAAO,CAAA,cAAe,CAAA,GAAI,KAAA,EAAO,CAAA,gBAAiB,KAAA,EAAO,CAAA;;;;;;;;;AA1BvB;AAC9D;;;iBA0CgB,MAAA,cAAoB,CAAA,YAAa,CAAA,EAC/C,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,KAAA,IAAS,CAAA,EAC1B,CAAA,GAAI,KAAA,EAAO,CAAA,KAAM,KAAA,IAAS,CAAA,IACxB,KAAA,EAAO,CAAA,KAAM,KAAA,IAAS,CAAA,GAAI,CAAA;AAAA,iBACd,MAAA,IAAU,CAAA,GAAI,KAAA,EAAO,CAAA,cAAe,CAAA,GAAI,KAAA,EAAO,CAAA,gBAAiB,KAAA,EAAO,CAAA;;;;;KAYlF,OAAA,MAAa,CAAA,WAAY,KAAA,EAAO,mBAAmB,KAAK,KAAA,eAAoB,CAAA;;;;;KAM5E,UAAA,OAAiB,EAAA,SAAW,aAAa,EAAE,KAAA,yBAA8B,CAAA;AAAA,KAEzE,mBAAA,OAA0B,CAAA,oBAAqB,CAAA,EAAG,CAAC,6BACtD,CAAA,sBAEE,CAAA;;;;;;ADnGJ;;;;AAA+B;;iBETf,OAAA,CAAQ,KAAA,YAAiB,KAAK;;ADW9C;;;;;;;;;AAA8D;AAC9D;iBCIgB,QAAA,CAAS,KAAA,YAAiB,KAAK;;;;;;;;;;;;;;;;;iBAoB/B,OAAA,CAAQ,KAAsB;;;;;;;;;;iBAmB9B,UAAA,CAAW,KAAsB;;;ADzCqC;AAwBtF;;;;;;iBC8BgB,cAAA,CAAe,KAAA,YAAiB,KAAK;;;AD9BS;AAC9D;;;;;;iBC0CgB,SAAA,CAAU,KAAA,YAAiB,KAAK;;;;;;;;;;iBAahC,KAAA,CAAM,KAAA,YAAiB,KAAK"}
|
|
@@ -117,4 +117,4 @@ declare function flowAsync<A extends readonly unknown[], R1, R2, R3, R4, R5, R6>
|
|
|
117
117
|
declare function flowAsync<A extends readonly unknown[], R1, R2, R3, R4, R5, R6, R7>(f1: (...args: A) => MaybePromise<R1>, f2: (a: Awaited<R1>) => MaybePromise<R2>, f3: (a: Awaited<R2>) => MaybePromise<R3>, f4: (a: Awaited<R3>) => MaybePromise<R4>, f5: (a: Awaited<R4>) => MaybePromise<R5>, f6: (a: Awaited<R5>) => MaybePromise<R6>, f7: (a: Awaited<R6>) => MaybePromise<R7>): (...args: A) => Promise<Awaited<R7>>;
|
|
118
118
|
//#endregion
|
|
119
119
|
export { unless as A, retry as C, flowAsync as D, unary as E, call as M, callAsync as N, tap as O, rest as S, throttle as T, negate as _, ThrottledFunction as a, partial as b, asyncNoop as c, curryRight as d, debounce as f, memoize as g, identity as h, ThrottleOptions as i, when as j, ifElse as k, before as l, flowRight as m, DebouncedFunction as n, after as o, flow as p, MemoizeCache as r, ary as s, DebounceOptions as t, curry as u, noop as v, spread as w, partialRight as x, once as y };
|
|
120
|
-
//# sourceMappingURL=index-
|
|
120
|
+
//# sourceMappingURL=index-CoCKuspw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CoCKuspw.d.mts","names":[],"sources":["../src/function/call.ts","../src/function/branching.ts","../src/function/tap.ts","../src/function/flowAsync.ts"],"mappings":";;;;;;AAcA;;;;;;;;;;;iBAAgB,IAAA,kCAAsC,EAAA,MAAQ,IAAA,EAAM,CAAA,KAAM,CAAA,KAAM,IAAA,EAAM,CAAA,GAAI,CAAA;;;;;;;;AAAC;AAgB3F;;;;iBAAsB,SAAA,kCACpB,EAAA,MAAQ,IAAA,EAAM,CAAA,KAAM,OAAA,CAAQ,CAAA,MACzB,IAAA,EAAM,CAAA,GACR,OAAA,CAAQ,CAAA;;;;;;AAnBX;;;;;;;iBCJgB,IAAA,IAAQ,SAAA,GAAY,KAAA,EAAO,CAAA,cAAe,EAAA,GAAK,KAAA,EAAO,CAAA,KAAM,CAAA,IAAK,KAAA,EAAO,CAAA,KAAM,CAAA;;;;;;;;;;;;ADIH;AAgB3F;iBCEgB,MAAA,IAAU,SAAA,GAAY,KAAA,EAAO,CAAA,cAAe,EAAA,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DACd,EAAA,MAAQ,IAAA,EAAM,CAAA,KAAM,YAAA,CAAa,EAAA,GACjC,EAAA,GAAK,CAAA,EAAG,OAAA,CAAQ,EAAA,MAAQ,YAAA,CAAa,EAAA,GACrC,EAAA,GAAK,CAAA,EAAG,OAAA,CAAQ,EAAA,MAAQ,YAAA,CAAa,EAAA,GACrC,EAAA,GAAK,CAAA,EAAG,OAAA,CAAQ,EAAA,MAAQ,YAAA,CAAa,EAAA,GACrC,EAAA,GAAK,CAAA,EAAG,OAAA,CAAQ,EAAA,MAAQ,YAAA,CAAa,EAAA,GACrC,EAAA,GAAK,CAAA,EAAG,OAAA,CAAQ,EAAA,MAAQ,YAAA,CAAa,EAAA,GACrC,EAAA,GAAK,CAAA,EAAG,OAAA,CAAQ,EAAA,MAAQ,YAAA,CAAa,EAAA,QAChC,IAAA,EAAM,CAAA,KAAM,OAAA,CAAQ,OAAA,CAAQ,EAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clone, cloneDeep, cloneDeepWith, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, toCamelCaseKeys, toMerged, toSnakeCaseKeys } from "es-toolkit/object";
|
|
1
|
+
import { clone, cloneDeep, cloneDeepWith, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toMerged, toSnakeCaseKeys } from "es-toolkit/object";
|
|
2
2
|
|
|
3
3
|
//#region src/object/evolve.d.ts
|
|
4
4
|
/**
|
|
@@ -16,5 +16,5 @@ import { clone, cloneDeep, cloneDeepWith, findKey, flattenObject, invert, mapKey
|
|
|
16
16
|
*/
|
|
17
17
|
declare function evolve<T extends Record<string, unknown>>(obj: T, spec: { [K in keyof T]?: (value: T[K]) => T[K] }): T;
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
-
//# sourceMappingURL=index-
|
|
19
|
+
export { toMerged as _, flattenObject as a, mapValues as c, omit as d, omitBy as f, toCamelCaseKeys as g, sortKeys as h, findKey as i, merge as l, pickBy as m, cloneDeep as n, invert as o, pick as p, cloneDeepWith as r, mapKeys as s, clone as t, mergeWith as u, toSnakeCaseKeys as v, evolve as y };
|
|
20
|
+
//# sourceMappingURL=index-D5qkz-H4.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-D5qkz-H4.d.mts","names":[],"sources":["../src/object/evolve.ts"],"mappings":";;;;;;AAaA;;;;;;;;;;iBAAgB,MAAA,WAAiB,MAAA,mBAC/B,GAAA,EAAK,CAAA,EACL,IAAA,gBAAoB,CAAA,KAAM,KAAA,EAAO,CAAA,CAAE,CAAA,MAAO,CAAA,CAAE,CAAA,MAC3C,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Ok, r as Result, t as Err } from "./types-
|
|
1
|
+
import { n as Ok, r as Result, t as Err } from "./types-BsimcHZS.mjs";
|
|
2
2
|
import { assert, invariant } from "es-toolkit/util";
|
|
3
3
|
|
|
4
4
|
//#region src/control/attempt.d.ts
|
|
@@ -112,5 +112,75 @@ declare function isErr<T>(result: Result<T>): result is Err;
|
|
|
112
112
|
*/
|
|
113
113
|
declare function unwrap<T>(result: Result<T>, message?: string): T;
|
|
114
114
|
//#endregion
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
//#region src/control/todo.d.ts
|
|
116
|
+
/**
|
|
117
|
+
* Stub for a code path you intend to write but haven't. Throws at runtime,
|
|
118
|
+
* returns `never` so it typechecks in any position.
|
|
119
|
+
*
|
|
120
|
+
* For paths you intentionally don't support, see `unimplemented`.
|
|
121
|
+
* For paths that should be impossible, see `unreachable`.
|
|
122
|
+
*
|
|
123
|
+
* @param message - Optional context appended to the thrown error
|
|
124
|
+
* @returns Never returns — always throws
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* function parseConfig(raw: string): Config {
|
|
129
|
+
* return todo('waiting on schema decision')
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
declare function todo(message?: string): never;
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/control/unimplemented.d.ts
|
|
136
|
+
/**
|
|
137
|
+
* Marks a code path as intentionally unsupported. Throws at runtime, returns
|
|
138
|
+
* `never` so it typechecks in any position.
|
|
139
|
+
*
|
|
140
|
+
* For work you plan to finish later, see `todo`.
|
|
141
|
+
* For paths that should be impossible, see `unreachable`.
|
|
142
|
+
*
|
|
143
|
+
* @param message - Optional context appended to the thrown error
|
|
144
|
+
* @returns Never returns — always throws
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* type Driver = 'postgres' | 'sqlite' | 'mysql'
|
|
149
|
+
*
|
|
150
|
+
* function migrate(driver: Driver): void {
|
|
151
|
+
* return match(driver)
|
|
152
|
+
* .with('postgres', runPgMigration)
|
|
153
|
+
* .with('sqlite', runSqliteMigration)
|
|
154
|
+
* .with('mysql', () => unimplemented('mysql driver intentionally unsupported'))
|
|
155
|
+
* .exhaustive()
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare function unimplemented(message?: string): never;
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/control/unreachable.d.ts
|
|
162
|
+
/**
|
|
163
|
+
* Marks a code path as logically impossible. Throws at runtime if execution
|
|
164
|
+
* gets there. Returns `never` so it typechecks in any position.
|
|
165
|
+
*
|
|
166
|
+
* For work you plan to finish later, see `todo`.
|
|
167
|
+
* For paths you intentionally don't support, see `unimplemented`.
|
|
168
|
+
*
|
|
169
|
+
* @param message - Optional context appended to the thrown error
|
|
170
|
+
* @returns Never returns — always throws
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* function parseDigit(input: string): number {
|
|
175
|
+
* const parsed = Number.parseInt(input, 10)
|
|
176
|
+
* if (Number.isNaN(parsed)) {
|
|
177
|
+
* return unreachable('caller pre-validated')
|
|
178
|
+
* }
|
|
179
|
+
* return parsed
|
|
180
|
+
* }
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
declare function unreachable(message?: string): never;
|
|
184
|
+
//#endregion
|
|
185
|
+
export { todo as a, isOk as c, attempt as d, attemptAsync as f, unimplemented as i, ok as l, invariant as n, err as o, unreachable as r, isErr as s, assert as t, unwrap as u };
|
|
186
|
+
//# sourceMappingURL=index-DKEiLKtl.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DKEiLKtl.d.mts","names":[],"sources":["../src/control/attempt.ts","../src/control/result.ts","../src/control/todo.ts","../src/control/unimplemented.ts","../src/control/unreachable.ts"],"mappings":";;;;;;;AAkBA;;;;;;;;;;;;iBAAgB,OAAA,IAAW,EAAA,QAAU,CAAA,GAAI,MAAA,CAAO,CAAA;;AAAC;AAuBjD;;;;;;;;;;;;;iBAAsB,YAAA,IAAgB,EAAA,QAAU,OAAA,CAAQ,CAAA,IAAK,OAAA,CAAQ,MAAA,CAAO,CAAA;;;;;;AAvB5E;;;;;;;;;iBCmBgB,EAAA,IAAM,KAAA,EAAO,CAAA,GAAI,EAAA,CAAG,CAAA;;;;;ADnBa;AAuBjD;;;;;;;iBCYgB,GAAA,CAAI,KAAA,YAAiB,GAAG;;;;;;;;;;;ADZqC;;;;iBC8B7D,IAAA,IAAQ,MAAA,EAAQ,MAAA,CAAO,CAAA,IAAK,MAAA,IAAU,EAAA,CAAG,CAAA;;;;;;;;;;;;;;AAlCpB;iBAoDrB,KAAA,IAAS,MAAA,EAAQ,MAAA,CAAO,CAAA,IAAK,MAAA,IAAU,GAAA;;;;AApCf;AAkBxC;;;;;;;;;;;;;;iBAwCgB,MAAA,IAAU,MAAA,EAAQ,MAAA,CAAO,CAAA,GAAI,OAAA,YAAmB,CAAA;;;;;;;AD7FhE;;;;;;;;;;;;;iBECgB,IAAA,CAAK,OAAgB;;;;;;;AFDrC;;;;;;;;;;;;;;AAAiD;AAuBjD;;;;iBGhBgB,aAAA,CAAc,OAAgB;;;;;;;AHP9C;;;;;;;;;;;;;;AAAiD;AAuBjD;;iBIlBgB,WAAA,CAAY,OAAgB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Ok$1, t as Err$1 } from "./types-
|
|
1
|
+
import { n as Ok$1, t as Err$1 } from "./types-BsimcHZS.mjs";
|
|
2
2
|
import { NonExhaustiveError, P, Pattern, isMatching, match } from "ts-pattern";
|
|
3
3
|
|
|
4
4
|
//#region src/match/match.d.ts
|
|
@@ -36,4 +36,4 @@ type Ok<T> = Ok$1<T>;
|
|
|
36
36
|
type Err = Err$1;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { Err as a, match as i, Pattern as n, Ok as o, isMatching as r, P$1 as s, NonExhaustiveError as t };
|
|
39
|
-
//# sourceMappingURL=index-
|
|
39
|
+
//# sourceMappingURL=index-DPhfdSi7.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DPhfdSi7.d.mts","names":[],"sources":["../src/match/match.ts"],"mappings":";;;;;;;AAmD4B;AAK5B;;;;AAAyB;;;;;cAjBZ,GAAA,SAAU,CAAG;EAAK,EAAA;IAAM,EAAA;EAAA;EAAY,GAAA;IAAO,EAAA;EAAA;AAAA;;;;;;;KAY5C,EAAA,MAAQ,IAAM,CAAC,CAAA;;;;KAKf,GAAA,GAAM,KAAO"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { r as Result } from "./types-
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "./index-
|
|
1
|
+
import { $ as toFilled, A as isSubset, B as pull, C as forEachRight, Ct as adjust, D as intersection, E as initial, F as mapAsync, G as sampleSize, H as reduceAsync, I as maxBy, J as tail, K as shuffle, L as minBy, M as keyBy, N as last, O as intersectionBy, P as limitAsync, Q as takeWhile, R as orderBy, S as forEachAsync, St as dropRepeats, T as head, U as remove, V as pullAt, W as sample, X as takeRight, Y as take, Z as takeRightWhile, _ as flatMap, _t as ascend, a as combinations, at as uniqWith, b as flatten, bt as scan, c as difference, ct as windowed, d as drop, dt as xorBy, et as union, f as dropRight, ft as xorWith, g as filterAsync, gt as unfold, h as fill, ht as zipWith, i as chunkBy, it as uniqBy, j as isSubsetWith, k as intersectionWith, l as differenceBy, lt as without, m as dropWhile, mt as zipObject, n as cartesianProduct, nt as unionWith, o as compact, ot as unzip, p as dropRightWhile, pt as zip, q as sortBy, r as chunk, rt as uniq, s as countBy, st as unzipWith, t as at, tt as unionBy, u as differenceWith, ut as xor, v as flatMapAsync, vt as descend, w as groupBy, x as flattenDeep, xt as reduceWhile, y as flatMapDeep, yt as sortWith, z as partition } from "./index-B9ig68hj.mjs";
|
|
2
|
+
import { r as Result } from "./types-BsimcHZS.mjs";
|
|
3
|
+
import { a as todo, c as isOk, d as attempt, f as attemptAsync, i as unimplemented, l as ok, n as invariant, o as err, r as unreachable, s as isErr, t as assert, u as unwrap } from "./index-DKEiLKtl.mjs";
|
|
4
|
+
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "./index-C7dxY5U-.mjs";
|
|
5
5
|
import { AbortError, TimeoutError } from "./error/index.mjs";
|
|
6
|
-
import { A as unless, C as retry, D as flowAsync, E as unary, M as call, N as callAsync, O as tap, S as rest, T as throttle, _ as negate, a as ThrottledFunction, b as partial, c as asyncNoop, d as curryRight, f as debounce, g as memoize, h as identity, i as ThrottleOptions, j as when, k as ifElse, l as before, m as flowRight, n as DebouncedFunction, o as after, p as flow, r as MemoizeCache, s as ary, t as DebounceOptions, u as curry, v as noop, w as spread, x as partialRight, y as once } from "./index-
|
|
7
|
-
import { clamp, inRange, mean, meanBy, median, medianBy, random, randomInt, range, rangeRight, round, sum, sumBy } from "./math/index.mjs";
|
|
8
|
-
import { _ as
|
|
9
|
-
import { A as
|
|
10
|
-
import { Mutex, Semaphore, delay, timeout, withTimeout } from "./promise/index.mjs";
|
|
6
|
+
import { A as unless, C as retry, D as flowAsync, E as unary, M as call, N as callAsync, O as tap, S as rest, T as throttle, _ as negate, a as ThrottledFunction, b as partial, c as asyncNoop, d as curryRight, f as debounce, g as memoize, h as identity, i as ThrottleOptions, j as when, k as ifElse, l as before, m as flowRight, n as DebouncedFunction, o as after, p as flow, r as MemoizeCache, s as ary, t as DebounceOptions, u as curry, v as noop, w as spread, x as partialRight, y as once } from "./index-CoCKuspw.mjs";
|
|
7
|
+
import { clamp, inRange, mean, meanBy, median, medianBy, percentile, random, randomInt, range, rangeRight, round, sum, sumBy } from "./math/index.mjs";
|
|
8
|
+
import { _ as toMerged, a as flattenObject, c as mapValues, d as omit, f as omitBy, g as toCamelCaseKeys, h as sortKeys, i as findKey, l as merge, m as pickBy, n as cloneDeep, o as invert, p as pick, r as cloneDeepWith, s as mapKeys, t as clone, u as mergeWith, v as toSnakeCaseKeys, y as evolve } from "./index-D5qkz-H4.mjs";
|
|
9
|
+
import { A as isString, B as isNaN, C as isNull, D as isPromise, E as isPrimitive, F as isWeakSet, G as both, H as isObject, I as isArray, K as either, L as isEmpty, M as isTypedArray, N as isUndefined, O as isRegExp, P as isWeakMap, R as isFiniteNumber, S as isNotNil, T as isPlainObject, U as allPass, V as isNotEmpty, W as anyPass, _ as isJSONValue, a as isBuffer, b as isNil, c as isEqual, d as isFile, f as isFunction, g as isJSONObject, h as isJSONArray, i as isBrowser, j as isSymbol, k as isSet, l as isEqualWith, m as isJSON, n as isBlob, o as isDate, p as isIterable, r as isBoolean, s as isEmptyObject, t as isArrayBuffer, u as isError, v as isLength, w as isNumber, x as isNode, y as isMap, z as isInteger } from "./index-CQAReq7e.mjs";
|
|
10
|
+
import { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout } from "./promise/index.mjs";
|
|
11
11
|
import { camelCase, capitalize, constantCase, deburr, escape, escapeRegExp, kebabCase, lowerCase, lowerFirst, pad, pascalCase, reverseString, snakeCase, startCase, trim, trimEnd, trimStart, unescape, upperCase, upperFirst, words } from "./string/index.mjs";
|
|
12
|
-
import { a as Err, i as match, n as Pattern, o as Ok, r as isMatching, s as P, t as NonExhaustiveError } from "./index-
|
|
13
|
-
export { AbortError, type DebounceOptions, type DebouncedFunction, type Err, type MemoizeCache, Mutex, NonExhaustiveError, type Ok, P, Pattern, type Result, Semaphore, type ThrottleOptions, type ThrottledFunction, TimeoutError, adjust, after, allPass, anyPass, ary, ascend, assert, asyncNoop, at, attempt, attemptAsync, before, both, call, callAsync, camelCase, capitalize, chunk, clamp, clone, cloneDeep, cloneDeepWith, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, either, err, escape, escapeRegExp, evolve, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowAsync, flowRight, forEachAsync, forEachRight, groupBy, head, identity, ifElse, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isErr, isError, isFile, isFiniteNumber, isFunction, isInteger, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isMatching, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isOk, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, match, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, ok, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, reduceWhile, remove, rest, retry, reverseString, round, sample, sampleSize, scan, shuffle, snakeCase, sortBy, sortWith, spread, startCase, stringify, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, throttle, timeout, toArray, toBoolean, toCamelCaseKeys, toError, toFilled, toFinite, toInteger, toMerged, toNumber, toSnakeCaseKeys, toString, trim, trimEnd, trimStart, unary, unescape, unfold, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unless, unwrap, unzip, unzipWith, upperCase, upperFirst, when, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
12
|
+
import { a as Err, i as match, n as Pattern, o as Ok, r as isMatching, s as P, t as NonExhaustiveError } from "./index-DPhfdSi7.mjs";
|
|
13
|
+
export { AbortError, type DebounceOptions, type DebouncedFunction, type Err, type MemoizeCache, Mutex, NonExhaustiveError, type Ok, P, Pattern, type Result, Semaphore, type ThrottleOptions, type ThrottledFunction, TimeoutError, adjust, after, allKeyed, allPass, anyPass, ary, ascend, assert, asyncNoop, at, attempt, attemptAsync, before, both, call, callAsync, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, either, err, escape, escapeRegExp, evolve, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowAsync, flowRight, forEachAsync, forEachRight, groupBy, head, identity, ifElse, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isErr, isError, isFile, isFiniteNumber, isFunction, isInteger, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isMatching, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isOk, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, match, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, ok, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, reduceWhile, remove, rest, retry, reverseString, round, sample, sampleSize, scan, shuffle, snakeCase, sortBy, sortKeys, sortWith, spread, startCase, stringify, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, throttle, timeout, toArray, toBoolean, toCamelCaseKeys, toError, toFilled, toFinite, toInteger, toMerged, toNumber, toSnakeCaseKeys, toString, todo, trim, trimEnd, trimStart, unary, unescape, unfold, unimplemented, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unless, unreachable, unwrap, unzip, unzipWith, upperCase, upperFirst, when, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as toFilled, A as isSubset, B as pull, C as forEachRight, Ct as adjust, D as intersection, E as initial, F as mapAsync, G as sampleSize, H as reduceAsync, I as maxBy, J as tail, K as shuffle, L as minBy, M as keyBy, N as last, O as intersectionBy, P as limitAsync, Q as takeWhile, R as orderBy, S as forEachAsync, St as dropRepeats, T as head, U as remove, V as pullAt, W as sample, X as takeRight, Y as take, Z as takeRightWhile, _ as flatMap, _t as ascend, a as combinations, at as uniqWith, b as flatten, bt as scan, c as difference, ct as windowed, d as drop, dt as xorBy, et as union, f as dropRight, ft as xorWith, g as filterAsync, gt as unfold, h as fill, ht as zipWith, i as chunkBy, it as uniqBy, j as isSubsetWith, k as intersectionWith, l as differenceBy, lt as without, m as dropWhile, mt as zipObject, n as cartesianProduct, nt as unionWith, o as compact, ot as unzip, p as dropRightWhile, pt as zip, q as sortBy, r as chunk, rt as uniq, s as countBy, st as unzipWith, t as at, tt as unionBy, u as differenceWith, ut as xor, v as flatMapAsync, vt as descend, w as groupBy, x as flattenDeep, xt as reduceWhile, y as flatMapDeep, yt as sortWith, z as partition } from "./array-DGmsKhoS.mjs";
|
|
2
2
|
import { AbortError, TimeoutError } from "./error/index.mjs";
|
|
3
|
-
import { C as tap, D as call, E as when, O as callAsync, S as flowAsync, T as unless, _ as rest, a as curry, b as throttle, c as flow, d as memoize, f as negate, g as partialRight, h as partial, i as before, l as flowRight, m as once, n as ary, o as curryRight, p as noop, r as asyncNoop, s as debounce, t as after, u as identity, v as retry, w as ifElse, x as unary, y as spread } from "./function-
|
|
4
|
-
import { clamp, inRange, mean, meanBy, median, medianBy, random, randomInt, range, rangeRight, round, sum, sumBy } from "./math/index.mjs";
|
|
5
|
-
import { _ as
|
|
6
|
-
import { A as
|
|
7
|
-
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "./conversion-
|
|
8
|
-
import { Mutex, Semaphore, delay, timeout, withTimeout } from "./promise/index.mjs";
|
|
3
|
+
import { C as tap, D as call, E as when, O as callAsync, S as flowAsync, T as unless, _ as rest, a as curry, b as throttle, c as flow, d as memoize, f as negate, g as partialRight, h as partial, i as before, l as flowRight, m as once, n as ary, o as curryRight, p as noop, r as asyncNoop, s as debounce, t as after, u as identity, v as retry, w as ifElse, x as unary, y as spread } from "./function-Brosl7-Y.mjs";
|
|
4
|
+
import { clamp, inRange, mean, meanBy, median, medianBy, percentile, random, randomInt, range, rangeRight, round, sum, sumBy } from "./math/index.mjs";
|
|
5
|
+
import { _ as toMerged, a as flattenObject, c as mapValues, d as omit, f as omitBy, g as toCamelCaseKeys, h as sortKeys, i as findKey, l as merge, m as pickBy, n as cloneDeep, o as invert, p as pick, r as cloneDeepWith, s as mapKeys, t as clone, u as mergeWith, v as toSnakeCaseKeys, y as evolve } from "./object-DUAxOgHi.mjs";
|
|
6
|
+
import { A as isString, B as isNaN, C as isNull, D as isPromise, E as isPrimitive, F as isWeakSet, G as both, H as isObject, I as isArray, K as either, L as isEmpty, M as isTypedArray, N as isUndefined, O as isRegExp, P as isWeakMap, R as isFiniteNumber, S as isNotNil, T as isPlainObject, U as allPass, V as isNotEmpty, W as anyPass, _ as isJSONValue, a as isBuffer, b as isNil, c as isEqual, d as isFile, f as isFunction, g as isJSONObject, h as isJSONArray, i as isBrowser, j as isSymbol, k as isSet, l as isEqualWith, m as isJSON, n as isBlob, o as isDate, p as isIterable, r as isBoolean, s as isEmptyObject, t as isArrayBuffer, u as isError, v as isLength, w as isNumber, x as isNode, y as isMap, z as isInteger } from "./predicate-CleUejOb.mjs";
|
|
7
|
+
import { a as toFinite, c as toString, i as toError, n as toArray, o as toInteger, r as toBoolean, s as toNumber, t as stringify } from "./conversion-BB912-15.mjs";
|
|
8
|
+
import { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout } from "./promise/index.mjs";
|
|
9
9
|
import { camelCase, capitalize, constantCase, deburr, escape, escapeRegExp, kebabCase, lowerCase, lowerFirst, pad, pascalCase, reverseString, snakeCase, startCase, trim, trimEnd, trimStart, unescape, upperCase, upperFirst, words } from "./string/index.mjs";
|
|
10
|
-
import { a as
|
|
11
|
-
import { a as P, i as match, n as Pattern, r as isMatching, t as NonExhaustiveError } from "./match-
|
|
12
|
-
export { AbortError, Mutex, NonExhaustiveError, P, Pattern, Semaphore, TimeoutError, adjust, after, allPass, anyPass, ary, ascend, assert, asyncNoop, at, attempt, attemptAsync, before, both, call, callAsync, camelCase, capitalize, chunk, clamp, clone, cloneDeep, cloneDeepWith, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, either, err, escape, escapeRegExp, evolve, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowAsync, flowRight, forEachAsync, forEachRight, groupBy, head, identity, ifElse, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isErr, isError, isFile, isFiniteNumber, isFunction, isInteger, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isMatching, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isOk, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, match, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, ok, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, reduceWhile, remove, rest, retry, reverseString, round, sample, sampleSize, scan, shuffle, snakeCase, sortBy, sortWith, spread, startCase, stringify, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, throttle, timeout, toArray, toBoolean, toCamelCaseKeys, toError, toFilled, toFinite, toInteger, toMerged, toNumber, toSnakeCaseKeys, toString, trim, trimEnd, trimStart, unary, unescape, unfold, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unless, unwrap, unzip, unzipWith, upperCase, upperFirst, when, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
10
|
+
import { a as todo, c as err, d as ok, f as unwrap, i as unimplemented, l as isErr, n as invariant, o as attempt, r as unreachable, s as attemptAsync, t as assert, u as isOk } from "./control-DCdm8IH6.mjs";
|
|
11
|
+
import { a as P, i as match, n as Pattern, r as isMatching, t as NonExhaustiveError } from "./match-uR6HPDRb.mjs";
|
|
12
|
+
export { AbortError, Mutex, NonExhaustiveError, P, Pattern, Semaphore, TimeoutError, adjust, after, allKeyed, allPass, anyPass, ary, ascend, assert, asyncNoop, at, attempt, attemptAsync, before, both, call, callAsync, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, descend, difference, differenceBy, differenceWith, drop, dropRepeats, dropRight, dropRightWhile, dropWhile, either, err, escape, escapeRegExp, evolve, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowAsync, flowRight, forEachAsync, forEachRight, groupBy, head, identity, ifElse, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isErr, isError, isFile, isFiniteNumber, isFunction, isInteger, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isMatching, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isOk, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, match, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, ok, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, reduceWhile, remove, rest, retry, reverseString, round, sample, sampleSize, scan, shuffle, snakeCase, sortBy, sortKeys, sortWith, spread, startCase, stringify, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, throttle, timeout, toArray, toBoolean, toCamelCaseKeys, toError, toFilled, toFinite, toInteger, toMerged, toNumber, toSnakeCaseKeys, toString, todo, trim, trimEnd, trimStart, unary, unescape, unfold, unimplemented, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unless, unreachable, unwrap, unzip, unzipWith, upperCase, upperFirst, when, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/match/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Err, i as match, n as Pattern, o as Ok, r as isMatching, s as P, t as NonExhaustiveError } from "../index-
|
|
2
|
-
export { Err, NonExhaustiveError, Ok, P, Pattern, isMatching, match };
|
|
1
|
+
import { a as Err, i as match, n as Pattern, o as Ok, r as isMatching, s as P, t as NonExhaustiveError } from "../index-DPhfdSi7.mjs";
|
|
2
|
+
export { type Err, NonExhaustiveError, type Ok, P, Pattern, isMatching, match };
|
package/dist/match/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as P, i as match, n as Pattern, r as isMatching, t as NonExhaustiveError } from "../match-
|
|
1
|
+
import { a as P, i as match, n as Pattern, r as isMatching, t as NonExhaustiveError } from "../match-uR6HPDRb.mjs";
|
|
2
2
|
export { NonExhaustiveError, P, Pattern, isMatching, match };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match-
|
|
1
|
+
{"version":3,"file":"match-uR6HPDRb.mjs","names":["P","TsP"],"sources":["../src/match/match.ts"],"sourcesContent":["/**\n * Extends ts-pattern's `P` namespace with `P.ok` and `P.err` — structural\n * patterns for matching a `Result` inside `match()`.\n *\n * Mirrors Rust's `Ok(value)` / `Err(error)` match arms, but uses the\n * namespace-property form (`P.ok` / `P.err`) so it doesn't collide with\n * the lowercase `ok()` / `err()` constructors from `massaman/control`.\n *\n * @example\n * ```ts\n * import { match, P, attempt } from 'massaman'\n *\n * match(attempt(() => JSON.parse(raw)))\n * .with(P.ok, ({ value }) => use(value))\n * .with(P.err, ({ error }) => log(error))\n * .exhaustive()\n * ```\n */\n\nimport { P as TsP } from 'ts-pattern'\n\nimport type { Err as ErrType, Ok as OkType } from '../control/types.js'\n\nconst okPattern: { ok: true } = { ok: true }\nconst errPattern: { ok: false } = { ok: false }\n\n/**\n * Extended ts-pattern `P` namespace. Carries everything ts-pattern exports\n * (`P.string`, `P.number`, `P.array`, `P.when`, …) plus `P.ok` / `P.err`\n * for matching `Result` values.\n *\n * Explicit literal-type annotations on the additions (rather than `as const`)\n * keep the values non-`readonly`, which ts-pattern's narrowing requires —\n * a `readonly` pattern collapses the remaining input to `never` after the\n * first arm, breaking exhaustiveness.\n *\n * For the `P.Pattern<T>` type shorthand, import `Pattern` standalone from\n * `massaman/match` — it's the form ts-pattern's own docs recommend.\n */\nexport const P: typeof TsP & { ok: { ok: true }; err: { ok: false } } = {\n ...TsP,\n ok: okPattern,\n err: errPattern,\n}\n\n/**\n * The `Ok` variant of a `Result<T>`. Re-exported here so the value-side\n * patterns and the type-side `Ok<T>` live in one module — any consumer\n * import gets both type and value namespaces without cross-module merge\n * issues (TS2300).\n */\nexport type Ok<T> = OkType<T>\n\n/**\n * The `Err` variant of a `Result<T>`. See {@link Ok} for the co-location note.\n */\nexport type Err = ErrType\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,YAA0B,EAAE,IAAI,KAAK;AAC3C,MAAM,aAA4B,EAAE,IAAI,MAAM;;;;;;;;;;;;;;AAe9C,MAAaA,MAA2D;CACtE,GAAGC;CACH,IAAI;CACJ,KAAK;AACP"}
|
package/dist/math/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { clamp, inRange, mean, meanBy, median, medianBy, random, randomInt, range, rangeRight, round, sum, sumBy } from "es-toolkit/math";
|
|
2
|
-
export { clamp, inRange, mean, meanBy, median, medianBy, random, randomInt, range, rangeRight, round, sum, sumBy };
|
|
1
|
+
import { clamp, inRange, mean, meanBy, median, medianBy, percentile, random, randomInt, range, rangeRight, round, sum, sumBy } from "es-toolkit/math";
|
|
2
|
+
export { clamp, inRange, mean, meanBy, median, medianBy, percentile, random, randomInt, range, rangeRight, round, sum, sumBy };
|
package/dist/math/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { clamp, inRange, mean, meanBy, median, medianBy, random, randomInt, range, rangeRight, round, sum, sumBy } from "es-toolkit/math";
|
|
2
|
-
export { clamp, inRange, mean, meanBy, median, medianBy, random, randomInt, range, rangeRight, round, sum, sumBy };
|
|
1
|
+
import { clamp, inRange, mean, meanBy, median, medianBy, percentile, random, randomInt, range, rangeRight, round, sum, sumBy } from "es-toolkit/math";
|
|
2
|
+
export { clamp, inRange, mean, meanBy, median, medianBy, percentile, random, randomInt, range, rangeRight, round, sum, sumBy };
|
package/dist/object/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { clone, cloneDeep, cloneDeepWith, evolve, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, toCamelCaseKeys, toMerged, toSnakeCaseKeys };
|
|
1
|
+
import { _ as toMerged, a as flattenObject, c as mapValues, d as omit, f as omitBy, g as toCamelCaseKeys, h as sortKeys, i as findKey, l as merge, m as pickBy, n as cloneDeep, o as invert, p as pick, r as cloneDeepWith, s as mapKeys, t as clone, u as mergeWith, v as toSnakeCaseKeys, y as evolve } from "../index-D5qkz-H4.mjs";
|
|
2
|
+
export { clone, cloneDeep, cloneDeepWith, evolve, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toMerged, toSnakeCaseKeys };
|
package/dist/object/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { clone, cloneDeep, cloneDeepWith, evolve, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, toCamelCaseKeys, toMerged, toSnakeCaseKeys };
|
|
1
|
+
import { _ as toMerged, a as flattenObject, c as mapValues, d as omit, f as omitBy, g as toCamelCaseKeys, h as sortKeys, i as findKey, l as merge, m as pickBy, n as cloneDeep, o as invert, p as pick, r as cloneDeepWith, s as mapKeys, t as clone, u as mergeWith, v as toSnakeCaseKeys, y as evolve } from "../object-DUAxOgHi.mjs";
|
|
2
|
+
export { clone, cloneDeep, cloneDeepWith, evolve, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toMerged, toSnakeCaseKeys };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clone, cloneDeep, cloneDeepWith, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, toCamelCaseKeys, toMerged, toSnakeCaseKeys } from "es-toolkit/object";
|
|
1
|
+
import { clone, cloneDeep, cloneDeepWith, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toMerged, toSnakeCaseKeys } from "es-toolkit/object";
|
|
2
2
|
//#region src/object/evolve.ts
|
|
3
3
|
/**
|
|
4
4
|
* Applies a spec of transformation functions to matching keys of an object,
|
|
@@ -22,6 +22,6 @@ function evolve(obj, spec) {
|
|
|
22
22
|
return result;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
export {
|
|
25
|
+
export { toMerged as _, flattenObject as a, mapValues as c, omit as d, omitBy as f, toCamelCaseKeys as g, sortKeys as h, findKey as i, merge as l, pickBy as m, cloneDeep as n, invert as o, pick as p, cloneDeepWith as r, mapKeys as s, clone as t, mergeWith as u, toSnakeCaseKeys as v, evolve as y };
|
|
26
26
|
|
|
27
|
-
//# sourceMappingURL=object-
|
|
27
|
+
//# sourceMappingURL=object-DUAxOgHi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-
|
|
1
|
+
{"version":3,"file":"object-DUAxOgHi.mjs","names":[],"sources":["../src/object/evolve.ts"],"sourcesContent":["/**\n * Applies a spec of transformation functions to matching keys of an object,\n * returning a new object. Keys not in the spec are copied as-is.\n *\n * @example\n * ```ts\n * evolve({ name: ' Alice ', age: 29, role: 'admin' }, {\n * name: (s) => s.trim(),\n * age: (n) => n + 1,\n * })\n * // { name: 'Alice', age: 30, role: 'admin' }\n * ```\n */\nexport function evolve<T extends Record<string, unknown>>(\n obj: T,\n spec: { [K in keyof T]?: (value: T[K]) => T[K] }\n): T {\n const result = { ...obj }\n for (const key of Object.keys(spec) as Array<keyof T>) {\n // oxlint-disable-next-line security/detect-object-injection -- key sourced from Object.keys(spec), not user input\n const transform = spec[key]\n if (transform != null && key in result) {\n // oxlint-disable-next-line security/detect-object-injection -- key sourced from Object.keys(spec), not user input\n result[key] = transform(result[key])\n }\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,SAAgB,OACd,KACA,MACG;CACH,MAAM,SAAS,EAAE,GAAG,IAAI;CACxB,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GAAqB;EAErD,MAAM,YAAY,KAAK;EACvB,IAAI,aAAa,QAAQ,OAAO,QAE9B,OAAO,OAAO,UAAU,OAAO,IAAI;CAEvC;CACA,OAAO;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { allPass, anyPass, both, either, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFiniteNumber, isFunction, isInteger, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet };
|
|
1
|
+
import { A as isString, B as isNaN, C as isNull, D as isPromise, E as isPrimitive, F as isWeakSet, G as both, H as isObject, I as isArray, K as either, L as isEmpty, M as isTypedArray, N as isUndefined, O as isRegExp, P as isWeakMap, R as isFiniteNumber, S as isNotNil, T as isPlainObject, U as allPass, V as isNotEmpty, W as anyPass, _ as isJSONValue, a as isBuffer, b as isNil, c as isEqual, d as isFile, f as isFunction, g as isJSONObject, h as isJSONArray, i as isBrowser, j as isSymbol, k as isSet, l as isEqualWith, m as isJSON, n as isBlob, o as isDate, p as isIterable, r as isBoolean, s as isEmptyObject, t as isArrayBuffer, u as isError, v as isLength, w as isNumber, x as isNode, y as isMap, z as isInteger } from "../index-CQAReq7e.mjs";
|
|
2
|
+
export { allPass, anyPass, both, either, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFiniteNumber, isFunction, isInteger, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet };
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { allPass, anyPass, both, either, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFiniteNumber, isFunction, isInteger, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet };
|
|
1
|
+
import { A as isString, B as isNaN, C as isNull, D as isPromise, E as isPrimitive, F as isWeakSet, G as both, H as isObject, I as isArray, K as either, L as isEmpty, M as isTypedArray, N as isUndefined, O as isRegExp, P as isWeakMap, R as isFiniteNumber, S as isNotNil, T as isPlainObject, U as allPass, V as isNotEmpty, W as anyPass, _ as isJSONValue, a as isBuffer, b as isNil, c as isEqual, d as isFile, f as isFunction, g as isJSONObject, h as isJSONArray, i as isBrowser, j as isSymbol, k as isSet, l as isEqualWith, m as isJSON, n as isBlob, o as isDate, p as isIterable, r as isBoolean, s as isEmptyObject, t as isArrayBuffer, u as isError, v as isLength, w as isNumber, x as isNode, y as isMap, z as isInteger } from "../predicate-CleUejOb.mjs";
|
|
2
|
+
export { allPass, anyPass, both, either, isArray, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmpty, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFiniteNumber, isFunction, isInteger, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNaN, isNil, isNode, isNotEmpty, isNotNil, isNull, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError as isError$1, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap as isMap$1, isNil as isNil$1, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive as isPrimitive$1, isPromise, isRegExp, isSet as isSet$1, isString as isString$1, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet } from "es-toolkit/predicate";
|
|
1
|
+
import { isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError as isError$1, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap as isMap$1, isNil as isNil$1, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive as isPrimitive$1, isPromise, isRegExp, isSet as isSet$1, isString as isString$1, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet } from "es-toolkit/predicate";
|
|
2
2
|
//#region src/predicate/combinators.ts
|
|
3
3
|
function allPass(predicates) {
|
|
4
4
|
return (value) => predicates.every((pred) => pred(value));
|
|
@@ -111,6 +111,6 @@ function isNaN(value) {
|
|
|
111
111
|
return Number.isNaN(value);
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
|
-
export {
|
|
114
|
+
export { isString$1 as A, isNaN as B, isNull as C, isPromise as D, isPrimitive$1 as E, isWeakSet as F, both as G, isObject as H, isArray as I, either as K, isEmpty as L, isTypedArray as M, isUndefined as N, isRegExp as O, isWeakMap as P, isFiniteNumber as R, isNotNil as S, isPlainObject as T, allPass as U, isNotEmpty as V, anyPass as W, isJSONValue as _, isBuffer as a, isNil$1 as b, isEqual as c, isFile as d, isFunction as f, isJSONObject as g, isJSONArray as h, isBrowser as i, isSymbol as j, isSet$1 as k, isEqualWith as l, isJSON as m, isBlob as n, isDate as o, isIterable as p, isBoolean as r, isEmptyObject as s, isArrayBuffer as t, isError$1 as u, isLength as v, isNumber as w, isNode as x, isMap$1 as y, isInteger as z };
|
|
115
115
|
|
|
116
|
-
//# sourceMappingURL=predicate-
|
|
116
|
+
//# sourceMappingURL=predicate-CleUejOb.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate-
|
|
1
|
+
{"version":3,"file":"predicate-CleUejOb.mjs","names":[],"sources":["../src/predicate/combinators.ts","../src/predicate/guards.ts"],"sourcesContent":["import type { DangerouslyAllowAny } from '../types/internal.js'\n\n/**\n * Returns a predicate that checks if a value satisfies ALL predicates.\n *\n * When every input is a type guard, the result narrows to the intersection\n * of every guard's target type. Plain `boolean` predicates contribute nothing\n * to the narrowing (they fall back to no-op).\n *\n * @example\n * ```ts\n * const isPositiveEven = allPass([(n: number) => n > 0, (n: number) => n % 2 === 0])\n * isPositiveEven(4) // true\n *\n * const isNonEmptyString = allPass([isString, isNotEmpty])\n * if (isNonEmptyString(x)) {\n * // x is narrowed to string here\n * }\n * ```\n */\nexport function allPass<T>(predicates: readonly []): (value: T) => true\nexport function allPass<Ps extends ReadonlyArray<(value: DangerouslyAllowAny) => boolean>>(\n predicates: Ps\n): (value: InferInput<Ps>) => value is InferInput<Ps> & UnionToIntersection<Guarded<Ps[number]>>\nexport function allPass(\n predicates: ReadonlyArray<(value: unknown) => boolean>\n): (value: unknown) => boolean {\n return (value: unknown) => predicates.every((pred) => pred(value))\n}\n\n/**\n * Returns a predicate that checks if a value satisfies ANY predicate.\n *\n * When every input is a type guard, the result narrows to the union of every\n * guard's target type (since only one needs to match).\n *\n * @example\n * ```ts\n * const isAdminOrOwner = anyPass([isAdmin, isOwner])\n * isAdminOrOwner(user)\n *\n * const isStringOrNumber = anyPass([isString, isNumber])\n * if (isStringOrNumber(x)) {\n * // x is narrowed to string | number here\n * }\n * ```\n */\nexport function anyPass<T>(predicates: readonly []): (value: T) => false\nexport function anyPass<Ps extends ReadonlyArray<(value: DangerouslyAllowAny) => boolean>>(\n predicates: Ps\n): (value: InferInput<Ps>) => value is InferInput<Ps> & Guarded<Ps[number]>\nexport function anyPass(\n predicates: ReadonlyArray<(value: unknown) => boolean>\n): (value: unknown) => boolean {\n return (value: unknown) => predicates.some((pred) => pred(value))\n}\n\n/**\n * Returns a predicate that checks if a value satisfies both predicates.\n *\n * Binary AND combinator — shorthand for `allPass([f, g])`. When both inputs\n * are type guards, the result narrows to the intersection of their target types.\n *\n * @example\n * ```ts\n * const isPositiveEven = both((n: number) => n > 0, (n: number) => n % 2 === 0)\n * isPositiveEven(4)\n * ```\n */\nexport function both<T, A extends T, B extends T>(\n f: (value: T) => value is A,\n g: (value: T) => value is B\n): (value: T) => value is A & B\nexport function both<T>(f: (value: T) => boolean, g: (value: T) => boolean): (value: T) => boolean\nexport function both<T>(f: (value: T) => boolean, g: (value: T) => boolean): (value: T) => boolean {\n return (value: T) => f(value) && g(value)\n}\n\n/**\n * Returns a predicate that checks if a value satisfies either predicate.\n *\n * Binary OR combinator — shorthand for `anyPass([f, g])`. When both inputs\n * are type guards, the result narrows to the union of their target types.\n *\n * @example\n * ```ts\n * const isNilOrEmpty = either(isNil, (s: string) => s === '')\n * isNilOrEmpty(null)\n * ```\n */\nexport function either<T, A extends T, B extends T>(\n f: (value: T) => value is A,\n g: (value: T) => value is B\n): (value: T) => value is A | B\nexport function either<T>(f: (value: T) => boolean, g: (value: T) => boolean): (value: T) => boolean\nexport function either<T>(\n f: (value: T) => boolean,\n g: (value: T) => boolean\n): (value: T) => boolean {\n return (value: T) => f(value) || g(value)\n}\n\n/**\n * `DangerouslyAllowAny` is required: this conditional needs to match predicate\n * signatures with arbitrary input types. `unknown` would reject them by contravariance.\n */\ntype Guarded<P> = P extends ((value: DangerouslyAllowAny) => value is infer X) ? X : never\n\n/**\n * `infer V` is contravariant here, so multiple predicates with the same input\n * type collapse to that single type.\n */\ntype InferInput<Ps> = Ps extends ReadonlyArray<(value: infer V) => unknown> ? V : never\n\ntype UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (\n k: infer I\n) => void\n ? I\n : never\n","/**\n * Checks if a value is an array.\n *\n * @example\n * ```ts\n * isArray([1, 2]) // true\n * isArray('hello') // false\n * ```\n */\nexport function isArray(value: unknown): value is unknown[] {\n return Array.isArray(value)\n}\n\n/**\n * Checks if a value is a non-null object.\n *\n * Returns `true` for plain objects, arrays, class instances, etc.\n * Returns `false` for `null`, primitives, and functions.\n *\n * @example\n * ```ts\n * isObject({}) // true\n * isObject(null) // false\n * ```\n */\nexport function isObject(value: unknown): value is object {\n return value !== null && typeof value === 'object'\n}\n\n/**\n * Checks if a value is empty.\n *\n * - Strings: `''`\n * - Arrays: `length === 0`\n * - Maps/Sets: `size === 0`\n * - Objects: no own enumerable keys\n *\n * @example\n * ```ts\n * isEmpty('') // true\n * isEmpty([]) // true\n * isEmpty({}) // true\n * isEmpty(new Map()) // true\n * ```\n */\nexport function isEmpty(value: string | object): boolean {\n if (typeof value === 'string' || Array.isArray(value)) {\n return value.length === 0\n }\n if (value instanceof Map || value instanceof Set) {\n return value.size === 0\n }\n return Object.keys(value).length === 0\n}\n\n/**\n * Checks if a value is not empty. Complement of {@link isEmpty}.\n *\n * @example\n * ```ts\n * isNotEmpty('hello') // true\n * isNotEmpty([]) // false\n * ```\n */\nexport function isNotEmpty(value: string | object): boolean {\n return !isEmpty(value)\n}\n\n/**\n * Checks if a value is a finite number.\n *\n * @example\n * ```ts\n * isFiniteNumber(42) // true\n * isFiniteNumber(Infinity) // false\n * ```\n */\nexport function isFiniteNumber(value: unknown): value is number {\n return Number.isFinite(value)\n}\n\n/**\n * Checks if a value is an integer.\n *\n * @example\n * ```ts\n * isInteger(42) // true\n * isInteger(4.2) // false\n * ```\n */\nexport function isInteger(value: unknown): value is number {\n return Number.isInteger(value)\n}\n\n/**\n * Checks if a value is NaN.\n *\n * @example\n * ```ts\n * isNaN(NaN) // true\n * isNaN(42) // false\n * ```\n */\nexport function isNaN(value: unknown): value is number {\n return Number.isNaN(value)\n}\n"],"mappings":";;AAwBA,SAAgB,QACd,YAC6B;CAC7B,QAAQ,UAAmB,WAAW,OAAO,SAAS,KAAK,KAAK,CAAC;AACnE;AAuBA,SAAgB,QACd,YAC6B;CAC7B,QAAQ,UAAmB,WAAW,MAAM,SAAS,KAAK,KAAK,CAAC;AAClE;AAmBA,SAAgB,KAAQ,GAA0B,GAAiD;CACjG,QAAQ,UAAa,EAAE,KAAK,KAAK,EAAE,KAAK;AAC1C;AAmBA,SAAgB,OACd,GACA,GACuB;CACvB,QAAQ,UAAa,EAAE,KAAK,KAAK,EAAE,KAAK;AAC1C;;;;;;;;;;;;AC3FA,SAAgB,QAAQ,OAAoC;CAC1D,OAAO,MAAM,QAAQ,KAAK;AAC5B;;;;;;;;;;;;;AAcA,SAAgB,SAAS,OAAiC;CACxD,OAAO,UAAU,QAAQ,OAAO,UAAU;AAC5C;;;;;;;;;;;;;;;;;AAkBA,SAAgB,QAAQ,OAAiC;CACvD,IAAI,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAClD,OAAO,MAAM,WAAW;CAE1B,IAAI,iBAAiB,OAAO,iBAAiB,KAC3C,OAAO,MAAM,SAAS;CAExB,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,WAAW;AACvC;;;;;;;;;;AAWA,SAAgB,WAAW,OAAiC;CAC1D,OAAO,CAAC,QAAQ,KAAK;AACvB;;;;;;;;;;AAWA,SAAgB,eAAe,OAAiC;CAC9D,OAAO,OAAO,SAAS,KAAK;AAC9B;;;;;;;;;;AAWA,SAAgB,UAAU,OAAiC;CACzD,OAAO,OAAO,UAAU,KAAK;AAC/B;;;;;;;;;;AAWA,SAAgB,MAAM,OAAiC;CACrD,OAAO,OAAO,MAAM,KAAK;AAC3B"}
|
package/dist/promise/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Mutex, Semaphore, delay, timeout, withTimeout } from "es-toolkit/promise";
|
|
2
|
-
export { Mutex, Semaphore, delay, timeout, withTimeout };
|
|
1
|
+
import { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout } from "es-toolkit/promise";
|
|
2
|
+
export { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout };
|
package/dist/promise/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Mutex, Semaphore, delay, timeout, withTimeout } from "es-toolkit/promise";
|
|
2
|
-
export { Mutex, Semaphore, delay, timeout, withTimeout };
|
|
1
|
+
import { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout } from "es-toolkit/promise";
|
|
2
|
+
export { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BsimcHZS.d.mts","names":[],"sources":["../src/control/types.ts"],"mappings":";;AAQA;;;;;;;UAAiB,EAAA;EAAA,SACN,EAAA;EAAA,SACA,KAAA,EAAO,CAAC;EAAA,SACR,KAAA;AAAA;;;;;;;;;UAWM,GAAA;EAAA,SACN,EAAA;EAAA,SACA,KAAA;EAAA,SACA,KAAA,EAAO,KAAK;AAAA;;;;;;;;;;AAcY;;KAAvB,MAAA,MAAY,EAAA,CAAG,CAAA,IAAK,GAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "massaman",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A comprehensive functional programming library and utilities for TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"es-toolkit",
|
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
"types": "./dist/control/index.d.mts",
|
|
60
60
|
"import": "./dist/control/index.mjs"
|
|
61
61
|
},
|
|
62
|
+
"./fp": {
|
|
63
|
+
"types": "./dist/fp/index.d.mts",
|
|
64
|
+
"import": "./dist/fp/index.mjs"
|
|
65
|
+
},
|
|
62
66
|
"./match": {
|
|
63
67
|
"types": "./dist/match/index.d.mts",
|
|
64
68
|
"import": "./dist/match/index.mjs"
|
|
@@ -85,16 +89,16 @@
|
|
|
85
89
|
"provenance": true
|
|
86
90
|
},
|
|
87
91
|
"dependencies": {
|
|
88
|
-
"es-toolkit": "1.
|
|
92
|
+
"es-toolkit": "1.50.0",
|
|
89
93
|
"ts-pattern": "5.9.0"
|
|
90
94
|
},
|
|
91
95
|
"devDependencies": {
|
|
92
|
-
"@types/node": "^25.
|
|
93
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
94
|
-
"@vitest/coverage-v8": "^4.1.
|
|
95
|
-
"tsdown": "0.22.
|
|
96
|
+
"@types/node": "^25.9.3",
|
|
97
|
+
"@typescript/native-preview": "7.0.0-dev.20260611.2",
|
|
98
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
99
|
+
"tsdown": "0.22.2",
|
|
96
100
|
"typescript": "^6.0.3",
|
|
97
|
-
"vitest": "^4.1.
|
|
101
|
+
"vitest": "^4.1.8",
|
|
98
102
|
"@massaman/tsconfig": "0.0.0"
|
|
99
103
|
},
|
|
100
104
|
"engines": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-B8mDJqXw.mjs","names":[],"sources":["../src/control/result.ts","../src/control/attempt.ts"],"sourcesContent":["import { isNil } from 'es-toolkit/predicate'\n\nimport type { Err, Ok, Result } from './types.js'\n\n/**\n * Minimal error coercion used internally by `err()`. Kept local to avoid\n * pulling the full conversion module into the `massaman/control` bundle.\n * For richer stringification (Maps, Sets, Errors with own props, circular\n * refs), import `toError` from `massaman/conversion`.\n */\nfunction coerceError(thrown: unknown): Error {\n if (thrown instanceof Error) {\n return thrown\n }\n if (typeof thrown === 'string') {\n return new Error(thrown)\n }\n try {\n const message = JSON.stringify(thrown) ?? String(thrown)\n return new Error(message, { cause: thrown })\n } catch {\n return new Error(String(thrown), { cause: thrown })\n }\n}\n\n/**\n * Creates a success result wrapping the given value.\n *\n * @param value - The success value\n * @returns An `Ok` result containing the value\n *\n * @example\n * ```ts\n * const result = ok(42)\n * // { ok: true, value: 42 }\n * ```\n */\nexport function ok<T>(value: T): Ok<T> {\n return { ok: true, value, error: null }\n}\n\n/**\n * Creates a failure result wrapping the given error.\n *\n * @param error - The error value\n * @returns An `Err` result containing the error\n *\n * @example\n * ```ts\n * const result = err(new Error('fail'))\n * // { ok: false, error: Error('fail') }\n * ```\n */\nexport function err(error: unknown): Err {\n return { ok: false, value: null, error: coerceError(error) }\n}\n\n/**\n * Type guard that narrows a `Result` to `Ok`.\n *\n * @param result - The result to check\n * @returns `true` if the result is `Ok`\n *\n * @example\n * ```ts\n * const result = attempt(() => JSON.parse('{}'))\n * if (isOk(result)) {\n * console.log(result.value)\n * }\n * ```\n */\nexport function isOk<T>(result: Result<T>): result is Ok<T> {\n return result.ok === true\n}\n\n/**\n * Type guard that narrows a `Result` to `Err`.\n *\n * @param result - The result to check\n * @returns `true` if the result is `Err`\n *\n * @example\n * ```ts\n * const result = attempt(() => JSON.parse('bad'))\n * if (isErr(result)) {\n * console.error(result.error)\n * }\n * ```\n */\nexport function isErr<T>(result: Result<T>): result is Err {\n return result.ok === false\n}\n\n/**\n * Extract the value from an `Ok` result, or throw on `Err`.\n *\n * When called without a message, throws the original error.\n * When called with a message, throws a new Error with that message\n * and the original error as `cause` (like Rust's `expect`).\n *\n * @param result - The result to unwrap\n * @param message - Optional custom error message (Rust `expect` behavior)\n * @returns The unwrapped value\n *\n * @example\n * ```ts\n * const value = unwrap(ok(42)) // 42\n * unwrap(err('fail')) // throws Error('fail')\n * unwrap(err('fail'), 'config required') // throws Error('config required', { cause: Error('fail') })\n * ```\n */\nexport function unwrap<T>(result: Result<T>, message?: string): T {\n if (result.ok) {\n return result.value\n }\n if (!isNil(message)) {\n throw new Error(message, { cause: result.error })\n }\n throw result.error\n}\n","import { err, ok } from './result.js'\nimport type { Result } from './types.js'\n\n/**\n * Executes a synchronous function and wraps the outcome in a `Result`.\n * Returns `Ok` with the return value on success, `Err` with the thrown value on failure.\n *\n * @param fn - The function to execute\n * @returns A `Result` containing either the value or the error\n *\n * @example\n * ```ts\n * const result = attempt(() => JSON.parse('{\"a\":1}'))\n * if (isOk(result)) {\n * console.log(result.value) // { a: 1 }\n * }\n * ```\n */\nexport function attempt<T>(fn: () => T): Result<T> {\n try {\n return ok(fn())\n } catch (error) {\n return err(error)\n }\n}\n\n/**\n * Executes an asynchronous function and wraps the outcome in a `Result`.\n * Returns `Ok` with the resolved value on success, `Err` with the rejection reason on failure.\n *\n * @param fn - The async function to execute\n * @returns A promise resolving to a `Result` containing either the value or the error\n *\n * @example\n * ```ts\n * const result = await attemptAsync(() => fetch('/api/data'))\n * if (isErr(result)) {\n * console.error(result.error)\n * }\n * ```\n */\nexport async function attemptAsync<T>(fn: () => Promise<T>): Promise<Result<T>> {\n try {\n return ok(await fn())\n } catch (error) {\n return err(error)\n }\n}\n"],"mappings":";;;;;;;;;AAUA,SAAS,YAAY,QAAwB;CAC3C,IAAI,kBAAkB,OACpB,OAAO;CAET,IAAI,OAAO,WAAW,UACpB,OAAO,IAAI,MAAM,OAAO;CAE1B,IAAI;EACF,MAAM,UAAU,KAAK,UAAU,OAAO,IAAI,OAAO,OAAO;EACxD,OAAO,IAAI,MAAM,SAAS,EAAE,OAAO,QAAQ,CAAC;SACtC;EACN,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BgB,EAAA,GAAA,CAAM,KAAA,EAAO,CAAA,GAAI,EAAA,CAAG,CAAA;;;;;;ADIpC;;;;;;;iBCYgB,GAAA,CAAI,KAAA,YAAiB,GAAA;;;;;;;;;;;;;;;iBAkBrB,IAAA,GAAA,CAAQ,MAAA,EAAQ,MAAA,CAAO,CAAA,IAAK,MAAA,IAAU,EAAA,CAAG,CAAA;;;;;;;;;;;;;;;iBAkBzC,KAAA,GAAA,CAAS,MAAA,EAAQ,MAAA,CAAO,CAAA,IAAK,MAAA,IAAU,GAAA;;;;;AAlBvD;;;;;;;;;;;;;;iBAwCgB,MAAA,GAAA,CAAU,MAAA,EAAQ,MAAA,CAAO,CAAA,GAAI,OAAA,YAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BjmDP8W9.d.mts","names":[],"sources":["../src/conversion/convert.ts"],"mappings":";;AAwBA;;;;;AA8BA;;;;;AAiFA;;;;;AAgBA;;;;;AAaA;iBA5IgB,OAAA,CAAQ,MAAA,YAAkB,KAAA;;;;AA2J1C;;;;;AAwBA;;;;;;;;;;;;iBArJgB,SAAA,CAAU,KAAA;;;;;AA+K1B;;;;;;;;;iBA9FgB,QAAA,CAAS,KAAA;;;;;;;;;;;;;iBAgBT,QAAA,CAAS,KAAA;;;;;;;;;;iBAaT,SAAA,CAAU,KAAA;;;;;;;;;;;;iBAeV,QAAA,CAAS,KAAA;;;;;;;;;;;;;;;;;iBAwBT,OAAA,GAAA,CAAW,KAAA,EAAO,QAAA,CAAS,CAAA,IAAK,CAAA,sBAAuB,CAAA;;;;;;;;;;;;;;iBA0BvD,SAAA,CAAU,KAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-D5l6I7QH.d.mts","names":[],"sources":["../src/function/call.ts","../src/function/branching.ts","../src/function/tap.ts","../src/function/flowAsync.ts"],"mappings":";;;;;;AAcA;;;;;;;;;;;iBAAgB,IAAA,iCAAA,CAAsC,EAAA,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EACL,IAAA,gBAAoB,CAAA,KAAM,KAAA,EAAO,CAAA,CAAE,CAAA,MAAO,CAAA,CAAE,CAAA,MAC3C,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-mfIoxwxy.d.mts","names":[],"sources":["../src/array/adjust.ts","../src/array/dropRepeats.ts","../src/array/reduceWhile.ts","../src/array/scan.ts","../src/array/sorting.ts","../src/array/unfold.ts"],"mappings":";;;;;;AAYA;;;;;;;;;iBAAgB,MAAA,GAAA,CAAU,KAAA,WAAgB,CAAA,IAAK,KAAA,UAAe,EAAA,GAAK,KAAA,EAAO,CAAA,KAAM,CAAA,GAAI,CAAA;;;;;;AAApF;;;;;;;;;;;;;;;iBCMgB,WAAA,GAAA,CAAe,KAAA,WAAgB,CAAA,KAAM,CAAA;;;;;;ADNrD;;;;;;;;;;;;;;;;iBEOgB,WAAA,MAAA,CACd,KAAA,WAAgB,CAAA,IAChB,SAAA,GAAY,WAAA,EAAa,CAAA,EAAG,KAAA,EAAO,CAAA,cACnC,EAAA,GAAK,WAAA,EAAa,CAAA,EAAG,KAAA,EAAO,CAAA,EAAG,KAAA,aAAkB,CAAA,EACjD,OAAA,EAAS,CAAA,GACR,CAAA;;;;;;AFZH;;;;;;;;;iBGAgB,IAAA,MAAA,CACd,KAAA,WAAgB,CAAA,IAChB,EAAA,GAAK,WAAA,EAAa,CAAA,EAAG,KAAA,EAAO,CAAA,EAAG,KAAA,aAAkB,CAAA,EACjD,OAAA,EAAS,CAAA,GACR,CAAA;;;;;;AHJH;;;;;iBIJgB,MAAA,GAAA,CAAU,EAAA,GAAK,KAAA,EAAO,CAAA,wBAAyB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA;;;;;;;;;iBAsBxD,OAAA,GAAA,CAAW,EAAA,GAAK,KAAA,EAAO,CAAA,wBAAyB,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA;;;;;;;;;AHZzE;;;;;;iBGwCgB,QAAA,GA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