Skip to content

Commit f38feeb

Browse files
committed
💪 Add readonly to function parameters in buffer/decoration.ts
1 parent fbc478c commit f38feeb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

buffer/decoration.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export interface Decoration {
6363
export function decorate(
6464
denops: Denops,
6565
bufnr: number,
66-
decorations: Decoration[],
66+
decorations: readonly Decoration[],
6767
): Promise<void> {
6868
switch (denops.meta.host) {
6969
case "vim":
@@ -133,14 +133,14 @@ export function undecorate(
133133
}
134134
}
135135

136-
function uniq<T>(array: T[]): T[] {
136+
function uniq<T>(array: readonly T[]): T[] {
137137
return [...new Set(array)];
138138
}
139139

140140
async function vimDecorate(
141141
denops: Denops,
142142
bufnr: number,
143-
decorations: Decoration[],
143+
decorations: readonly Decoration[],
144144
): Promise<void> {
145145
const toPropType = (n: string) => `${prefix}:${n}`;
146146
const rs = (denops.context[cacheKey] ?? new Set()) as Set<string>;
@@ -195,7 +195,7 @@ async function vimUndecorate(
195195
async function nvimDecorate(
196196
denops: Denops,
197197
bufnr: number,
198-
decorations: Decoration[],
198+
decorations: readonly Decoration[],
199199
): Promise<void> {
200200
const ns = await nvimFn.nvim_create_namespace(denops, prefix);
201201
for (const chunk of itertools.chunked(decorations, 1000)) {

0 commit comments

Comments
 (0)