Skip to content

Commit 1d44326

Browse files
committed
💪 Use ulid instead of generateUniqueString
1 parent bdd30cb commit 1d44326

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

buffer/buffer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import {
1212
splitText,
1313
} from "./fileformat.ts";
1414
import { tryDecode } from "./fileencoding.ts";
15-
import { generateUniqueString } from "../util.ts";
15+
import { ulid } from "https://deno.land/std@0.211.0/ulid/mod.ts";
1616

1717
const cacheKey = "denops_std/buffer/buffer.ts@1";
1818

1919
async function ensurePrerequisites(denops: Denops): Promise<string> {
2020
if (typeof denops.context[cacheKey] === "string") {
2121
return denops.context[cacheKey];
2222
}
23-
const suffix = generateUniqueString();
23+
const suffix = ulid();
2424
denops.context[cacheKey] = suffix;
2525
const script = `
2626
function! DenopsStdBufferOpen_${suffix}(bang, mods, opener, cmdarg, bufname) abort

function/getreginfo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import type { Denops } from "https://deno.land/x/denops_core@v6.0.5/mod.ts";
22
import { lt, parse } from "https://deno.land/std@0.211.0/semver/mod.ts";
33
import { execute } from "../helper/mod.ts";
4-
import { generateUniqueString } from "../util.ts";
4+
import { ulid } from "https://deno.land/std@0.211.0/ulid/mod.ts";
55

66
const cacheKey = "denops_std/function/getreginfo.ts@1";
77

88
async function ensurePrerequisites(denops: Denops): Promise<string> {
99
if (typeof denops.context[cacheKey] === "string") {
1010
return denops.context[cacheKey];
1111
}
12-
const suffix = generateUniqueString();
12+
const suffix = ulid();
1313
denops.context[cacheKey] = suffix;
1414
const script = `
1515
function! DenopsStdFunctionGetreginfo_${suffix}(...) abort

helper/echo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Denops } from "https://deno.land/x/denops_core@v6.0.5/mod.ts";
22
import { execute } from "./execute.ts";
3-
import { generateUniqueString } from "../util.ts";
3+
import { ulid } from "https://deno.land/std@0.211.0/ulid/mod.ts";
44

55
const cacheKey = "denops_std/helper/echo@1";
66
const cacheKeySilent = "denops_std/helper/echo/silent@1";
@@ -9,7 +9,7 @@ async function ensurePrerequisites(denops: Denops): Promise<string> {
99
if (typeof denops.context[cacheKey] === "string") {
1010
return denops.context[cacheKey];
1111
}
12-
const suffix = generateUniqueString();
12+
const suffix = ulid();
1313
denops.context[cacheKey] = suffix;
1414
const script = `
1515
let g:loaded_denops_std_helper_echo_${suffix} = 1

helper/expr_string.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
} from "https://deno.land/x/denops_core@v6.0.5/mod.ts";
77
import is from "https://deno.land/x/unknownutil@v3.11.0/is.ts";
88
import { execute } from "./execute.ts";
9-
import { generateUniqueString } from "../util.ts";
9+
import { ulid } from "https://deno.land/std@0.211.0/ulid/mod.ts";
1010

1111
const EXPR_STRING_MARK = "__denops_expr_string";
1212

@@ -33,7 +33,7 @@ async function ensurePrerequisites(denops: Denops): Promise<string> {
3333
if (is.String(denops.context[cacheKey])) {
3434
return denops.context[cacheKey];
3535
}
36-
const suffix = generateUniqueString();
36+
const suffix = ulid();
3737
denops.context[cacheKey] = suffix;
3838
const script = `
3939
let g:loaded_denops_std_helper_exprStr_${suffix} = 1

helper/input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { assert, is } from "https://deno.land/x/unknownutil@v3.11.0/mod.ts";
33
import * as fn from "../function/mod.ts";
44
import * as lambda from "../lambda/mod.ts";
55
import { execute } from "./execute.ts";
6-
import { generateUniqueString } from "../util.ts";
6+
import { ulid } from "https://deno.land/std@0.211.0/ulid/mod.ts";
77

88
const cacheKey = "denops_std/helper/input@1";
99

1010
async function ensurePrerequisites(denops: Denops): Promise<string> {
1111
if (typeof denops.context[cacheKey] === "string") {
1212
return denops.context[cacheKey];
1313
}
14-
const suffix = generateUniqueString();
14+
const suffix = ulid();
1515
denops.context[cacheKey] = suffix;
1616
const script = `
1717
let s:loaded_denops_std_helper_input_${suffix} = 1

0 commit comments

Comments
 (0)