Frontend-Common/fn/thread.ts

12 lines
269 B
TypeScript

import * as R from 'ramda'
type Transformer = (value: any) => any
const pipe = R.pipe as unknown as (...fs: Transformer[]) => (value: any) => any
export const thread = (value: any, fs: Transformer[]) => {
const transform = pipe(...fs)
return transform(value)
}