Skip to content

applySpec doesn't play nicely with pipe #627

@rakeshpai

Description

@rakeshpai

If we use a function constructed using pipe as part of an applySpec call, it just returns an empty object.

Here's some code to illustrate the issue:

import { applySpec, pipe, length } from "rambda";

const array = [1, 2, 3, 4, 5];

console.log(
  applySpec({
    len: length
  })(array)
); // prints { len: 5 } This is fine

console.log(
  applySpec({
    len: pipe(length)
  })(array)
); // prints {} <-- This is unexpected

To keep the example simple, I've used only one function in pipe, but that shouldn't matter.

You can try this out in a codesandbox here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions