Sha256: 0dcd81c9bb215261725e09e0c2dabecde253d15fd032402d45d6e02ce5b7301d

Contents?: true

Size: 1.63 KB

Versions: 21

Compression:

Stored size: 1.63 KB

Contents

var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];

function specifierIncluded(specifier) {
    var parts = specifier.split(' ');
    var op = parts.length > 1 ? parts[0] : '=';
    var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');

    for (var i = 0; i < 3; ++i) {
        var cur = parseInt(current[i] || 0, 10);
        var ver = parseInt(versionParts[i] || 0, 10);
        if (cur === ver) {
            continue; // eslint-disable-line no-restricted-syntax, no-continue
        }
        if (op === '<') {
            return cur < ver;
        } else if (op === '>=') {
            return cur >= ver;
        } else {
            return false;
        }
    }
    return op === '>=';
}

function matchesRange(range) {
    var specifiers = range.split(/ ?&& ?/);
    if (specifiers.length === 0) { return false; }
    for (var i = 0; i < specifiers.length; ++i) {
        if (!specifierIncluded(specifiers[i])) { return false; }
    }
    return true;
}

function versionIncluded(specifierValue) {
    if (typeof specifierValue === 'boolean') { return specifierValue; }
    if (specifierValue && typeof specifierValue === 'object') {
        for (var i = 0; i < specifierValue.length; ++i) {
            if (matchesRange(specifierValue[i])) { return true; }
        }
        return false;
    }
    return matchesRange(specifierValue);
}

var data = require('./core.json');

var core = {};
for (var mod in data) { // eslint-disable-line no-restricted-syntax
    if (Object.prototype.hasOwnProperty.call(data, mod)) {
        core[mod] = versionIncluded(data[mod]);
    }
}
module.exports = core;

Version data entries

21 entries across 20 versions & 4 rubygems

Version Path
boring_generators-0.15.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
boring_generators-0.14.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
boring_generators-0.13.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
boring_generators-0.12.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
disco_app-0.16.1 test/dummy/node_modules/resolve/lib/core.js
disco_app-0.15.2 test/dummy/node_modules/resolve/lib/core.js
disco_app-0.18.4 test/dummy/node_modules/resolve/lib/core.js
disco_app-0.18.1 test/dummy/node_modules/resolve/lib/core.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/resolve/lib/core.js
disco_app-0.14.0 test/dummy/node_modules/resolve/lib/core.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/resolve/lib/core.js
boring_generators-0.11.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
boring_generators-0.10.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
boring_generators-0.9.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/resolve/lib/core.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/resolve/lib/core.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/resolve/lib/core.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/resolve/lib/core.js
boring_generators-0.8.0 tmp/templates/app_template/node_modules/resolve/lib/core.js
boring_generators-0.7.0 tmp/templates/app_template/node_modules/resolve/lib/core.js