forked from enviPath/enviPy
Current Dev State
This commit is contained in:
22
static/js/ketcher2/node_modules/individual/one-version.js
generated
vendored
Normal file
22
static/js/ketcher2/node_modules/individual/one-version.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var Individual = require('./index.js');
|
||||
|
||||
module.exports = OneVersion;
|
||||
|
||||
function OneVersion(moduleName, version, defaultValue) {
|
||||
var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName;
|
||||
var enforceKey = key + '_ENFORCE_SINGLETON';
|
||||
|
||||
var versionValue = Individual(enforceKey, version);
|
||||
|
||||
if (versionValue !== version) {
|
||||
throw new Error('Can only have one copy of ' +
|
||||
moduleName + '.\n' +
|
||||
'You already have version ' + versionValue +
|
||||
' installed.\n' +
|
||||
'This means you cannot install version ' + version);
|
||||
}
|
||||
|
||||
return Individual(key, defaultValue);
|
||||
}
|
||||
Reference in New Issue
Block a user