squash! grpc-js: rename grpc-js-core to match npm

This commit is contained in:
cjihrig 2018-11-04 11:20:08 -05:00
parent 489305db79
commit c8266e56d0
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
1 changed files with 11 additions and 7 deletions

View File

@ -5,14 +5,18 @@
const _ = require('lodash');
function getImplementation(globalField) {
if (global[globalField] !== 'js' && global[globalField] !== 'native') {
throw new Error([
`Invalid value for global.${globalField}: ${global.globalField}.`,
'If running from the command line, please --require a fixture first.'
].join(' '));
}
const impl = global[globalField];
return require(`../packages/grpc-${impl}-core`);
if (impl === 'js') {
return require(`../packages/grpc-${impl}`);
} else if (impl === 'native') {
return require(`../packages/grpc-${impl}-core`);
}
throw new Error([
`Invalid value for global.${globalField}: ${global.globalField}.`,
'If running from the command line, please --require a fixture first.'
].join(' '));
}
const clientImpl = getImplementation('_client_implementation');