index.ts 423 B

1234567891011121314
  1. // @ts-nocheck
  2. export const getLocalFilePath = (path: string) => {
  3. if(typeof plus == 'undefined') return path
  4. if(/^(_www|_doc|_documents|_downloads|file:\/\/|\/storage\/emulated\/0\/)/.test(path)) return path
  5. if (/^\//.test(path)) {
  6. const localFilePath = plus.io.convertAbsoluteFileSystem(path)
  7. if (localFilePath !== path) {
  8. return localFilePath
  9. } else {
  10. path = path.slice(1)
  11. }
  12. }
  13. return '_www/' + path
  14. }