Skip to content

Commit 39f55a3

Browse files
committed
👍 Add readonly to arguments in buffer module
1 parent b92c354 commit 39f55a3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: buffer/buffer.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ async function ensurePrerequisites(denops: Denops): Promise<string> {
176176
export async function open(
177177
denops: Denops,
178178
bufname: string,
179-
options: OpenOptions = {},
179+
options: Readonly<OpenOptions> = {},
180180
): Promise<OpenResult> {
181181
const suffix = await ensurePrerequisites(denops);
182182
const bang = options.bang ?? false;
@@ -259,7 +259,7 @@ export async function decode(
259259
denops: Denops,
260260
bufnr: number,
261261
data: Uint8Array,
262-
options: DecodeOptions = {},
262+
options: Readonly<DecodeOptions> = {},
263263
): Promise<DecodeResult> {
264264
const [fileformat, fileformatsStr, fileencodingsStr] = await batch.collect(
265265
denops,
@@ -321,8 +321,8 @@ export interface DecodeResult {
321321
export async function append(
322322
denops: Denops,
323323
bufnr: number,
324-
repl: string[],
325-
options: AppendOptions = {},
324+
repl: readonly string[],
325+
options: Readonly<AppendOptions> = {},
326326
): Promise<void> {
327327
const suffix = await ensurePrerequisites(denops);
328328
const lnum = options.lnum ??
@@ -361,8 +361,8 @@ export interface AppendOptions {
361361
export async function replace(
362362
denops: Denops,
363363
bufnr: number,
364-
repl: string[],
365-
options: ReplaceOptions = {},
364+
repl: readonly string[],
365+
options: Readonly<ReplaceOptions> = {},
366366
): Promise<void> {
367367
const suffix = await ensurePrerequisites(denops);
368368
await denops.call(

0 commit comments

Comments
 (0)