Skip to content

Commit

Permalink
style: 💄 run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jun 16, 2023
1 parent 65580aa commit e23557e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
21 changes: 13 additions & 8 deletions src/fsa-to-node/FsaNodeFs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,19 @@ export class FsaNodeFs implements FsCallbackApi {
const [opts, callback] = getAppendFileOptsAndCb(a, b);
const buffer = dataToBuffer(data, opts.encoding);
this.getFileByIdOrCreate(id, 'appendFile')
.then(file => (async () => {
const blob = await file.getFile();
const writable = await file.createWritable({ keepExistingData: true });
await writable.seek(blob.size);
await writable.write(buffer);
await writable.close();
})())
.then(() => callback(null), error => callback(error));
.then(file =>
(async () => {
const blob = await file.getFile();
const writable = await file.createWritable({ keepExistingData: true });
await writable.seek(blob.size);
await writable.write(buffer);
await writable.close();
})(),
)
.then(
() => callback(null),
error => callback(error),
);
};

public readonly readdir: FsCallbackApi['readdir'] = (path: misc.PathLike, a?, b?) => {
Expand Down
2 changes: 1 addition & 1 deletion src/fsa-to-node/__tests__/FsaNodeFs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('.appendFile()', () => {
});

test('can append to a file - 2', async () => {
const { fs, mfs } = setup({ file: '123'});
const { fs, mfs } = setup({ file: '123' });
await fs.promises.appendFile('file', 'x');
expect(mfs.readFileSync('/mountpoint/file', 'utf8')).toBe('123x');
});
Expand Down
2 changes: 1 addition & 1 deletion src/node/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FLAGS, MODE } from './constants';
import { assertEncoding } from '../encoding';
import * as misc from './types/misc';
import { validateCallback } from './util';
import {IAppendFileOptions} from '../volume';
import { IAppendFileOptions } from '../volume';

const mkdirDefaults: opts.IMkdirOptions = {
mode: MODE.DIR,
Expand Down
4 changes: 2 additions & 2 deletions src/node/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ERRSTR, FLAGS } from './constants';
import * as errors from '../internal/errors';
import type { FsCallbackApi } from './types';
import type * as misc from './types/misc';
import {ENCODING_UTF8} from '../encoding';
import {bufferFrom} from '../internal/buffer';
import { ENCODING_UTF8 } from '../encoding';
import { bufferFrom } from '../internal/buffer';

export const isWin = process.platform === 'win32';

Expand Down

0 comments on commit e23557e

Please sign in to comment.