jio.console.JsPrettyCommand Maven / Gradle / Ivy
package jio.console;
import jio.IO;
import jsonvalues.JsObj;
import java.util.function.Function;
class JsPrettyCommand extends Command {
private static final String COMMAND_NAME = "json-pretty";
public JsPrettyCommand() {
super(COMMAND_NAME,
"Returns the json placed at the output variable in a pretty format"
);
}
@Override
public Function> apply(final JsObj conf,
final State state
) {
return tokens -> IO.lazy(() ->
Functions.toJson
.apply(state.variables.get("output"))
.toPrettyString()
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy