@carbonteq/fp 0.7.0 → 0.8.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +585 -12
- package/package.json +16 -16
- package/dist/chunk-7QVYU63E.js +0 -7
- package/dist/chunk-7QVYU63E.js.map +0 -1
- package/dist/index.cjs +0 -46
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -4
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -16
- package/dist/index.js.map +0 -1
- package/dist/match.cjs +0 -43
- package/dist/match.cjs.map +0 -1
- package/dist/match.d.cts +0 -14
- package/dist/match.d.ts +0 -14
- package/dist/match.js +0 -20
- package/dist/match.js.map +0 -1
- package/dist/option.cjs +0 -227
- package/dist/option.cjs.map +0 -1
- package/dist/option.d.cts +0 -58
- package/dist/option.d.ts +0 -58
- package/dist/option.js +0 -204
- package/dist/option.js.map +0 -1
- package/dist/result.cjs +0 -288
- package/dist/result.cjs.map +0 -1
- package/dist/result.d.cts +0 -150
- package/dist/result.d.ts +0 -150
- package/dist/result.js +0 -264
- package/dist/result.js.map +0 -1
- package/dist/tuple.cjs +0 -41
- package/dist/tuple.cjs.map +0 -1
- package/dist/tuple.d.cts +0 -9
- package/dist/tuple.d.ts +0 -9
- package/dist/tuple.js +0 -18
- package/dist/tuple.js.map +0 -1
- package/dist/unit.cjs +0 -29
- package/dist/unit.cjs.map +0 -1
- package/dist/unit.d.cts +0 -4
- package/dist/unit.d.ts +0 -4
- package/dist/unit.js +0 -6
- package/dist/unit.js.map +0 -1
package/dist/tuple.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const TUPLE_KEY: unique symbol;
|
|
2
|
-
interface Tuple<Inner> extends Array<Inner> {
|
|
3
|
-
[TUPLE_KEY]: boolean;
|
|
4
|
-
}
|
|
5
|
-
declare const setAsTuple: <Inner, T extends Array<Inner>>(arr: T) => Tuple<Inner>;
|
|
6
|
-
declare const isTuple: <Inner>(t: unknown) => t is Tuple<Inner>;
|
|
7
|
-
type AppendToTuple<T, U> = T extends [...infer Rest, infer L] ? [...Rest, L, U] : [T, U];
|
|
8
|
-
|
|
9
|
-
export { type AppendToTuple, type Tuple, isTuple, setAsTuple };
|
package/dist/tuple.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const TUPLE_KEY: unique symbol;
|
|
2
|
-
interface Tuple<Inner> extends Array<Inner> {
|
|
3
|
-
[TUPLE_KEY]: boolean;
|
|
4
|
-
}
|
|
5
|
-
declare const setAsTuple: <Inner, T extends Array<Inner>>(arr: T) => Tuple<Inner>;
|
|
6
|
-
declare const isTuple: <Inner>(t: unknown) => t is Tuple<Inner>;
|
|
7
|
-
type AppendToTuple<T, U> = T extends [...infer Rest, infer L] ? [...Rest, L, U] : [T, U];
|
|
8
|
-
|
|
9
|
-
export { type AppendToTuple, type Tuple, isTuple, setAsTuple };
|
package/dist/tuple.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-7QVYU63E.js";
|
|
4
|
-
const TUPLE_KEY = Symbol.for("TUPLE");
|
|
5
|
-
const setAsTuple = /* @__PURE__ */ __name((arr) => {
|
|
6
|
-
const res = arr;
|
|
7
|
-
res[TUPLE_KEY] = true;
|
|
8
|
-
return res;
|
|
9
|
-
}, "setAsTuple");
|
|
10
|
-
const isTuple = /* @__PURE__ */ __name((t) => (
|
|
11
|
-
//@ts-expect-error
|
|
12
|
-
Object.hasOwn(t, TUPLE_KEY)
|
|
13
|
-
), "isTuple");
|
|
14
|
-
export {
|
|
15
|
-
isTuple,
|
|
16
|
-
setAsTuple
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=tuple.js.map
|
package/dist/tuple.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tuple.ts"],"sourcesContent":["const TUPLE_KEY = Symbol.for(\"TUPLE\");\n\nexport interface Tuple<Inner> extends Array<Inner> {\n [TUPLE_KEY]: boolean;\n}\n\nexport const setAsTuple = <Inner, T extends Array<Inner>>(\n arr: T,\n): Tuple<Inner> => {\n //@ts-expect-error\n const res = arr as Tuple<Inner>;\n\n res[TUPLE_KEY] = true;\n\n return res;\n};\n\nexport const isTuple = <Inner>(t: unknown): t is Tuple<Inner> =>\n //@ts-expect-error\n Object.hasOwn(t, TUPLE_KEY);\n\nexport type AppendToTuple<T, U> = T extends [...infer Rest, infer L]\n ? [...Rest, L, U]\n : [T, U];\n"],"mappings":";;;AAAA,MAAMA,YAAYC,OAAOC,IAAI,OAAA;AAMtB,MAAMC,aAAa,wBACxBC,QAAAA;AAGA,QAAMC,MAAMD;AAEZC,MAAIL,SAAAA,IAAa;AAEjB,SAAOK;AACT,GAT0B;AAWnB,MAAMC,UAAU,wBAAQC;;EAE7BC,OAAOC,OAAOF,GAAGP,SAAAA;GAFI;","names":["TUPLE_KEY","Symbol","for","setAsTuple","arr","res","isTuple","t","Object","hasOwn"]}
|
package/dist/unit.cjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var unit_exports = {};
|
|
20
|
-
__export(unit_exports, {
|
|
21
|
-
UNIT: () => UNIT
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(unit_exports);
|
|
24
|
-
const UNIT = Symbol.for("UNIT");
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
UNIT
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=unit.cjs.map
|
package/dist/unit.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/unit.ts"],"sourcesContent":["export const UNIT = Symbol.for(\"UNIT\");\nexport type UNIT = typeof UNIT;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;AAAO,MAAMA,OAAOC,OAAOC,IAAI,MAAA;","names":["UNIT","Symbol","for"]}
|
package/dist/unit.d.cts
DELETED
package/dist/unit.d.ts
DELETED
package/dist/unit.js
DELETED
package/dist/unit.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/unit.ts"],"sourcesContent":["export const UNIT = Symbol.for(\"UNIT\");\nexport type UNIT = typeof UNIT;\n"],"mappings":";AAAO,MAAMA,OAAOC,OAAOC,IAAI,MAAA;","names":["UNIT","Symbol","for"]}
|