Pipe
The pipe class makes it possible to combine several processing steps.
import { Pipe } from "@schukai/monster/source/data/pipe.mjs";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 WORLDExported
PipeDerived from
BaseOptions
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.
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)pipe{string}: a pipe consists of commands whose input and output are connected with the pipe symbol `|`.
{TypeError}
Structural methods
setCallback(name,callback,context)name{string}: namecallback{function}: callbackcontext{object}: context
- {Pipe}
{TypeError}value is not a string{TypeError}value is not a function
Other methods
run(value)value{*}: value
- {*}
Events
This component does not fire any public events. It may fire events that are inherited from its parent classes.