selfrefactor / rambdax

Extended version of Rambda
https://selfrefactor.github.io/rambdax
MIT License
221 stars 26 forks source link

switcher cannot return function #12

Closed selfrefactor closed 6 years ago

selfrefactor commented 6 years ago
/**
 * Stringify according to the type of input
 */
function normalize(input: any): string {
  const method = switcher<Function>(type(input))
    .is('String', identity)
    .default(identity)

  console.log(method)
  return method(input)
}