mirror of https://github.com/grpc/grpc-node.git
Fix imports for messages without packages
This commit is contained in:
parent
6389e92c8b
commit
2d1cb15dec
|
@ -96,6 +96,9 @@ function getPath(to: Protobuf.Type | Protobuf.Enum | Protobuf.Service) {
|
||||||
|
|
||||||
function getPathToRoot(from: Protobuf.NamespaceBase) {
|
function getPathToRoot(from: Protobuf.NamespaceBase) {
|
||||||
const depth = stripLeadingPeriod(from.fullName).split('.').length - 1;
|
const depth = stripLeadingPeriod(from.fullName).split('.').length - 1;
|
||||||
|
if (depth === 0) {
|
||||||
|
return './';
|
||||||
|
}
|
||||||
let path = '';
|
let path = '';
|
||||||
for (let i = 0; i < depth; i++) {
|
for (let i = 0; i < depth; i++) {
|
||||||
path += '../';
|
path += '../';
|
||||||
|
|
Loading…
Reference in New Issue