Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Allow inspecting the API default exports without erroring #152

Merged
merged 1 commit into from
Mar 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/neutrino/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const Api = require('./api');
const Neutrino = require('./api');
const { partial } = require('ramda');
const Future = require('fluture');
const { getNodeEnv, toArray } = require('./utils');

// run :: (String command -> Array middleware -> Object options) -> Future Error a
const run = (command, middleware, options) => {
const api = Api(options);
const api = Neutrino(options);

process.env.NODE_ENV = getNodeEnv(command, api.options.args && api.options.args.env);

Expand Down Expand Up @@ -37,10 +37,12 @@ const start = partial(run, ['start']);
const test = partial(run, ['test']);

module.exports = {
Neutrino: Api,
Neutrino,
run,
build,
inspect,
start,
test
test,
inspect(middleware, options = {}) {
return options.customInspect ? this : inspect(middleware, options);
}
};