Pipe

The pipe class makes it possible to combine several processing steps.

Import
the javascript logo
import { Pipe } from "@schukai/monster/source/data/pipe.mjs";
Source
the git logo
Package
the npm logo
Since
1.5.0

import {Pipe} from '@schukai/monster/source/data/pipe.mjs';

let obj = {
    a: {
        b: {
            c: {
                d: "world"
            }
        }
    }
}

console.log(new Pipe('path:a.b.c.d | toupper | prefix:Hello\\ ').run(obj));
// ↦ Hello WORLD

Exported

Pipe

Derived from

Base

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the Base.

Option
Type
Default
Description
-/-

Properties

The Properties listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Properties from these parent classes. If you cannot find a specific Properties in this list, we recommend consulting the documentation of the Base.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the Base.

Constructor

constructor(pipe)
Parameters
  • pipe {string}: a pipe consists of commands whose input and output are connected with the pipe symbol `|`.
Throws
  • {TypeError}

Structural methods

setCallback(name,callback,context)
Parameters
  • name {string}: name
  • callback {function}: callback
  • context {object}: context
Returns
  • {Pipe}
Throws
  • {TypeError} value is not a string
  • {TypeError} value is not a function

Other methods

run(value)
Parameters
  • value {*}: value
Returns
  • {*}
run a pipe

Events

This component does not fire any public events. It may fire events that are inherited from its parent classes.

The current width of the area is too small to display the content correctly.