|
|
@ -1,7 +1,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
export function normalizeContractPath(contractPath: string, returnPath?: boolean): string | string[]{ |
|
|
|
export function normalizeContractPath(contractPath: string): string[]{ |
|
|
|
const paths = contractPath.split('/') |
|
|
|
const paths = contractPath.split('/') |
|
|
|
const filename = paths[paths.length - 1].split('.')[0] |
|
|
|
const filename = paths[paths.length - 1] |
|
|
|
let folders = '' |
|
|
|
let folders = '' |
|
|
|
for (let i = 0; i < paths.length - 1; i++) { |
|
|
|
for (let i = 0; i < paths.length - 1; i++) { |
|
|
|
if(i !== paths.length -1) { |
|
|
|
if(i !== paths.length -1) { |
|
|
@ -9,9 +9,5 @@ export function normalizeContractPath(contractPath: string, returnPath?: boolean |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const resultingPath = `${folders}${filename}` |
|
|
|
const resultingPath = `${folders}${filename}` |
|
|
|
if(returnPath) { |
|
|
|
|
|
|
|
return [folders,resultingPath, filename] |
|
|
|
return [folders,resultingPath, filename] |
|
|
|
} else { |
|
|
|
|
|
|
|
return resultingPath |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|