fluentfixture
ContributionCode of Conduct
  • Fluent Fixture
  • PACKAGES
    • @fluentfixture/core
      • Everything Is A Factory
      • Streams
        • Stream
        • Boolean Stream
        • Number Stream
        • String Stream
        • Date Stream
        • Array Stream
        • Object Stream
      • Generators
      • Live Demo
    • @fluentfixture/format
      • Structure
      • Pipe Functions
        • Built-In Pipes
        • Custom Pipes
      • How To Use
      • Error Handling
      • Live Demo
  • 🫂Contribution
  • 🐦Follow me on Twitter :)
Powered by GitBook
On this page
  • What Is A Pipe Function?
  • Naming Convention
  • Parameters
Edit on GitHub
  1. PACKAGES
  2. @fluentfixture/format

Pipe Functions

PreviousStructureNextBuilt-In Pipes

Last updated 7 months ago

What Is A Pipe Function?

A pipe function is a function that is chained in the format expression. Pipe functions are executed sequentially.

Flow Diagram

The flow diagram of expression${path:func1(param1)|func2(param2)} is illustrated on the following figure.

For the expression above, the execution order;

  • evaluates the path

  • executes func1() with the evaluated value

  • executes func2() with the result of the func1()

  • returns the output of func2()

Naming Convention

A transformation's name must be a valid javascript function name. For clarity, the camel case naming convention is suggested.

Parameters

A transformation function only accepts valid JSON values.

  • number

  • string

  • boolean

  • null

  • JSON object

  • array