@neo-one/smart-contract-codegen-esnext-esm
Version:
NEO•ONE TypeScript smart contract codegen.
16 lines (14 loc) • 628 B
JavaScript
import * as path from 'path';
import { normalizePath } from './normalizePath';
const ensureDot = (value) => (value.startsWith('.') ? value : `./${value}`);
const stripTS = (value) => path.join(path.dirname(value), path.basename(value, value.endsWith('.jsx')
? '.jsx'
: value.endsWith('.tsx')
? '.tsx'
: value.endsWith('.js')
? '.js'
: value.endsWith('.d.ts')
? '.d.ts'
: '.ts'));
export const getRelativeImport = (from, to) => ensureDot(normalizePath(stripTS(path.relative(path.dirname(from), to))));
//# sourceMappingURL=getRelativeImport.js.map