Skip to content

Commit be3b426

Browse files
committed
chore: mid work
1 parent 50079e4 commit be3b426

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

packages/jsii-pacmak/lib/targets/python/type-name.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -480,29 +480,6 @@ export function toPythonFqn(fqn: string, rootAssm: Assembly) {
480480
return { assemblyName, packageName, pythonFqn: fqnParts.join('.') };
481481
}
482482

483-
/**
484-
* Computes the python relative import path from `fromModule` to `toModule`.
485-
*
486-
* @param fromPkg the package where the relative import statement is located.
487-
* @param toPkg the package that needs to be relatively imported.
488-
*
489-
* @returns a relative import path.
490-
*
491-
* @example
492-
* relativeImportPath('A.B.C.D', 'A.B.E') === '...E';
493-
* relativeImportPath('A.B.C', 'A.B') === '..';
494-
* relativeImportPath('A.B', 'A.B.C') === '.C';
495-
*/
496-
function relativeImportPath(fromPkg: string, toPkg: string): string {
497-
if (toPkg.startsWith(fromPkg)) {
498-
// from A.B to A.B.C === .C
499-
return `.${toPkg.substring(fromPkg.length + 1)}`;
500-
}
501-
// from A.B.E to A.B.C === .<from A.B to A.B.C>
502-
const fromPkgParent = fromPkg.substring(0, fromPkg.lastIndexOf('.'));
503-
return `.${relativeImportPath(fromPkgParent, toPkg)}`;
504-
}
505-
506483
function getPackageName(fqn: string, rootAssm: Assembly) {
507484
const segments = fqn.split('.');
508485
const assemblyName = segments[0];

0 commit comments

Comments
 (0)