Skip to content

Commit 2150521

Browse files
committed
fix: remove semi colons commited
1 parent a6e23b1 commit 2150521

11 files changed

Lines changed: 1057 additions & 1065 deletions

File tree

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,5 @@
133133
"tsv": "^0.2.0",
134134
"typescript": "^4.8.4"
135135
},
136-
"license": "Apache-2.0 OR MIT",
137-
"packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
136+
"license": "Apache-2.0 OR MIT"
138137
}

src/api.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import type {
1414
MultihashHasher,
1515
MultihashDigest,
1616
EncodedFile,
17-
} from "./file.js";
17+
} from "./file.js"
1818

1919
import type {
2020
DirectoryEntry,
2121
Writer as DirectoryWriter,
2222
View as DirectoryWriterView,
2323
Options as DirectoryWriterOptions,
2424
State as DirectoryWriterState,
25-
} from "./directory.js";
26-
import { Metadata, FileLink } from "./unixfs.js";
25+
} from "./directory.js"
26+
import { Metadata, FileLink } from "./unixfs.js"
2727

2828
export type {
2929
WriterOptions,
@@ -48,7 +48,7 @@ export type {
4848
MultihashDigest,
4949
Metadata,
5050
FileLink,
51-
};
51+
}
5252

5353
/**
5454
*
@@ -57,7 +57,7 @@ export interface Writer {
5757
/**
5858
* Closes this writer and corresponding
5959
*/
60-
close(options?: CloseOptions): Promise<this>;
60+
close(options?: CloseOptions): Promise<this>
6161
}
6262

6363
/**
@@ -71,12 +71,12 @@ export interface View<L extends unknown = unknown> extends Writer {
7171
/**
7272
* Underlaying stream where [UnixFS][] blocks will be written into.
7373
*/
74-
readonly writer: BlockWriter;
74+
readonly writer: BlockWriter
7575
/**
7676
* Encoder configuration of this writer.
7777
*/
7878

79-
readonly settings: EncoderSettings<L>;
79+
readonly settings: EncoderSettings<L>
8080

8181
/**
8282
* Creates new file writer that will write blocks into the same underlying
@@ -85,7 +85,7 @@ export interface View<L extends unknown = unknown> extends Writer {
8585
*/
8686
createFileWriter<Layout>(
8787
settings?: WriterOptions<Layout>
88-
): FileWriterView<L | Layout>;
88+
): FileWriterView<L | Layout>
8989

9090
/**
9191
* Creates new directory writer that will write blocks into the same
@@ -95,10 +95,10 @@ export interface View<L extends unknown = unknown> extends Writer {
9595
*/
9696
createDirectoryWriter<Layout>(
9797
settings?: WriterOptions<Layout>
98-
): DirectoryWriterView<L | Layout>;
98+
): DirectoryWriterView<L | Layout>
9999
}
100100

101101
export interface Options<Layout extends unknown = unknown> {
102-
writable: WritableBlockStream;
103-
settings?: EncoderSettings<Layout>;
102+
writable: WritableBlockStream
103+
settings?: EncoderSettings<Layout>
104104
}

src/file.js

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import * as API from "./file/api.js";
2-
import * as UnixFS from "./codec.js";
3-
import * as Writer from "./file/writer.js";
4-
import * as Task from "actor";
5-
import { panic } from "./writer/util.js";
6-
import * as FixedSize from "./file/chunker/fixed.js";
7-
import { sha256 } from "multiformats/hashes/sha2";
8-
import { CID } from "multiformats/cid";
9-
import * as Balanced from "./file/layout/balanced.js";
1+
import * as API from "./file/api.js"
2+
import * as UnixFS from "./codec.js"
3+
import * as Writer from "./file/writer.js"
4+
import * as Task from "actor"
5+
import { panic } from "./writer/util.js"
6+
import * as FixedSize from "./file/chunker/fixed.js"
7+
import { sha256 } from "multiformats/hashes/sha2"
8+
import { CID } from "multiformats/cid"
9+
import * as Balanced from "./file/layout/balanced.js"
1010

