Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

skava / @skava/composer   js

Repository URL to install this package:

Version: 1.4.0 

/ src / OverridePlugin / deps.ts

import { resolve } from 'path'
import { config } from '@skava/di'
import { exists as doesFileExist } from 'flipfile'

export function resolveToRoot(relativePath: string) {
  const appRootDir = config.get('appRootDir')
  return resolve(appRootDir, relativePath)
}

// export function resolveToMono(relativePath: string) {}

export function oneUp(appRootDir: string): string {
  const appRootDirList = appRootDir.split('/')
  appRootDirList.pop()
  const appRootOneUp = appRootDirList.join('/')
  return appRootOneUp
}

export function exists(path: string) {
  return (
    doesFileExist(path) ||
    doesFileExist(path + '.tsx') ||
    doesFileExist(path + '.js')
  )
}