Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memo File Issue #2

Open
Youssef93 opened this issue May 28, 2020 · 1 comment
Open

Memo File Issue #2

Youssef93 opened this issue May 28, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Youssef93
Copy link

1- You can no longer pass a stream to the function because of the line

let path = `${source.slice(0, source.indexOf('.'))}.fpt`;

Suggested Solution:

  const filePath = (isStream.readable(source))? source.path: source;
  let path = `${filePath.slice(0, filePath.indexOf('.'))}.fpt`;

2- if the .fpt file does not exist you get

Cannot read property 'getBlockContentAt' of null

because the memofile does not exist

Suggested Solution:

Make it optional & if it does not exist just return empty string the corresponding column

@LaurenceJJones LaurenceJJones self-assigned this May 29, 2020
@LaurenceJJones
Copy link
Owner

LaurenceJJones commented May 29, 2020

I didn 't use the package as a stream so didn't catch this issue:
but here an idea?

const isReadable = isStream.readable(source)
const readStream = isReadable  ? source : fs.createReadStream(source);
const filePath = isReadable ? source.path : source;
let path = `${filePath.slice(0, filePath.indexOf('.'))}.fpt`;

I will work on the memofile null issue as it needs to be improved

@LaurenceJJones LaurenceJJones added the bug Something isn't working label May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants