[atom] File.read can return Promise<null>

ea686aeffc/src/file.coffee (L270)
This commit is contained in:
Nikolay Yakimov
2018-03-03 23:30:45 +03:00
parent fbba9f55be
commit ca01c72d2a
2 changed files with 3 additions and 2 deletions

View File

@@ -953,7 +953,8 @@ function testFile() {
// Reading and Writing
async function readFile() {
str = await file.read();
const res = await file.read();
if (res !== null) str = res;
}
const stream = file.createReadStream();

View File

@@ -3547,7 +3547,7 @@ export class File {
// Reading and Writing
/** Reads the contents of the file. */
read(flushCache?: boolean): Promise<string>;
read(flushCache?: boolean): Promise<string | null>;
/** Returns a stream to read the content of the file. */
createReadStream(): ReadStream;