UNPKG

pnpm

Version:

A fast implementation of npm install

23 lines 617 B
"use strict"; /** * Returns bins for a package in a standard object format. This normalizes * between npm's string and object formats. * * @example * binify({ name: 'rimraf', bin: 'cmd.js' }) * => { rimraf: 'cmd.js' } * * binify({ name: 'rmrf', bin: { rmrf: 'cmd.js' } }) * => { rmrf: 'cmd.js' } */ function binify(pkg) { if (typeof pkg.bin === 'string') { const obj = {}; obj[pkg.name] = pkg.bin; return obj; } return pkg.bin || {}; } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = binify; //# sourceMappingURL=binify.js.map