The .withParent() wraps a function such that the overridden function is available under this.parent(input).
Dependending on the context and the implementation this.parent(input) may return a Promise or not.
This makes it hard to implement the overriding function, because the implementor does not always no the exact function that is overridden (this may depend on the loading order of plugins in Thought for example.
Since customize is otherwise promise agnostic, this.parent(input) should always return the same kind of data, which is a promise, even if the parent preprocessor actually returns immediate data.
The .withParent() wraps a function such that the overridden function is available under
this.parent(input)
.Dependending on the context and the implementation
this.parent(input)
may return a Promise or not. This makes it hard to implement the overriding function, because the implementor does not always no the exact function that is overridden (this may depend on the loading order of plugins inThought
for example.Since
customize
is otherwise promise agnostic,this.parent(input)
should always return the same kind of data, which is a promise, even if the parent preprocessor actually returns immediate data.