11-
export * from "./file/api.js";
11+
export * from "./file/api.js"
1212

1313
/**
1414
* @returns {API.EncoderSettings}
@@ -21,7 +21,7 @@ export const defaults = () => ({
2121
fileLayout: Balanced.withWidth(174),
2222
hasher: sha256,
2323
linker: { createLink: CID.createV1 },
24-
});
24+
})
2525

2626
/**
2727
* @template {unknown} Layout
@@ -31,19 +31,19 @@ export const defaults = () => ({
3131
export const configure = (config) => ({
3232
...defaults(),
3333
...config,
34-
});
34+
})
3535

3636
export const UnixFSLeaf = {
3737
code: UnixFS.code,
3838
name: UnixFS.name,
3939
encode: UnixFS.encodeFileChunk,
40-
};
40+
}
4141

4242
export const UnixFSRawLeaf = {
4343
code: UnixFS.code,
4444
name: UnixFS.name,
4545
encode: UnixFS.encodeRaw,
46-
};
46+
}
4747

4848
/**
4949
* @template Layout
@@ -58,7 +58,7 @@ export const create = ({
5858
}) =>
5959
new FileWriterView(
6060
Writer.init(writer, metadata, configure(settings), initOptions)
61-
);
61+
)
6262

6363
/**
6464
* @template T
@@ -68,9 +68,9 @@ export const create = ({
6868
*/
6969

7070
export const write = async (view, bytes) => {
71-
await perform(view, Task.send({ type: "write", bytes }));
72-
return view;
73-
};
71+
await perform(view, Task.send({ type: "write", bytes }))
72+
return view
73+
}
7474

7575
/**
7676
* @template T
@@ -81,22 +81,22 @@ export const close = async (
8181
view,
8282
{ releaseLock = false, closeWriter = false } = {}
8383
) => {
84-
await perform(view, Task.send({ type: "close" }));
85-
const { state } = view;
84+
await perform(view, Task.send({ type: "close" }))
85+
const { state } = view
8686
if (state.status === "linked") {
8787
if (closeWriter) {
88-
await view.state.writer.close();
88+
await view.state.writer.close()
8989
} else if (releaseLock) {
90-
view.state.writer.releaseLock();
90+
view.state.writer.releaseLock()
9191
}
92-
return state.link;
92+
return state.link
9393
/* c8 ignore next 5 */
9494
} else {
9595
panic(
9696
`Expected writer to be in 'linked' state after close, but it is in "${state.status}" instead`
97-
);
97+
)
9898
}
99-
};
99+
}
100100

101101
/**
102102
* @template T
@@ -106,11 +106,11 @@ export const close = async (
106106
const perform = (view, effect) =>
107107
Task.fork(
108108
Task.loop(effect, (message) => {
109-
const { state, effect } = Writer.update(message, view.state);
110-
view.state = state;
111-
return effect;
109+
const { state, effect } = Writer.update(message, view.state)
110+
view.state = state
111+
return effect
112112
})
113-
);
113+
)
114114

115115
/**
116116
* @template Layout
@@ -121,26 +121,26 @@ class FileWriterView {
121121
* @param {Writer.State<Layout>} state
122122
*/
123123
constructor(state) {
124-
this.state = state;
124+
this.state = state
125125
}
126126
get writer() {
127-
return this.state.writer;
127+
return this.state.writer
128128
}
129129
get settings() {
130-
return this.state.config;
130+
return this.state.config
131131
}
132132
/**
133133
* @param {Uint8Array} bytes
134134
* @returns {Promise<API.View<Layout>>}
135135
*/
136136
write(bytes) {
137-
return write(this, bytes);
137+
return write(this, bytes)
138138
}
139139
/**
140140
* @param {API.CloseOptions} [options]
141141
* @returns {Promise<UnixFS.FileLink>}
142142
*/
143143
close(options) {
144-
return close(this, options);
144+
return close(this, options)
145145
}
146146
}

0 commit comments

Comments
 (0)