ialpert / vorpal-as-default

Plugin for Vorpal that run defined command if no commands where specified previously

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

require('vorpal-as-default').default

aegyed91 opened this issue · comments

something goes wrong in the transpilation process

const asDefault = require('vorpal-as-default').default;

lib/index.js:

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = function (vorpal, name) {
  var isCommandExists = vorpal.find(name);
  var isHistoryEmpty = !vorpal.cmdHistory.getPreviousHistory();

  if (isHistoryEmpty && isCommandExists) {
    vorpal.execSync(name);
  }

  return vorpal;
};

@tsm91 This is how Babel transpilation works. If you import using CommonJS, you will need to append .default.