Sha256: b327216e353abb9279fa317a97431c767d3ed025c02b68d1f0d36682b11b3a37

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 KB

Contents

var abbrev = require('abbrev');
var mout = require('mout');
var commands = require('./commands');
var pkg = require('../package.json');

var abbreviations = abbrev(expandNames(commands));
abbreviations.i = 'install';
abbreviations.rm = 'uninstall';
abbreviations.unlink = 'uninstall';
abbreviations.ls = 'list';

function expandNames(obj, prefix, stack) {
    prefix = prefix || '';
    stack = stack || [];

    mout.object.forOwn(obj, function (value, name) {
        name = prefix + name;

        stack.push(name);

        if (typeof value === 'object' && !value.line) {
            expandNames(value, name + ' ', stack);
        }
    });

    return stack;
}

function clearRuntimeCache() {
    // Note that in edge cases, some architecture components instance's
    // in-memory cache might be skipped.
    // If that's a problem, you should create and fresh instances instead.
    var PackageRepository = require('./core/PackageRepository');
    PackageRepository.clearRuntimeCache();
}

module.exports = {
    version: pkg.version,
    commands: commands,
    config: require('./config')(),
    abbreviations: abbreviations,
    reset: clearRuntimeCache
};

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/lib/index.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/lib/index.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/lib/index.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/lib/index.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/lib/index.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/lib/index.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/lib/index.js