Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mapResults = (result: Future.FutureInstance) =>
// @ts-ignore
result.pipe(Future.map(value => value.rows)).pipe(Future.map(R.map(data => new entityMapperClass(data))))
// compile :: Object config -> Future Error Object
const compile = pipe(
compiler,
Future.chain(compiler => Future((reject, resolve) => {
compiler.run((err, stats) => {
const errors = getErrors(err, stats);
isEmpty(errors) ? resolve(stats) : reject(errors);
});
}))
);
// devServer :: Object config -> Future Error Object
const devServer = pipe(
compiler,
Future.map(compiler => Object.assign(new DevServer(compiler, compiler.options.devServer), { compiler }))
);
// serve :: Object config -> Future Error Object
const serve = pipe(
devServer,
Future.chain(server => Future((reject, resolve) => {
const { compiler } = server;
const { host, port } = compiler.options.devServer;
server.listen(port, host, () => resolve(compiler));
}))
);
// validator :: Object config -> Future Error Object
const validator = pipe(Future.of, Future.ap(Future.of(webpack.validate)));
apNixConfigPath =>
parallel(
1,
apNixConfigPath([
Action.updateEditorConfig(
SELECTED_ENV_CONFIG_KEY,
config,
workspaceRoot
),
flow(
Action.applyEnvByNixConfPath(getShellCmd("env")),
map(showStatus(Label.SELECTED_ENV_NEED_RELOAD, none))
),
Action.askReload
])
).map(some)
)