babel-plugin-lodash
Version:
Modular Lodash builds without the hassle.
33 lines (22 loc) • 939 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var reLodash = /^lodash(?:-compat|-es)?$/;
/*----------------------------------------------------------------------------*/
var Package = function Package(pkgPath) {
_classCallCheck(this, Package);
pkgPath = _lodash2.default.toString(pkgPath);
var parts = pkgPath.split('/');
this.base = _lodash2.default.tail(parts).join('/');
this.id = parts[0];
this.isLodash = _lodash2.default.constant(reLodash.test(this.id));
this.path = pkgPath;
};
exports.default = Package;
;
module.exports = exports['default'];