@solana/functional 2.1.0 → 2.1.1-canary-20250310215124
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 +4 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/pipe.d.ts +207 -22
- package/dist/types/pipe.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,9 @@ This package contains generalized functional helpers and functional helpers spec
|
|
|
17
17
|
|
|
18
18
|
### `pipe()`
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
A pipeline is a solution that allows you to perform successive transforms of a value using functions. This is useful when building up a transaction message.
|
|
21
|
+
|
|
22
|
+
Until the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator) becomes part of JavaScript you can use this utility to create pipelines.
|
|
21
23
|
|
|
22
24
|
```ts
|
|
23
25
|
const add = (a, b) => a + b;
|
|
@@ -27,8 +29,6 @@ const sum = pipe(1, add10, add100);
|
|
|
27
29
|
sum === 111; // true
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
A pipeline is one solution to performing consecutive operations on a value using functions, such as you would when building a transaction.
|
|
31
|
-
|
|
32
32
|
```ts
|
|
33
33
|
const transferTransactionMessage = pipe(
|
|
34
34
|
// The result of the first expression...
|
|
@@ -38,6 +38,6 @@ const transferTransactionMessage = pipe(
|
|
|
38
38
|
// The return value of that function gets passed to the next...
|
|
39
39
|
tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),
|
|
40
40
|
// ...and so on.
|
|
41
|
-
tx => appendTransactionMessageInstruction(
|
|
41
|
+
tx => appendTransactionMessageInstruction(getTransferSolInstruction({ source, destination, amount }), tx),
|
|
42
42
|
);
|
|
43
43
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";;;AAyGO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.browser.cjs","sourcesContent":["/**\n * General pipe function.\n * Provide an initial value and a list of functions to pipe it through.\n *\n * Following common implementations of pipe functions that use TypeScript,\n * this function supports a maximum arity of 10 for type safety.\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```typescript\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n * @param init The initial value\n * @param fns Any number of functions to pipe the value through\n * @returns The final value with all functions applied\n */\nexport function pipe<TInitial>(init: TInitial): TInitial;\nexport function pipe<TInitial, R1>(init: TInitial, init_r1: (init: TInitial) => R1): R1;\nexport function pipe<TInitial, R1, R2>(init: TInitial, init_r1: (init: TInitial) => R1, r1_r2: (r1: R1) => R2): R2;\nexport function pipe<TInitial, R1, R2, R3>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n): R3;\nexport function pipe<TInitial, R1, R2, R3, R4>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n): R4;\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n): R5;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n): R6;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n): R7;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n): R8;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n): R9;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";;;AAyOO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.browser.cjs","sourcesContent":["/**\n * A pipeline is a solution that allows you to perform successive transforms of a value using functions. This is useful when building up a transaction message.\n *\n * Until the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator) becomes part of JavaScript you can use this utility to create pipelines.\n *\n * Following common implementations of pipe functions that use TypeScript, this function supports a maximum arity of 10 for type safety.\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```ts\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n *\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * @example Basic\n * ```ts\n * const add = (a, b) => a + b;\n * const add10 = x => add(x, 10);\n * const add100 = x => add(x, 100);\n * const sum = pipe(1, add10, add100);\n * sum === 111; // true\n * ```\n *\n * @example Building a Solana transaction message\n * ```ts\n * const transferTransactionMessage = pipe(\n * // The result of the first expression...\n * createTransactionMessage({ version: 0 }),\n * // ...gets passed as the sole argument to the next function in the pipeline.\n * tx => setTransactionMessageFeePayer(myAddress, tx),\n * // The return value of that function gets passed to the next...\n * tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n * // ...and so on.\n * tx => appendTransactionMessageInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),\n * );\n * ```\n *\n * @returns The initial value\n */\nexport function pipe<TInitial>(\n /** The initial value */\n init: TInitial,\n): TInitial;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n): R1;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n): R2;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n): R3;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n): R4;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n): R5;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n): R6;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n): R7;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n): R8;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n): R9;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n /** The function with which to transform the return value of the prior function */\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";AAyGO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.browser.mjs","sourcesContent":["/**\n * General pipe function.\n * Provide an initial value and a list of functions to pipe it through.\n *\n * Following common implementations of pipe functions that use TypeScript,\n * this function supports a maximum arity of 10 for type safety.\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```typescript\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n * @param init The initial value\n * @param fns Any number of functions to pipe the value through\n * @returns The final value with all functions applied\n */\nexport function pipe<TInitial>(init: TInitial): TInitial;\nexport function pipe<TInitial, R1>(init: TInitial, init_r1: (init: TInitial) => R1): R1;\nexport function pipe<TInitial, R1, R2>(init: TInitial, init_r1: (init: TInitial) => R1, r1_r2: (r1: R1) => R2): R2;\nexport function pipe<TInitial, R1, R2, R3>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n): R3;\nexport function pipe<TInitial, R1, R2, R3, R4>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n): R4;\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n): R5;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n): R6;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n): R7;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n): R8;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n): R9;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";AAyOO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.browser.mjs","sourcesContent":["/**\n * A pipeline is a solution that allows you to perform successive transforms of a value using functions. This is useful when building up a transaction message.\n *\n * Until the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator) becomes part of JavaScript you can use this utility to create pipelines.\n *\n * Following common implementations of pipe functions that use TypeScript, this function supports a maximum arity of 10 for type safety.\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```ts\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n *\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * @example Basic\n * ```ts\n * const add = (a, b) => a + b;\n * const add10 = x => add(x, 10);\n * const add100 = x => add(x, 100);\n * const sum = pipe(1, add10, add100);\n * sum === 111; // true\n * ```\n *\n * @example Building a Solana transaction message\n * ```ts\n * const transferTransactionMessage = pipe(\n * // The result of the first expression...\n * createTransactionMessage({ version: 0 }),\n * // ...gets passed as the sole argument to the next function in the pipeline.\n * tx => setTransactionMessageFeePayer(myAddress, tx),\n * // The return value of that function gets passed to the next...\n * tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n * // ...and so on.\n * tx => appendTransactionMessageInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),\n * );\n * ```\n *\n * @returns The initial value\n */\nexport function pipe<TInitial>(\n /** The initial value */\n init: TInitial,\n): TInitial;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n): R1;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n): R2;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n): R3;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n): R4;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n): R5;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n): R6;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n): R7;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n): R8;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n): R9;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n /** The function with which to transform the return value of the prior function */\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";AAyGO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.native.mjs","sourcesContent":["/**\n * General pipe function.\n * Provide an initial value and a list of functions to pipe it through.\n *\n * Following common implementations of pipe functions that use TypeScript,\n * this function supports a maximum arity of 10 for type safety.\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```typescript\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n * @param init The initial value\n * @param fns Any number of functions to pipe the value through\n * @returns The final value with all functions applied\n */\nexport function pipe<TInitial>(init: TInitial): TInitial;\nexport function pipe<TInitial, R1>(init: TInitial, init_r1: (init: TInitial) => R1): R1;\nexport function pipe<TInitial, R1, R2>(init: TInitial, init_r1: (init: TInitial) => R1, r1_r2: (r1: R1) => R2): R2;\nexport function pipe<TInitial, R1, R2, R3>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n): R3;\nexport function pipe<TInitial, R1, R2, R3, R4>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n): R4;\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n): R5;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n): R6;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n): R7;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n): R8;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n): R9;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";AAyOO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.native.mjs","sourcesContent":["/**\n * A pipeline is a solution that allows you to perform successive transforms of a value using functions. This is useful when building up a transaction message.\n *\n * Until the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator) becomes part of JavaScript you can use this utility to create pipelines.\n *\n * Following common implementations of pipe functions that use TypeScript, this function supports a maximum arity of 10 for type safety.\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```ts\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n *\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * @example Basic\n * ```ts\n * const add = (a, b) => a + b;\n * const add10 = x => add(x, 10);\n * const add100 = x => add(x, 100);\n * const sum = pipe(1, add10, add100);\n * sum === 111; // true\n * ```\n *\n * @example Building a Solana transaction message\n * ```ts\n * const transferTransactionMessage = pipe(\n * // The result of the first expression...\n * createTransactionMessage({ version: 0 }),\n * // ...gets passed as the sole argument to the next function in the pipeline.\n * tx => setTransactionMessageFeePayer(myAddress, tx),\n * // The return value of that function gets passed to the next...\n * tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n * // ...and so on.\n * tx => appendTransactionMessageInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),\n * );\n * ```\n *\n * @returns The initial value\n */\nexport function pipe<TInitial>(\n /** The initial value */\n init: TInitial,\n): TInitial;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n): R1;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n): R2;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n): R3;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n): R4;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n): R5;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n): R6;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n): R7;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n): R8;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n): R9;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n /** The function with which to transform the return value of the prior function */\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
package/dist/index.node.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";;;AAyGO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.node.cjs","sourcesContent":["/**\n * General pipe function.\n * Provide an initial value and a list of functions to pipe it through.\n *\n * Following common implementations of pipe functions that use TypeScript,\n * this function supports a maximum arity of 10 for type safety.\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```typescript\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n * @param init The initial value\n * @param fns Any number of functions to pipe the value through\n * @returns The final value with all functions applied\n */\nexport function pipe<TInitial>(init: TInitial): TInitial;\nexport function pipe<TInitial, R1>(init: TInitial, init_r1: (init: TInitial) => R1): R1;\nexport function pipe<TInitial, R1, R2>(init: TInitial, init_r1: (init: TInitial) => R1, r1_r2: (r1: R1) => R2): R2;\nexport function pipe<TInitial, R1, R2, R3>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n): R3;\nexport function pipe<TInitial, R1, R2, R3, R4>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n): R4;\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n): R5;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n): R6;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n): R7;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n): R8;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n): R9;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";;;AAyOO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.node.cjs","sourcesContent":["/**\n * A pipeline is a solution that allows you to perform successive transforms of a value using functions. This is useful when building up a transaction message.\n *\n * Until the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator) becomes part of JavaScript you can use this utility to create pipelines.\n *\n * Following common implementations of pipe functions that use TypeScript, this function supports a maximum arity of 10 for type safety.\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```ts\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n *\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * @example Basic\n * ```ts\n * const add = (a, b) => a + b;\n * const add10 = x => add(x, 10);\n * const add100 = x => add(x, 100);\n * const sum = pipe(1, add10, add100);\n * sum === 111; // true\n * ```\n *\n * @example Building a Solana transaction message\n * ```ts\n * const transferTransactionMessage = pipe(\n * // The result of the first expression...\n * createTransactionMessage({ version: 0 }),\n * // ...gets passed as the sole argument to the next function in the pipeline.\n * tx => setTransactionMessageFeePayer(myAddress, tx),\n * // The return value of that function gets passed to the next...\n * tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n * // ...and so on.\n * tx => appendTransactionMessageInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),\n * );\n * ```\n *\n * @returns The initial value\n */\nexport function pipe<TInitial>(\n /** The initial value */\n init: TInitial,\n): TInitial;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n): R1;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n): R2;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n): R3;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n): R4;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n): R5;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n): R6;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n): R7;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n): R8;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n): R9;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n /** The function with which to transform the return value of the prior function */\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
package/dist/index.node.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";AAyGO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.node.mjs","sourcesContent":["/**\n * General pipe function.\n * Provide an initial value and a list of functions to pipe it through.\n *\n * Following common implementations of pipe functions that use TypeScript,\n * this function supports a maximum arity of 10 for type safety.\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```typescript\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n * @param init The initial value\n * @param fns Any number of functions to pipe the value through\n * @returns The final value with all functions applied\n */\nexport function pipe<TInitial>(init: TInitial): TInitial;\nexport function pipe<TInitial, R1>(init: TInitial, init_r1: (init: TInitial) => R1): R1;\nexport function pipe<TInitial, R1, R2>(init: TInitial, init_r1: (init: TInitial) => R1, r1_r2: (r1: R1) => R2): R2;\nexport function pipe<TInitial, R1, R2, R3>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n): R3;\nexport function pipe<TInitial, R1, R2, R3, R4>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n): R4;\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n): R5;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n): R6;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n): R7;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n): R8;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n): R9;\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n init: TInitial,\n init_r1: (init: TInitial) => R1,\n r1_r2: (r1: R1) => R2,\n r2_r3: (r2: R2) => R3,\n r3_r4: (r3: R3) => R4,\n r4_r5: (r4: R4) => R5,\n r5_r6: (r5: R5) => R6,\n r6_r7: (r6: R6) => R7,\n r7_r8: (r7: R7) => R8,\n r8_r9: (r8: R8) => R9,\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/pipe.ts"],"names":[],"mappings":";AAyOO,SAAS,IAAA,CAAe,SAAmB,GAAyB,EAAA;AACvE,EAAO,OAAA,GAAA,CAAI,OAAO,CAAC,GAAA,EAAK,OAAO,EAAG,CAAA,GAAG,GAAG,IAAI,CAAA;AAChD","file":"index.node.mjs","sourcesContent":["/**\n * A pipeline is a solution that allows you to perform successive transforms of a value using functions. This is useful when building up a transaction message.\n *\n * Until the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator) becomes part of JavaScript you can use this utility to create pipelines.\n *\n * Following common implementations of pipe functions that use TypeScript, this function supports a maximum arity of 10 for type safety.\n *\n * Note you can use nested pipes to extend this limitation, like so:\n * ```ts\n * const myValue = pipe(\n * pipe(\n * 1,\n * (x) => x + 1,\n * (x) => x * 2,\n * (x) => x - 1,\n * ),\n * (y) => y / 3,\n * (y) => y + 1,\n * );\n * ```\n *\n * @see https://github.com/ramda/ramda/blob/master/source/pipe.js\n * @see https://github.com/darky/rocket-pipes/blob/master/index.ts\n *\n * @example Basic\n * ```ts\n * const add = (a, b) => a + b;\n * const add10 = x => add(x, 10);\n * const add100 = x => add(x, 100);\n * const sum = pipe(1, add10, add100);\n * sum === 111; // true\n * ```\n *\n * @example Building a Solana transaction message\n * ```ts\n * const transferTransactionMessage = pipe(\n * // The result of the first expression...\n * createTransactionMessage({ version: 0 }),\n * // ...gets passed as the sole argument to the next function in the pipeline.\n * tx => setTransactionMessageFeePayer(myAddress, tx),\n * // The return value of that function gets passed to the next...\n * tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),\n * // ...and so on.\n * tx => appendTransactionMessageInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),\n * );\n * ```\n *\n * @returns The initial value\n */\nexport function pipe<TInitial>(\n /** The initial value */\n init: TInitial,\n): TInitial;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n): R1;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n): R2;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n): R3;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n): R4;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n): R5;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n): R6;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n): R7;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n): R8;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n): R9;\n/**\n * @returns The return value of the final transform function\n */\nexport function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(\n /** The initial value */\n init: TInitial,\n /** The function with which to transform the initial value */\n init_r1: (init: TInitial) => R1,\n /** The function with which to transform the return value of the prior function */\n r1_r2: (r1: R1) => R2,\n /** The function with which to transform the return value of the prior function */\n r2_r3: (r2: R2) => R3,\n /** The function with which to transform the return value of the prior function */\n r3_r4: (r3: R3) => R4,\n /** The function with which to transform the return value of the prior function */\n r4_r5: (r4: R4) => R5,\n /** The function with which to transform the return value of the prior function */\n r5_r6: (r5: R5) => R6,\n /** The function with which to transform the return value of the prior function */\n r6_r7: (r6: R6) => R7,\n /** The function with which to transform the return value of the prior function */\n r7_r8: (r7: R7) => R8,\n /** The function with which to transform the return value of the prior function */\n r8_r9: (r8: R8) => R9,\n /** The function with which to transform the return value of the prior function */\n r9_r10: (r9: R9) => R10,\n): R10;\nexport function pipe<TInitial>(init: TInitial, ...fns: CallableFunction[]) {\n return fns.reduce((acc, fn) => fn(acc), init);\n}\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This package contains generalized functional helpers and functional helpers specific to Solana application components. It can be used standalone, but it is also exported as part of Kit [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
1
5
|
export * from './pipe';
|
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,QAAQ,CAAC"}
|
package/dist/types/pipe.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Provide an initial value and a list of functions to pipe it through.
|
|
2
|
+
* A pipeline is a solution that allows you to perform successive transforms of a value using functions. This is useful when building up a transaction message.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @see https://github.com/darky/rocket-pipes/blob/master/index.ts
|
|
4
|
+
* Until the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator) becomes part of JavaScript you can use this utility to create pipelines.
|
|
5
|
+
*
|
|
6
|
+
* Following common implementations of pipe functions that use TypeScript, this function supports a maximum arity of 10 for type safety.
|
|
9
7
|
*
|
|
10
8
|
* Note you can use nested pipes to extend this limitation, like so:
|
|
11
|
-
* ```
|
|
9
|
+
* ```ts
|
|
12
10
|
* const myValue = pipe(
|
|
13
11
|
* pipe(
|
|
14
12
|
* 1,
|
|
@@ -20,19 +18,206 @@
|
|
|
20
18
|
* (y) => y + 1,
|
|
21
19
|
* );
|
|
22
20
|
* ```
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
* @
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
*
|
|
22
|
+
* @see https://github.com/ramda/ramda/blob/master/source/pipe.js
|
|
23
|
+
* @see https://github.com/darky/rocket-pipes/blob/master/index.ts
|
|
24
|
+
*
|
|
25
|
+
* @example Basic
|
|
26
|
+
* ```ts
|
|
27
|
+
* const add = (a, b) => a + b;
|
|
28
|
+
* const add10 = x => add(x, 10);
|
|
29
|
+
* const add100 = x => add(x, 100);
|
|
30
|
+
* const sum = pipe(1, add10, add100);
|
|
31
|
+
* sum === 111; // true
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Building a Solana transaction message
|
|
35
|
+
* ```ts
|
|
36
|
+
* const transferTransactionMessage = pipe(
|
|
37
|
+
* // The result of the first expression...
|
|
38
|
+
* createTransactionMessage({ version: 0 }),
|
|
39
|
+
* // ...gets passed as the sole argument to the next function in the pipeline.
|
|
40
|
+
* tx => setTransactionMessageFeePayer(myAddress, tx),
|
|
41
|
+
* // The return value of that function gets passed to the next...
|
|
42
|
+
* tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),
|
|
43
|
+
* // ...and so on.
|
|
44
|
+
* tx => appendTransactionMessageInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),
|
|
45
|
+
* );
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @returns The initial value
|
|
49
|
+
*/
|
|
50
|
+
export declare function pipe<TInitial>(
|
|
51
|
+
/** The initial value */
|
|
52
|
+
init: TInitial): TInitial;
|
|
53
|
+
/**
|
|
54
|
+
* @returns The return value of the final transform function
|
|
55
|
+
*/
|
|
56
|
+
export declare function pipe<TInitial, R1>(
|
|
57
|
+
/** The initial value */
|
|
58
|
+
init: TInitial,
|
|
59
|
+
/** The function with which to transform the initial value */
|
|
60
|
+
init_r1: (init: TInitial) => R1): R1;
|
|
61
|
+
/**
|
|
62
|
+
* @returns The return value of the final transform function
|
|
63
|
+
*/
|
|
64
|
+
export declare function pipe<TInitial, R1, R2>(
|
|
65
|
+
/** The initial value */
|
|
66
|
+
init: TInitial,
|
|
67
|
+
/** The function with which to transform the initial value */
|
|
68
|
+
init_r1: (init: TInitial) => R1,
|
|
69
|
+
/** The function with which to transform the return value of the prior function */
|
|
70
|
+
r1_r2: (r1: R1) => R2): R2;
|
|
71
|
+
/**
|
|
72
|
+
* @returns The return value of the final transform function
|
|
73
|
+
*/
|
|
74
|
+
export declare function pipe<TInitial, R1, R2, R3>(
|
|
75
|
+
/** The initial value */
|
|
76
|
+
init: TInitial,
|
|
77
|
+
/** The function with which to transform the initial value */
|
|
78
|
+
init_r1: (init: TInitial) => R1,
|
|
79
|
+
/** The function with which to transform the return value of the prior function */
|
|
80
|
+
r1_r2: (r1: R1) => R2,
|
|
81
|
+
/** The function with which to transform the return value of the prior function */
|
|
82
|
+
r2_r3: (r2: R2) => R3): R3;
|
|
83
|
+
/**
|
|
84
|
+
* @returns The return value of the final transform function
|
|
85
|
+
*/
|
|
86
|
+
export declare function pipe<TInitial, R1, R2, R3, R4>(
|
|
87
|
+
/** The initial value */
|
|
88
|
+
init: TInitial,
|
|
89
|
+
/** The function with which to transform the initial value */
|
|
90
|
+
init_r1: (init: TInitial) => R1,
|
|
91
|
+
/** The function with which to transform the return value of the prior function */
|
|
92
|
+
r1_r2: (r1: R1) => R2,
|
|
93
|
+
/** The function with which to transform the return value of the prior function */
|
|
94
|
+
r2_r3: (r2: R2) => R3,
|
|
95
|
+
/** The function with which to transform the return value of the prior function */
|
|
96
|
+
r3_r4: (r3: R3) => R4): R4;
|
|
97
|
+
/**
|
|
98
|
+
* @returns The return value of the final transform function
|
|
99
|
+
*/
|
|
100
|
+
export declare function pipe<TInitial, R1, R2, R3, R4, R5>(
|
|
101
|
+
/** The initial value */
|
|
102
|
+
init: TInitial,
|
|
103
|
+
/** The function with which to transform the initial value */
|
|
104
|
+
init_r1: (init: TInitial) => R1,
|
|
105
|
+
/** The function with which to transform the return value of the prior function */
|
|
106
|
+
r1_r2: (r1: R1) => R2,
|
|
107
|
+
/** The function with which to transform the return value of the prior function */
|
|
108
|
+
r2_r3: (r2: R2) => R3,
|
|
109
|
+
/** The function with which to transform the return value of the prior function */
|
|
110
|
+
r3_r4: (r3: R3) => R4,
|
|
111
|
+
/** The function with which to transform the return value of the prior function */
|
|
112
|
+
r4_r5: (r4: R4) => R5): R5;
|
|
113
|
+
/**
|
|
114
|
+
* @returns The return value of the final transform function
|
|
115
|
+
*/
|
|
116
|
+
export declare function pipe<TInitial, R1, R2, R3, R4, R5, R6>(
|
|
117
|
+
/** The initial value */
|
|
118
|
+
init: TInitial,
|
|
119
|
+
/** The function with which to transform the initial value */
|
|
120
|
+
init_r1: (init: TInitial) => R1,
|
|
121
|
+
/** The function with which to transform the return value of the prior function */
|
|
122
|
+
r1_r2: (r1: R1) => R2,
|
|
123
|
+
/** The function with which to transform the return value of the prior function */
|
|
124
|
+
r2_r3: (r2: R2) => R3,
|
|
125
|
+
/** The function with which to transform the return value of the prior function */
|
|
126
|
+
r3_r4: (r3: R3) => R4,
|
|
127
|
+
/** The function with which to transform the return value of the prior function */
|
|
128
|
+
r4_r5: (r4: R4) => R5,
|
|
129
|
+
/** The function with which to transform the return value of the prior function */
|
|
130
|
+
r5_r6: (r5: R5) => R6): R6;
|
|
131
|
+
/**
|
|
132
|
+
* @returns The return value of the final transform function
|
|
133
|
+
*/
|
|
134
|
+
export declare function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7>(
|
|
135
|
+
/** The initial value */
|
|
136
|
+
init: TInitial,
|
|
137
|
+
/** The function with which to transform the initial value */
|
|
138
|
+
init_r1: (init: TInitial) => R1,
|
|
139
|
+
/** The function with which to transform the return value of the prior function */
|
|
140
|
+
r1_r2: (r1: R1) => R2,
|
|
141
|
+
/** The function with which to transform the return value of the prior function */
|
|
142
|
+
r2_r3: (r2: R2) => R3,
|
|
143
|
+
/** The function with which to transform the return value of the prior function */
|
|
144
|
+
r3_r4: (r3: R3) => R4,
|
|
145
|
+
/** The function with which to transform the return value of the prior function */
|
|
146
|
+
r4_r5: (r4: R4) => R5,
|
|
147
|
+
/** The function with which to transform the return value of the prior function */
|
|
148
|
+
r5_r6: (r5: R5) => R6,
|
|
149
|
+
/** The function with which to transform the return value of the prior function */
|
|
150
|
+
r6_r7: (r6: R6) => R7): R7;
|
|
151
|
+
/**
|
|
152
|
+
* @returns The return value of the final transform function
|
|
153
|
+
*/
|
|
154
|
+
export declare function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8>(
|
|
155
|
+
/** The initial value */
|
|
156
|
+
init: TInitial,
|
|
157
|
+
/** The function with which to transform the initial value */
|
|
158
|
+
init_r1: (init: TInitial) => R1,
|
|
159
|
+
/** The function with which to transform the return value of the prior function */
|
|
160
|
+
r1_r2: (r1: R1) => R2,
|
|
161
|
+
/** The function with which to transform the return value of the prior function */
|
|
162
|
+
r2_r3: (r2: R2) => R3,
|
|
163
|
+
/** The function with which to transform the return value of the prior function */
|
|
164
|
+
r3_r4: (r3: R3) => R4,
|
|
165
|
+
/** The function with which to transform the return value of the prior function */
|
|
166
|
+
r4_r5: (r4: R4) => R5,
|
|
167
|
+
/** The function with which to transform the return value of the prior function */
|
|
168
|
+
r5_r6: (r5: R5) => R6,
|
|
169
|
+
/** The function with which to transform the return value of the prior function */
|
|
170
|
+
r6_r7: (r6: R6) => R7,
|
|
171
|
+
/** The function with which to transform the return value of the prior function */
|
|
172
|
+
r7_r8: (r7: R7) => R8): R8;
|
|
173
|
+
/**
|
|
174
|
+
* @returns The return value of the final transform function
|
|
175
|
+
*/
|
|
176
|
+
export declare function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9>(
|
|
177
|
+
/** The initial value */
|
|
178
|
+
init: TInitial,
|
|
179
|
+
/** The function with which to transform the initial value */
|
|
180
|
+
init_r1: (init: TInitial) => R1,
|
|
181
|
+
/** The function with which to transform the return value of the prior function */
|
|
182
|
+
r1_r2: (r1: R1) => R2,
|
|
183
|
+
/** The function with which to transform the return value of the prior function */
|
|
184
|
+
r2_r3: (r2: R2) => R3,
|
|
185
|
+
/** The function with which to transform the return value of the prior function */
|
|
186
|
+
r3_r4: (r3: R3) => R4,
|
|
187
|
+
/** The function with which to transform the return value of the prior function */
|
|
188
|
+
r4_r5: (r4: R4) => R5,
|
|
189
|
+
/** The function with which to transform the return value of the prior function */
|
|
190
|
+
r5_r6: (r5: R5) => R6,
|
|
191
|
+
/** The function with which to transform the return value of the prior function */
|
|
192
|
+
r6_r7: (r6: R6) => R7,
|
|
193
|
+
/** The function with which to transform the return value of the prior function */
|
|
194
|
+
r7_r8: (r7: R7) => R8,
|
|
195
|
+
/** The function with which to transform the return value of the prior function */
|
|
196
|
+
r8_r9: (r8: R8) => R9): R9;
|
|
197
|
+
/**
|
|
198
|
+
* @returns The return value of the final transform function
|
|
199
|
+
*/
|
|
200
|
+
export declare function pipe<TInitial, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(
|
|
201
|
+
/** The initial value */
|
|
202
|
+
init: TInitial,
|
|
203
|
+
/** The function with which to transform the initial value */
|
|
204
|
+
init_r1: (init: TInitial) => R1,
|
|
205
|
+
/** The function with which to transform the return value of the prior function */
|
|
206
|
+
r1_r2: (r1: R1) => R2,
|
|
207
|
+
/** The function with which to transform the return value of the prior function */
|
|
208
|
+
r2_r3: (r2: R2) => R3,
|
|
209
|
+
/** The function with which to transform the return value of the prior function */
|
|
210
|
+
r3_r4: (r3: R3) => R4,
|
|
211
|
+
/** The function with which to transform the return value of the prior function */
|
|
212
|
+
r4_r5: (r4: R4) => R5,
|
|
213
|
+
/** The function with which to transform the return value of the prior function */
|
|
214
|
+
r5_r6: (r5: R5) => R6,
|
|
215
|
+
/** The function with which to transform the return value of the prior function */
|
|
216
|
+
r6_r7: (r6: R6) => R7,
|
|
217
|
+
/** The function with which to transform the return value of the prior function */
|
|
218
|
+
r7_r8: (r7: R7) => R8,
|
|
219
|
+
/** The function with which to transform the return value of the prior function */
|
|
220
|
+
r8_r9: (r8: R8) => R9,
|
|
221
|
+
/** The function with which to transform the return value of the prior function */
|
|
222
|
+
r9_r10: (r9: R9) => R10): R10;
|
|
38
223
|
//# sourceMappingURL=pipe.d.ts.map
|
package/dist/types/pipe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../src/pipe.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../src/pipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,IAAI,CAAC,QAAQ;AACzB,wBAAwB;AACxB,IAAI,EAAE,QAAQ,GACf,QAAQ,CAAC;AACZ;;GAEG;AACH,wBAAgB,IAAI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