wallet-core/node_modules/resolve/lib/core.js

23 lines
705 B
JavaScript
Raw Normal View History

2017-05-28 00:38:50 +02:00
var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];
function versionIncluded(version) {
if (version === '*') return true;
var versionParts = version.split('.');
for (var i = 0; i < 3; ++i) {
if ((current[i] || 0) >= (versionParts[i] || 0)) return true;
}
return false;
}
var data = require('./core.json');
var core = {};
for (var version in data) { // eslint-disable-line no-restricted-syntax
if (Object.prototype.hasOwnProperty.call(data, version) && versionIncluded(version)) {
for (var i = 0; i < data[version].length; ++i) {
core[data[version][i]] = true;
}
}
}
module.exports = core;