44 type LaunchParamsGenType ,
55 type ParseLaunchParamsQueryError ,
66} from '@tma.js/transformers' ;
7- import * as E from 'fp-ts/Either' ;
8- import * as O from 'fp-ts/Option' ;
9- import { pipe } from 'fp-ts/function' ;
7+ import { either as E , function as fn , option as O } from 'fp-ts' ;
108
119import { LaunchParamsRetrieveError } from '@/errors.js' ;
1210
@@ -39,7 +37,7 @@ export function retrieveLaunchParamsFp(): E.Either<
3937 RetrieveLaunchParamsError ,
4038 RetrieveLaunchParamsResult
4139> {
42- return pipe (
40+ return fn . pipe (
4341 retrieveRawLaunchParamsFp ( ) ,
4442 E . chainW ( parseLaunchParamsQueryFp ) ,
4543 ) ;
@@ -55,7 +53,7 @@ export const retrieveLaunchParams: () => RetrieveLaunchParamsResult =
5553 * @returns Raw init data from any known source.
5654 */
5755export function retrieveRawInitDataFp ( ) : E . Either < RetrieveRawInitDataError , O . Option < string > > {
58- return pipe (
56+ return fn . pipe (
5957 retrieveRawLaunchParamsFp ( ) ,
6058 E . map ( raw => {
6159 const v = new URLSearchParams ( raw ) . get ( 'tgWebAppData' ) ;
@@ -68,7 +66,7 @@ export function retrieveRawInitDataFp(): E.Either<RetrieveRawInitDataError, O.Op
6866 * @see retrieveRawInitDataFp
6967 */
7068export function retrieveRawInitData ( ) : string | undefined {
71- return pipe (
69+ return fn . pipe (
7270 retrieveRawInitDataFp ( ) ,
7371 E . fold ( err => {
7472 throw err ;
@@ -101,7 +99,7 @@ export function retrieveRawLaunchParamsFp(): E.Either<RetrieveRawLaunchParamsErr
10199 errors . push ( { source, error : new Error ( 'Source is empty' ) } ) ;
102100 continue ;
103101 }
104- const maybeError = pipe (
102+ const maybeError = fn . pipe (
105103 parseLaunchParamsQueryFp ( v ) ,
106104 E . foldW ( err => err , ( ) => true as const ) ,
107105 ) ;
0 commit comments